fbb-7.0.10/0000755000175000017500000000000013747536101007340 500000000000000fbb-7.0.10/Makefile.in0000644000175000017500000006475013747457127011353 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) 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 = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir distdir-am dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in AUTHORS \ COPYING ChangeLog INSTALL NEWS README ar-lib compile \ install-sh missing 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__post_remove_distdir = $(am__remove_distdir) 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 $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip 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@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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 = man doc etc scripts include src #EXTRA_DIST = ax25apps.spec SVNREV ACLOCAL_AMFLAGS = -I m4 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 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ 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 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ 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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_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*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(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*) \ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(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/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(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__post_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: @$(NORMAL_INSTALL) $(MAKE) $(AM_MAKEFLAGS) install-data-hook 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: $(am__recursive_targets) all install-am install-data-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip 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-data-hook 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-am uninstall uninstall-am .PRECIOUS: Makefile installconf: (cd $(top_srcdir)/etc && $(MAKE) installconf) # Build the folder tree for fbb and remind user to run make installconf install-data-hook: $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/filter $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/pg $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/server $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/tool $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/error_return $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/end_session $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/rerun $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/maintenance $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/stop_system $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/sig_segv $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/reset $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/log $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/oldmail $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/sat $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/wp $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/fbbdos $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/fbbdos/yapp $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/fbbdos/readonly $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/mail for n in 0 1 2 3 4 5 6 7 8 9; do \ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/mail/mail$$n; \ done $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/binmail for n in 0 1 2 3 4 5 6 7 8 9; do \ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/binmail/mail$$n; \ done @echo @echo " *** Read the \'README' if you haven't already done so!" @echo " *** " @echo " *** Remember to run \'make installconf' if this is a new installation." @echo " *** This will install the default configuration files, BUT it WILL" @echo " *** overwrite any existing config files you have." @echo " ***" @echo " *** If you are upgrading an existing configuration, you do not need" @echo " *** to run \'make installconf'." @echo # 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: fbb-7.0.10/INSTALL0000644000175000017500000003661413747457127010335 00000000000000Installation Instructions ************************* Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software Foundation, Inc. Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. This file is offered as-is, without warranty of any kind. Basic Installation ================== Briefly, the shell command './configure && make && make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the 'README' file for instructions specific to this package. Some packages provide this 'INSTALL' file but do not implement all of the features documented below. The lack of an optional feature in a given package is not necessarily a bug. More recommendations for GNU packages can be found in *note Makefile Conventions: (standards)Makefile Conventions. The 'configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a 'Makefile' in each directory of the package. It may also create one or more '.h' files containing system-dependent definitions. Finally, it creates a shell script 'config.status' that you can run in the future to recreate the current configuration, and a file 'config.log' containing compiler output (useful mainly for debugging 'configure'). It can also use an optional file (typically called 'config.cache' and enabled with '--cache-file=config.cache' or simply '-C') that saves the results of its tests to speed up reconfiguring. Caching is disabled by default to prevent problems with accidental use of stale cache files. If you need to do unusual things to compile the package, please try to figure out how 'configure' could check whether to do them, and mail diffs or instructions to the address given in the 'README' so they can be considered for the next release. If you are using the cache, and at some point 'config.cache' contains results you don't want to keep, you may remove or edit it. The file 'configure.ac' (or 'configure.in') is used to create 'configure' by a program called 'autoconf'. You need 'configure.ac' if you want to change it or regenerate 'configure' using a newer version of 'autoconf'. The simplest way to compile this package is: 1. 'cd' to the directory containing the package's source code and type './configure' to configure the package for your system. Running 'configure' might take a while. While running, it prints some messages telling which features it is checking for. 2. Type 'make' to compile the package. 3. Optionally, type 'make check' to run any self-tests that come with the package, generally using the just-built uninstalled binaries. 4. Type 'make install' to install the programs and any data files and documentation. When installing into a prefix owned by root, it is recommended that the package be configured and built as a regular user, and only the 'make install' phase executed with root privileges. 5. Optionally, type 'make installcheck' to repeat any self-tests, but this time using the binaries in their final installed location. This target does not install anything. Running this target as a regular user, particularly if the prior 'make install' required root privileges, verifies that the installation completed correctly. 6. You can remove the program binaries and object files from the source code directory by typing 'make clean'. To also remove the files that 'configure' created (so you can compile the package for a different kind of computer), type 'make distclean'. There is also a 'make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. 7. Often, you can also type 'make uninstall' to remove the installed files again. In practice, not all packages have tested that uninstallation works correctly, even though it is required by the GNU Coding Standards. 8. Some packages, particularly those that use Automake, provide 'make distcheck', which can by used by developers to test that all other targets like 'make install' and 'make uninstall' work correctly. This target is generally not run by end users. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the 'configure' script does not know about. Run './configure --help' for details on some of the pertinent environment variables. You can give 'configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c99 CFLAGS=-g LIBS=-lposix *Note Defining Variables::, for more details. Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you can use GNU 'make'. 'cd' to the directory where you want the object files and executables to go and run the 'configure' script. 'configure' automatically checks for the source code in the directory that 'configure' is in and in '..'. This is known as a "VPATH" build. With a non-GNU 'make', it is safer to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use 'make distclean' before reconfiguring for another architecture. On MacOS X 10.5 and later systems, you can create libraries and executables that work on multiple system types--known as "fat" or "universal" binaries--by specifying multiple '-arch' options to the compiler but only a single '-arch' option to the preprocessor. Like this: ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ CPP="gcc -E" CXXCPP="g++ -E" This is not guaranteed to produce working output in all cases, you may have to build one architecture at a time and combine the results using the 'lipo' tool if you have problems. Installation Names ================== By default, 'make install' installs the package's commands under '/usr/local/bin', include files under '/usr/local/include', etc. You can specify an installation prefix other than '/usr/local' by giving 'configure' the option '--prefix=PREFIX', where PREFIX must be an absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you pass the option '--exec-prefix=PREFIX' to 'configure', the package uses PREFIX as the prefix for installing programs and libraries. Documentation and other data files still use the regular prefix. In addition, if you use an unusual directory layout you can give options like '--bindir=DIR' to specify different values for particular kinds of files. Run 'configure --help' for a list of the directories you can set and what kinds of files go in them. In general, the default for these options is expressed in terms of '${prefix}', so that specifying just '--prefix' will affect all of the other directory specifications that were not explicitly provided. The most portable way to affect installation locations is to pass the correct locations to 'configure'; however, many packages provide one or both of the following shortcuts of passing variable assignments to the 'make install' command line to change installation locations without having to reconfigure or recompile. The first method involves providing an override variable for each affected directory. For example, 'make install prefix=/alternate/directory' will choose an alternate location for all directory configuration variables that were expressed in terms of '${prefix}'. Any directories that were specified during 'configure', but not in terms of '${prefix}', must each be overridden at install time for the entire installation to be relocated. The approach of makefile variable overrides for each directory variable is required by the GNU Coding Standards, and ideally causes no recompilation. However, some platforms have known limitations with the semantics of shared libraries that end up requiring recompilation when using this method, particularly noticeable in packages that use GNU Libtool. The second method involves providing the 'DESTDIR' variable. For example, 'make install DESTDIR=/alternate/directory' will prepend '/alternate/directory' before all installation names. The approach of 'DESTDIR' overrides is not required by the GNU Coding Standards, and does not work on platforms that have drive letters. On the other hand, it does better at avoiding recompilation issues, and works well even when some directory options were not specified in terms of '${prefix}' at 'configure' time. Optional Features ================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving 'configure' the option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. Some packages pay attention to '--enable-FEATURE' options to 'configure', where FEATURE indicates an optional part of the package. They may also pay attention to '--with-PACKAGE' options, where PACKAGE is something like 'gnu-as' or 'x' (for the X Window System). The 'README' should mention any '--enable-' and '--with-' options that the package recognizes. For packages that use the X Window System, 'configure' can usually find the X include and library files automatically, but if it doesn't, you can use the 'configure' options '--x-includes=DIR' and '--x-libraries=DIR' to specify their locations. Some packages offer the ability to configure how verbose the execution of 'make' will be. For these packages, running './configure --enable-silent-rules' sets the default to minimal output, which can be overridden with 'make V=1'; while running './configure --disable-silent-rules' sets the default to verbose, which can be overridden with 'make V=0'. Particular systems ================== On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. HP-UX 'make' updates targets which have the same time stamps as their prerequisites, which makes it generally unusable when shipped generated files such as 'configure' are involved. Use GNU 'make' instead. On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its '' header file. The option '-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended to try ./configure CC="cc" and if that doesn't work, try ./configure CC="cc -nodtk" On Solaris, don't put '/usr/ucb' early in your 'PATH'. This directory contains several dysfunctional programs; working variants of these programs are available in '/usr/bin'. So, if you need '/usr/ucb' in your 'PATH', put it _after_ '/usr/bin'. On Haiku, software installed for all users goes in '/boot/common', not '/usr/local'. It is recommended to use the following options: ./configure --prefix=/boot/common Specifying the System Type ========================== There may be some features 'configure' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, 'configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the '--build=TYPE' option. TYPE can either be a short name for the system type, such as 'sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS See the file 'config.sub' for the possible values of each field. If 'config.sub' isn't included in this package, then this package doesn't need to know the machine type. If you are _building_ compiler tools for cross-compiling, you should use the option '--target=TYPE' to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with '--host=TYPE'. Sharing Defaults ================ If you want to set default values for 'configure' scripts to share, you can create a site shell script called 'config.site' that gives default values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' looks for 'PREFIX/share/config.site' if it exists, then 'PREFIX/etc/config.site' if it exists. Or, you can set the 'CONFIG_SITE' environment variable to the location of the site script. A warning: not all 'configure' scripts look for a site script. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to 'configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the 'configure' command line, using 'VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc causes the specified 'gcc' to be used as the C compiler (unless it is overridden in the site shell script). Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an Autoconf limitation. Until the limitation is lifted, you can use this workaround: CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash 'configure' Invocation ====================== 'configure' recognizes the following options to control how it operates. '--help' '-h' Print a summary of all of the options to 'configure', and exit. '--help=short' '--help=recursive' Print a summary of the options unique to this package's 'configure', and exit. The 'short' variant lists options used only in the top level, while the 'recursive' variant lists options also present in any nested packages. '--version' '-V' Print the version of Autoconf used to generate the 'configure' script, and exit. '--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally 'config.cache'. FILE defaults to '/dev/null' to disable caching. '--config-cache' '-C' Alias for '--cache-file=config.cache'. '--quiet' '--silent' '-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to '/dev/null' (any error messages will still be shown). '--srcdir=DIR' Look for the package's source code in directory DIR. Usually 'configure' can determine that directory automatically. '--prefix=DIR' Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. '--no-create' '-n' Run the configure checks, but stop before creating any output files. 'configure' also accepts some other, not widely useful, options. Run 'configure --help' for more details. fbb-7.0.10/NEWS0000644000175000017500000000000013613360505007740 00000000000000fbb-7.0.10/man/0000755000175000017500000000000013747536076010126 500000000000000fbb-7.0.10/man/fbb.80000644000175000017500000000131013613360505010643 00000000000000.TH FBB 8 .SH NAME fbb \- Script to start the fbb daemon .SH SYNOPSIS .B fbb .I "[options]" .SH DESCRIPTION This script is used to start the daemon. It will ask you for configuration details (CALL, SSID, QRA, etc.) and port entries when the configuration file for fbb (/etc/ax25/fbb.conf) does not exist. If a configuration file is present the daemon will be started. .SH OPTIONS .TP .B \-f Runs fbb in foreground. .TP .B \-h Help information (only displayed when a valid configuration is present). .TP .B \-l Log debug info to logfile. .TP .B \-s Run fbb silently. .TP Any other flags will be passed to the daemon. .SH AUTHOR This manual page was written by Joop Stakenborg . fbb-7.0.10/man/Makefile.in0000644000175000017500000004004713747457130012111 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = man ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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 am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" man8dir = $(mandir)/man8 NROFF = nroff MANS = $(man_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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@ man_MANS = fbb.8 fbbgetconf.1 xfbbC.8 xfbbd.8 EXTRA_DIST = $(man_MANS) 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 man/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu man/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | 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='$(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) install-man8: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ list2='$(man_MANS)'; \ test -n "$(man8dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.8[a-z]*$$/p'; \ fi; \ } | 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,^[^8][0-9a-z]*$$,8,;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)$(man8dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$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)$(man8dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \ done; } uninstall-man8: @$(NORMAL_UNINSTALL) @list=''; test -n "$(man8dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ l2='$(man_MANS)'; for i in $$l2; do echo "$$i"; done | \ sed -n '/\.8[a-z]*$$/p'; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; 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-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-man 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-man1 install-man8 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: uninstall-man uninstall-man: uninstall-man1 uninstall-man8 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am 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-man1 install-man8 \ 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 tags-am uninstall \ uninstall-am uninstall-man uninstall-man1 uninstall-man8 .PRECIOUS: Makefile # 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: fbb-7.0.10/man/Makefile.am0000644000175000017500000000011013613360505012052 00000000000000man_MANS = fbb.8 fbbgetconf.1 xfbbC.8 xfbbd.8 EXTRA_DIST = $(man_MANS) fbb-7.0.10/man/fbbgetconf.10000644000175000017500000000056313613360505012213 00000000000000.TH FBBGETCONF 1 .SH NAME fbbgetconf \- Returns values from the fbb configuration .SH SYNOPSIS .B fbbgetconf .I "[options]" .I [key] [key] ... .SH OPTIONS .TP .B \-a List all values. .TP .B \-h Display a short help. .TP .B \-d List default values. .TP .B \-f [configfile] Use configfile. .SH AUTHOR This manual page was written by Joop Stakenborg . fbb-7.0.10/man/xfbbC.80000644000175000017500000000211313613360505011140 00000000000000.TH XFBBC 8 .SH NAME xfbbC \- Console for the fbb mailbox .SH SYNOPSIS .B xfbbC .I "[options]" .SH DESCRIPTION This is the console client for the xfbbd BBS daemon. .SH OPTIONS .TP .B \-h
Hostname address of the xfbbd server. .TP .B \-d Download remote configuration file. .TP .B \-u Upload configuration file. .TP .B \-l Display remote directory. .TP .B \-f Data filtering. Control characters are discarded. .TP .B \-p IP port number (default 3286). .TP .B \-w password of the callsign as defined in passwd.sys. .TP .B \-i Callsign used for connection. .TP .B \-c Console connection. .TP .B \-m Displays a connected channel (0 = all channels). .TP .B \-r Don't use ncurses. .TP .B \-s Request service number. .SH REMARKS Environment variables used by xfbbC are: .TP XFBBC_HOST : hostname (default localhost). .TP XFBBC_PORT : socket port (default 3286). .TP XFBBC_CALL : my callsign. .TP XFBBC_PASS : password string of passwd.sys in xfbbd. .SH AUTHOR This manual page was written by Joop Stakenborg . fbb-7.0.10/man/xfbbd.80000644000175000017500000000120413613360505011201 00000000000000.TH XFBBD 8 .SH NAME xfbbd \- Daemon for the fbb mailbox .SH SYNOPSIS .B xfbbd .I "[options]" .SH OPTIONS .TP .B \-v Verbose option. Prints errors, warnings and messages. .TP .B \-p TCP/IP port for the console client. Default is 3286. .TP .B \-a Decode all packets when receiving data on a socket. Normally only AX.25 data (NET/ROM and Rose) will be monitored. .TP .B \-i Init mode. Only initialize, don't run. Use this to parse your configuration files without actually starting the daemon. .TP .B \-n Don't start communication socket for the console. .SH AUTHOR This manual page was written by Joop Stakenborg . fbb-7.0.10/Makefile.am0000644000175000017500000000420713701065275011316 00000000000000installconf: (cd $(top_srcdir)/etc && $(MAKE) installconf) SUBDIRS = man doc etc scripts include src # Build the folder tree for fbb and remind user to run make installconf install-data-hook: $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/filter $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/pg $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/server $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/tool $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/error_return $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/end_session $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/rerun $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/maintenance $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/stop_system $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/sig_segv $(mkinstalldirs) $(DESTDIR)$(pkglibdir)/script/reset $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/log $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/oldmail $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/sat $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/wp $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/fbbdos $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/fbbdos/yapp $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/fbbdos/readonly $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/mail for n in 0 1 2 3 4 5 6 7 8 9; do \ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/mail/mail$$n; \ done $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/binmail for n in 0 1 2 3 4 5 6 7 8 9; do \ $(mkinstalldirs) $(DESTDIR)$(localstatedir)/ax25/fbb/binmail/mail$$n; \ done @echo @echo " *** Read the \'README' if you haven't already done so!" @echo " *** " @echo " *** Remember to run \'make installconf' if this is a new installation." @echo " *** This will install the default configuration files, BUT it WILL" @echo " *** overwrite any existing config files you have." @echo " ***" @echo " *** If you are upgrading an existing configuration, you do not need" @echo " *** to run \'make installconf'." @echo #EXTRA_DIST = ax25apps.spec SVNREV ACLOCAL_AMFLAGS = -I m4 fbb-7.0.10/ar-lib0000755000175000017500000001330313747457127010366 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2018 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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 . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and f6bvp@free.fr $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='fbb' PACKAGE_TARNAME='fbb' PACKAGE_VERSION='7.0.10' PACKAGE_STRING='fbb 7.0.10' PACKAGE_BUGREPORT='f6bvp@free.fr' PACKAGE_URL='' ac_unique_file="src/xfbbd.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_header_list= ac_func_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS EGREP GREP HAVE_NCURSES_FALSE HAVE_NCURSES_TRUE CURSES_LIB AX25_LIB HAVE_X_LIBS_FALSE HAVE_X_LIBS_TRUE RANLIB LN_S CPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX PACKAGE_VERSION_MICRO PACKAGE_VERSION_MINOR PACKAGE_VERSION_MAJOR SVNREV EXTRAVERSION BASEVERSION am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_ct_AR AR AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking enable_x_utils with_ncurses with_ncursesw ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC CPP CURSES_LIB' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures fbb 7.0.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/fbb] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of fbb 7.0.10:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --disable-x-utils disable building X windows utils [default: no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-ncurses force the use of Ncurses or NcursesW --without-ncursesw do not use NcursesW (wide character support) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags CPP C preprocessor CURSES_LIB linker library for Curses, e.g. -lcurses Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF fbb configure 7.0.10 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------- ## ## Report this to f6bvp@free.fr ## ## ---------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by fbb $as_me 7.0.10, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi as_fn_append ac_header_list " sys/time.h" as_fn_append ac_header_list " unistd.h" as_fn_append ac_func_list " alarm" # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" # We don't use "subdir-objects" yet because it breaks "make distclean" # and "make distcheck", and therefore ./autogen.sh when dependencies # are enabled (as of Automake 1.14) due to this bug: # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354 # The -Wno-unsupported is used to silence warnings about missing # "subdir-objects". # Maybe we'll look at re-organizing things to be non-recursive, or # maybe we'll leave it for the time being. am__api_version='1.16' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='fbb' VERSION='7.0.10' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_with_curses.html # =========================================================================== # # SYNOPSIS # # AX_WITH_CURSES # # DESCRIPTION # # This macro checks whether a SysV or X/Open-compatible Curses library is # present, along with the associated header file. The NcursesW # (wide-character) library is searched for first, followed by Ncurses, # then the system-default plain Curses. The first library found is the # one returned. # # The following options are understood: --with-ncursesw, --with-ncurses, # --without-ncursesw, --without-ncurses. The "--with" options force the # macro to use that particular library, terminating with an error if not # found. The "--without" options simply skip the check for that library. # The effect on the search pattern is: # # (no options) - NcursesW, Ncurses, Curses # --with-ncurses --with-ncursesw - NcursesW only [*] # --without-ncurses --with-ncursesw - NcursesW only [*] # --with-ncursesw - NcursesW only [*] # --with-ncurses --without-ncursesw - Ncurses only [*] # --with-ncurses - NcursesW, Ncurses [**] # --without-ncurses --without-ncursesw - Curses only # --without-ncursesw - Ncurses, Curses # --without-ncurses - NcursesW, Curses # # [*] If the library is not found, abort the configure script. # # [**] If the second library (Ncurses) is not found, abort configure. # # The following preprocessor symbols may be defined by this macro if the # appropriate conditions are met: # # HAVE_CURSES - if any SysV or X/Open Curses library found # HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions # HAVE_CURSES_COLOR - if library supports color (enhanced functions) # HAVE_CURSES_OBSOLETE - if library supports certain obsolete features # HAVE_NCURSESW - if NcursesW (wide char) library is to be used # HAVE_NCURSES - if the Ncurses library is to be used # # HAVE_CURSES_H - if is present and should be used # HAVE_NCURSESW_H - if should be used # HAVE_NCURSES_H - if should be used # HAVE_NCURSESW_CURSES_H - if should be used # HAVE_NCURSES_CURSES_H - if should be used # # (These preprocessor symbols are discussed later in this document.) # # The following output variable is defined by this macro; it is precious # and may be overridden on the ./configure command line: # # CURSES_LIB - library to add to xxx_LDADD # # The library listed in CURSES_LIB is NOT added to LIBS by default. You # need to add CURSES_LIB to the appropriate xxx_LDADD line in your # Makefile.am. For example: # # prog_LDADD = @CURSES_LIB@ # # If CURSES_LIB is set on the configure command line (such as by running # "./configure CURSES_LIB=-lmycurses"), then the only header searched for # is . The user may use the CPPFLAGS precious variable to # override the standard #include search path. If the user needs to # specify an alternative path for a library (such as for a non-standard # NcurseW), the user should use the LDFLAGS variable. # # The following shell variables may be defined by this macro: # # ax_cv_curses - set to "yes" if any Curses library found # ax_cv_curses_enhanced - set to "yes" if Enhanced functions present # ax_cv_curses_color - set to "yes" if color functions present # ax_cv_curses_obsolete - set to "yes" if obsolete features present # # ax_cv_ncursesw - set to "yes" if NcursesW library found # ax_cv_ncurses - set to "yes" if Ncurses library found # ax_cv_plaincurses - set to "yes" if plain Curses library found # ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" # # These variables can be used in your configure.ac to determine the level # of support you need from the Curses library. For example, if you must # have either Ncurses or NcursesW, you could include: # # AX_WITH_CURSES # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then # AX_MSG_ERROR([requires either NcursesW or Ncurses library]) # fi # # If any Curses library will do (but one must be present and must support # color), you could use: # # AX_WITH_CURSES # if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then # AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) # fi # # Certain preprocessor symbols and shell variables defined by this macro # can be used to determine various features of the Curses library. In # particular, HAVE_CURSES and ax_cv_curses are defined if the Curses # library found conforms to the traditional SysV and/or X/Open Base Curses # definition. Any working Curses library conforms to this level. # # HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the # library supports the X/Open Enhanced Curses definition. In particular, # the wide-character types attr_t, cchar_t and wint_t, the functions # wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES # are checked. The Ncurses library does NOT conform to this definition, # although NcursesW does. # # HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library # supports color functions and macros such as COLOR_PAIR, A_COLOR, # COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the # X/Open Base Curses definition, but are part of the Enhanced set of # functions. The Ncurses library DOES support these functions, as does # NcursesW. # # HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the # library supports certain features present in SysV and BSD Curses but not # defined in the X/Open definition. In particular, the functions # getattrs(), getcurx() and getmaxx() are checked. # # To use the HAVE_xxx_H preprocessor symbols, insert the following into # your system.h (or equivalent) header file: # # #if defined(HAVE_NCURSESW_CURSES_H) # # include # #elif defined(HAVE_NCURSESW_H) # # include # #elif defined(HAVE_NCURSES_CURSES_H) # # include # #elif defined(HAVE_NCURSES_H) # # include # #elif defined(HAVE_CURSES_H) # # include # #else # # error "SysV or X/Open-compatible Curses header file required" # #endif # # For previous users of this macro: you should not need to change anything # in your configure.ac or Makefile.am, as the previous (serial 10) # semantics are still valid. However, you should update your system.h (or # equivalent) header file to the fragment shown above. You are encouraged # also to make use of the extended functionality provided by this version # of AX_WITH_CURSES, as well as in the additional macros # AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. # # LICENSE # # Copyright (c) 2009 Mark Pulford # Copyright (c) 2009 Damian Pietras # Copyright (c) 2011 Reuben Thomas # Copyright (c) 2011 John Zaitseff # # 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 . # # Parts of code have been taken from many other softwares. # Thanks for the help. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 12 # This is what autoupdate's m4 run will expand. It fires # the warning (with _au_warn_XXX), outputs it into the # updated configure.ac (with AC_DIAGNOSE), and then outputs # the replacement expansion. # This is an auxiliary macro that is also run when # autoupdate runs m4. It simply calls m4_warning, but # we need a wrapper so that each warning is emitted only # once. We break the quoting in m4_warning's argument in # order to expand this macro's arguments, not AU_DEFUN's. # Finally, this is the expansion that is picked up by # autoconf. It tells the user to run autoupdate, and # then outputs the replacement expansion. We do not care # about autoupdate's warning because that contains # information on what to do *after* running autoupdate. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 $as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } case $?:`cat confinc.out 2>/dev/null` in #( '0:this is the am__doit target') : case $s in #( BSD) : am__include='.include' am__quote='"' ;; #( *) : am__include='include' am__quote='' ;; esac ;; #( *) : ;; esac if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 $as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac # Determine versions for package managers. basever=$(echo $PACKAGE_VERSION | sed -e 's@-.*$@@') BASEVERSION=$basever extraver=$(echo $PACKAGE_VERSION | sed -e 's@'$basever'@@' -e 's@^-@_@') EXTRAVERSION=$extraver SVNREV=`( svnversion -n $srcdir )` if { ! ( svnversion ) >/dev/null 2>&1 || test "$SVNREV" = "exported"; } ; then SVNREV=`cat $srcdir/SVNREV` else echo $SVNREV>$srcdir/SVNREV fi # Decompose the version number. # # We must do this rather than construct PACKAGE_VERSION from the components # because AC_INIT rejects anything but a literal for the version number. PACKAGE_VERSION_MAJOR=`echo "$PACKAGE_VERSION" | cut -d. -f1` PACKAGE_VERSION_MINOR=`echo "$PACKAGE_VERSION" | cut -d. -f2` PACKAGE_VERSION_MICRO=`echo "$PACKAGE_VERSION" | cut -d. -f3 | sed -e 's@-.*$@@'` cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MAJOR $PACKAGE_VERSION_MAJOR _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MINOR $PACKAGE_VERSION_MINOR _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION_MICRO $PACKAGE_VERSION_MICRO _ACEOF # Checks for programs. ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes else CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : else ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CXX_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi # We want to test for the presence of all the necessary Xlibs. # Default to building the X binaries, IF we have all the right # libraries involved. If we do not have all the necessary # libraries OR configure is run with --disable-x-utils, then # we won't build any of the X binaries. # Check how configure is executed and see if we are forced to # not build the X binaries, otherwise default to yes. # Check whether --enable-x-utils was given. if test "${enable_x_utils+set}" = set; then : enableval=$enable_x_utils; x_utils=${enableval} else x_utils=yes fi # Check for all the necessary X libraries. # Use conditional tests for each library so we can stop # when we hit one that is missing. Note the first test is different # than the others, it checks to see if we are even building X utilities. have_xlibs=no if test "x${x_utils}" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XOpenDisplay in -lX11" >&5 $as_echo_n "checking for XOpenDisplay in -lX11... " >&6; } if ${ac_cv_lib_X11_XOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_X11_XOpenDisplay=yes else ac_cv_lib_X11_XOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_X11_XOpenDisplay" >&5 $as_echo "$ac_cv_lib_X11_XOpenDisplay" >&6; } if test "x$ac_cv_lib_X11_XOpenDisplay" = xyes; then : have_xlibs=yes else have_xlibs=no fi fi if test "x${have_xlibs}" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXext" >&5 $as_echo_n "checking for main in -lXext... " >&6; } if ${ac_cv_lib_Xext_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xext_main=yes else ac_cv_lib_Xext_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_main" >&5 $as_echo "$ac_cv_lib_Xext_main" >&6; } if test "x$ac_cv_lib_Xext_main" = xyes; then : have_xlibs=yes else have_xlibs=no fi fi if test "x${have_xlibs}" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XmCreateMainWindow in -lXm" >&5 $as_echo_n "checking for XmCreateMainWindow in -lXm... " >&6; } if ${ac_cv_lib_Xm_XmCreateMainWindow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XmCreateMainWindow (); int main () { return XmCreateMainWindow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xm_XmCreateMainWindow=yes else ac_cv_lib_Xm_XmCreateMainWindow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xm_XmCreateMainWindow" >&5 $as_echo "$ac_cv_lib_Xm_XmCreateMainWindow" >&6; } if test "x$ac_cv_lib_Xm_XmCreateMainWindow" = xyes; then : have_xlibs=yes else have_xlibs=no fi fi if test "x${have_xlibs}" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lXpm" >&5 $as_echo_n "checking for main in -lXpm... " >&6; } if ${ac_cv_lib_Xpm_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xpm_main=yes else ac_cv_lib_Xpm_main=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_main" >&5 $as_echo "$ac_cv_lib_Xpm_main" >&6; } if test "x$ac_cv_lib_Xpm_main" = xyes; then : have_xlibs=yes else have_xlibs=no fi fi if test "x${have_xlibs}" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XtOpenDisplay in -lXt" >&5 $as_echo_n "checking for XtOpenDisplay in -lXt... " >&6; } if ${ac_cv_lib_Xt_XtOpenDisplay+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXt $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XtOpenDisplay (); int main () { return XtOpenDisplay (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_Xt_XtOpenDisplay=yes else ac_cv_lib_Xt_XtOpenDisplay=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xt_XtOpenDisplay" >&5 $as_echo "$ac_cv_lib_Xt_XtOpenDisplay" >&6; } if test "x$ac_cv_lib_Xt_XtOpenDisplay" = xyes; then : have_xlibs=yes else have_xlibs=no fi fi # If we want to build the X binaries (default is yes), but we are # missing one of the required libraries, throw a warning but # continue to build without X support. The user can go back and # resolve the dependencies if they really want X. if test "x${have_xlibs}" = xno; then if test "x${x_utils}" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ---------------------------------- Missing one of X11, Xext, Xm, Xpm or Xt libraries. Not building X Windows utilities. If you want to build the X Windows utilities, you need: libx11-dev (provides -lX11) libxext-dev (provides -lXext) lesstif2-dev (provides -lXm) libxpm-dev (provides -lXpm) libxt-dev (provides -lXt) Or the equivalent packages on your OS. ----------------------------------" >&5 $as_echo "$as_me: WARNING: ---------------------------------- Missing one of X11, Xext, Xm, Xpm or Xt libraries. Not building X Windows utilities. If you want to build the X Windows utilities, you need: libx11-dev (provides -lX11) libxext-dev (provides -lXext) lesstif2-dev (provides -lXm) libxpm-dev (provides -lXpm) libxt-dev (provides -lXt) Or the equivalent packages on your OS. ----------------------------------" >&2;} fi x_utils=no fi # If all the tests for X libraries pass, set a HAVE_X_LIBS conditional # to allow us to conditionally build the sources in src/X11 if test "$x_utils" = yes; then HAVE_X_LIBS_TRUE= HAVE_X_LIBS_FALSE='#' else HAVE_X_LIBS_TRUE='#' HAVE_X_LIBS_FALSE= fi # Check for libmath { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cos in -lm" >&5 $as_echo_n "checking for cos in -lm... " >&6; } if ${ac_cv_lib_m_cos+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char cos (); int main () { return cos (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_cos=yes else ac_cv_lib_m_cos=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_cos" >&5 $as_echo "$ac_cv_lib_m_cos" >&6; } if test "x$ac_cv_lib_m_cos" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF LIBS="-lm $LIBS" else as_fn_error $? "Could not find libmath; aborting" "$LINENO" 5 fi # Check for AX25 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ax25_config_load_ports in -lax25" >&5 $as_echo_n "checking for ax25_config_load_ports in -lax25... " >&6; } if ${ac_cv_lib_ax25_ax25_config_load_ports+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lax25 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char ax25_config_load_ports (); int main () { return ax25_config_load_ports (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ax25_ax25_config_load_ports=yes else ac_cv_lib_ax25_ax25_config_load_ports=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ax25_ax25_config_load_ports" >&5 $as_echo "$ac_cv_lib_ax25_ax25_config_load_ports" >&6; } if test "x$ac_cv_lib_ax25_ax25_config_load_ports" = xyes; then : AX25_LIB="-lax25" else as_fn_error $? "Could not find the libax25 libraries; aborting" "$LINENO" 5 fi # Check for ncurses libraries { $as_echo "$as_me:${as_lineno-$LINENO}: checking for initscr in -lncurses" >&5 $as_echo_n "checking for initscr in -lncurses... " >&6; } if ${ac_cv_lib_ncurses_initscr+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_ncurses_initscr=yes else ac_cv_lib_ncurses_initscr=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_initscr" >&5 $as_echo "$ac_cv_lib_ncurses_initscr" >&6; } if test "x$ac_cv_lib_ncurses_initscr" = xyes; then : NCURSES_LIB="-lncurses" else as_fn_error $? "Could not find the ncurses libraries; aborting" "$LINENO" 5 fi # Use an m4 macro to check for curses # Check whether --with-ncurses was given. if test "${with_ncurses+set}" = set; then : withval=$with_ncurses; else with_ncurses=check fi # Check whether --with-ncursesw was given. if test "${with_ncursesw+set}" = set; then : withval=$with_ncursesw; else with_ncursesw=check fi ax_saved_LIBS=$LIBS if test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes; then : ax_with_plaincurses=no else ax_with_plaincurses=check fi ax_cv_curses_which=no # Test for NcursesW if test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno; then : LIBS="$ax_saved_LIBS -lncursesw" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NcursesW wide-character library" >&5 $as_echo_n "checking for NcursesW wide-character library... " >&6; } if ${ax_cv_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_ncursesw=yes else ax_cv_ncursesw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ncursesw" >&5 $as_echo "$ax_cv_ncursesw" >&6; } if test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes; then : as_fn_error $? "--with-ncursesw specified but could not find NcursesW library" "$LINENO" 5 fi if test "x$ax_cv_ncursesw" = xyes; then : ax_cv_curses=yes ax_cv_curses_which=ncursesw CURSES_LIB="-lncursesw" $as_echo "#define HAVE_NCURSESW 1" >>confdefs.h $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncursesw/curses.h" >&5 $as_echo_n "checking for working ncursesw/curses.h... " >&6; } if ${ax_cv_header_ncursesw_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncursesw_curses_h=yes else ax_cv_header_ncursesw_curses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncursesw_curses_h" >&5 $as_echo "$ax_cv_header_ncursesw_curses_h" >&6; } if test "x$ax_cv_header_ncursesw_curses_h" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSESW_CURSES_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncursesw.h" >&5 $as_echo_n "checking for working ncursesw.h... " >&6; } if ${ax_cv_header_ncursesw_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncursesw_h=yes else ax_cv_header_ncursesw_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncursesw_h" >&5 $as_echo "$ax_cv_header_ncursesw_h" >&6; } if test "x$ax_cv_header_ncursesw_h" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSESW_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses.h" >&5 $as_echo_n "checking for working ncurses.h... " >&6; } if ${ax_cv_header_ncurses_h_with_ncursesw+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncurses_h_with_ncursesw=yes else ax_cv_header_ncurses_h_with_ncursesw=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncurses_h_with_ncursesw" >&5 $as_echo "$ax_cv_header_ncurses_h_with_ncursesw" >&6; } if test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h fi if test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h" >&5 $as_echo "$as_me: WARNING: could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h" >&2;} fi fi fi # Test for Ncurses if test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno; then : LIBS="$ax_saved_LIBS -lncurses" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Ncurses library" >&5 $as_echo_n "checking for Ncurses library... " >&6; } if ${ax_cv_ncurses+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_ncurses=yes else ax_cv_ncurses=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_ncurses" >&5 $as_echo "$ax_cv_ncurses" >&6; } if test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes; then : as_fn_error $? "--with-ncurses specified but could not find Ncurses library" "$LINENO" 5 fi if test "x$ax_cv_ncurses" = xyes; then : ax_cv_curses=yes ax_cv_curses_which=ncurses CURSES_LIB="-lncurses" $as_echo "#define HAVE_NCURSES 1" >>confdefs.h $as_echo "#define HAVE_CURSES 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses/curses.h" >&5 $as_echo_n "checking for working ncurses/curses.h... " >&6; } if ${ax_cv_header_ncurses_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncurses_curses_h=yes else ax_cv_header_ncurses_curses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncurses_curses_h" >&5 $as_echo "$ax_cv_header_ncurses_curses_h" >&6; } if test "x$ax_cv_header_ncurses_curses_h" = xyes; then : ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSES_CURSES_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working ncurses.h" >&5 $as_echo_n "checking for working ncurses.h... " >&6; } if ${ax_cv_header_ncurses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_ncurses_h=yes else ax_cv_header_ncurses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_ncurses_h" >&5 $as_echo "$ax_cv_header_ncurses_h" >&6; } if test "x$ax_cv_header_ncurses_h" = xyes; then : ax_cv_curses_color=yes ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h $as_echo "#define HAVE_NCURSES_H 1" >>confdefs.h fi if test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a working ncurses/curses.h or ncurses.h" >&5 $as_echo "$as_me: WARNING: could not find a working ncurses/curses.h or ncurses.h" >&2;} fi fi fi # Test for plain Curses (or if CURSES_LIB was set by user) if test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno; then : if test "x$CURSES_LIB" != x; then : LIBS="$ax_saved_LIBS $CURSES_LIB" else LIBS="$ax_saved_LIBS -lcurses" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Curses library" >&5 $as_echo_n "checking for Curses library... " >&6; } if ${ax_cv_plaincurses+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char initscr (); int main () { return initscr (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses=yes else ax_cv_plaincurses=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses" >&5 $as_echo "$ax_cv_plaincurses" >&6; } if test "x$ax_cv_plaincurses" = xyes; then : ax_cv_curses=yes ax_cv_curses_which=plaincurses if test "x$CURSES_LIB" = x; then : CURSES_LIB="-lcurses" fi $as_echo "#define HAVE_CURSES 1" >>confdefs.h # Check for base conformance (and header file) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working curses.h" >&5 $as_echo_n "checking for working curses.h... " >&6; } if ${ax_cv_header_curses_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; initscr(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_header_curses_h=yes else ax_cv_header_curses_h=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_header_curses_h" >&5 $as_echo "$ax_cv_header_curses_h" >&6; } if test "x$ax_cv_header_curses_h" = xyes; then : $as_echo "#define HAVE_CURSES_H 1" >>confdefs.h # Check for X/Open Enhanced conformance { $as_echo "$as_me:${as_lineno-$LINENO}: checking for X/Open Enhanced Curses conformance" >&5 $as_echo_n "checking for X/Open Enhanced Curses conformance... " >&6; } if ${ax_cv_plaincurses_enhanced+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include #ifndef _XOPEN_CURSES #error "this Curses library is not enhanced" "this Curses library is not enhanced" #endif int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses_enhanced=yes else ax_cv_plaincurses_enhanced=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses_enhanced" >&5 $as_echo "$ax_cv_plaincurses_enhanced" >&6; } if test "x$ax_cv_plaincurses_enhanced" = xyes; then : ax_cv_curses_enhanced=yes ax_cv_curses_color=yes $as_echo "#define HAVE_CURSES_ENHANCED 1" >>confdefs.h $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h fi # Check for color functions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Curses color functions" >&5 $as_echo_n "checking for Curses color functions... " >&6; } if ${ax_cv_plaincurses_color+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE_EXTENDED 1 #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses_color=yes else ax_cv_plaincurses_color=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses_color" >&5 $as_echo "$ax_cv_plaincurses_color" >&6; } if test "x$ax_cv_plaincurses_color" = xyes; then : ax_cv_curses_color=yes $as_echo "#define HAVE_CURSES_COLOR 1" >>confdefs.h fi # Check for obsolete functions { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obsolete Curses functions" >&5 $as_echo_n "checking for obsolete Curses functions... " >&6; } if ${ax_cv_plaincurses_obsolete+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { chtype a = A_BOLD; int b = KEY_LEFT; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ax_cv_plaincurses_obsolete=yes else ax_cv_plaincurses_obsolete=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_plaincurses_obsolete" >&5 $as_echo "$ax_cv_plaincurses_obsolete" >&6; } if test "x$ax_cv_plaincurses_obsolete" = xyes; then : ax_cv_curses_obsolete=yes $as_echo "#define HAVE_CURSES_OBSOLETE 1" >>confdefs.h fi fi if test "x$ax_cv_header_curses_h" = xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find a working curses.h" >&5 $as_echo "$as_me: WARNING: could not find a working curses.h" >&2;} fi fi fi if test "x$ax_cv_curses" != xyes; then : ax_cv_curses=no fi if test "x$ax_cv_curses_enhanced" != xyes; then : ax_cv_curses_enhanced=no fi if test "x$ax_cv_curses_color" != xyes; then : ax_cv_curses_color=no fi if test "x$ax_cv_curses_obsolete" != xyes; then : ax_cv_curses_obsolete=no fi LIBS=$ax_saved_LIBS case "$ax_cv_ncurses" in "no") { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: ncurses not found." >&5 $as_echo "$as_me: WARNING: ncurses not found." >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: xfbbC will be built with terminal mode." >&5 $as_echo "$as_me: WARNING: xfbbC will be built with terminal mode." >&2;} esac if test x$ax_cv_ncurses = xyes -o x$ax_cv_ncursesw = xyes; then HAVE_NCURSES_TRUE= HAVE_NCURSES_FALSE='#' else HAVE_NCURSES_TRUE='#' HAVE_NCURSES_FALSE= fi # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in arpa/inet.h fcntl.h locale.h malloc.h netdb.h netinet/in.h stdlib.h string.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h utime.h values.h limits.h stdio.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then $as_echo "#define HAVE_STDBOOL_H 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_c_inline=$ac_kw fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 $as_echo_n "checking for uid_t in sys/types.h... " >&6; } if ${ac_cv_type_uid_t+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then : ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 $as_echo "$ac_cv_type_uid_t" >&6; } if test $ac_cv_type_uid_t = no; then $as_echo "#define uid_t int" >>confdefs.h $as_echo "#define gid_t int" >>confdefs.h fi for ac_header in unistd.h do : ac_fn_c_check_header_mongrel "$LINENO" "unistd.h" "ac_cv_header_unistd_h" "$ac_includes_default" if test "x$ac_cv_header_unistd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_UNISTD_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 $as_echo_n "checking for working chown... " >&6; } if ${ac_cv_func_chown_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_chown_works=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include int main () { char *f = "conftest.chown"; struct stat before, after; if (creat (f, 0600) < 0) return 1; if (stat (f, &before) < 0) return 1; if (chown (f, (uid_t) -1, (gid_t) -1) == -1) return 1; if (stat (f, &after) < 0) return 1; return ! (before.st_uid == after.st_uid && before.st_gid == after.st_gid); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_chown_works=yes else ac_cv_func_chown_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f conftest.chown fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 $as_echo "$ac_cv_func_chown_works" >&6; } if test $ac_cv_func_chown_works = yes; then $as_echo "#define HAVE_CHOWN 1" >>confdefs.h fi ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi for ac_header in vfork.h do : ac_fn_c_check_header_mongrel "$LINENO" "vfork.h" "ac_cv_header_vfork_h" "$ac_includes_default" if test "x$ac_cv_header_vfork_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_VFORK_H 1 _ACEOF fi done for ac_func in fork vfork do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done if test "x$ac_cv_func_fork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fork" >&5 $as_echo_n "checking for working fork... " >&6; } if ${ac_cv_func_fork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_fork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { /* By Ruediger Kuhlmann. */ return fork () < 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_fork_works=yes else ac_cv_func_fork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fork_works" >&5 $as_echo "$ac_cv_func_fork_works" >&6; } else ac_cv_func_fork_works=$ac_cv_func_fork fi if test "x$ac_cv_func_fork_works" = xcross; then case $host in *-*-amigaos* | *-*-msdosdjgpp*) # Override, as these systems have only a dummy fork() stub ac_cv_func_fork_works=no ;; *) ac_cv_func_fork_works=yes ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} fi ac_cv_func_vfork_works=$ac_cv_func_vfork if test "x$ac_cv_func_vfork" = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working vfork" >&5 $as_echo_n "checking for working vfork... " >&6; } if ${ac_cv_func_vfork_works+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_vfork_works=cross else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Thanks to Paul Eggert for this test. */ $ac_includes_default #include #ifdef HAVE_VFORK_H # include #endif /* On some sparc systems, changes by the child to local and incoming argument registers are propagated back to the parent. The compiler is told about this with #include , but some compilers (e.g. gcc -O) don't grok . Test for this by using a static variable whose address is put into a register that is clobbered by the vfork. */ static void #ifdef __cplusplus sparc_address_test (int arg) # else sparc_address_test (arg) int arg; #endif { static pid_t child; if (!child) { child = vfork (); if (child < 0) { perror ("vfork"); _exit(2); } if (!child) { arg = getpid(); write(-1, "", 0); _exit (arg); } } } int main () { pid_t parent = getpid (); pid_t child; sparc_address_test (0); child = vfork (); if (child == 0) { /* Here is another test for sparc vfork register problems. This test uses lots of local variables, at least as many local variables as main has allocated so far including compiler temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should reuse the register of parent for one of the local variables, since it will think that parent can't possibly be used any more in this routine. Assigning to the local variable will thus munge parent in the parent process. */ pid_t p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); /* Convince the compiler that p..p7 are live; otherwise, it might use the same hardware register for all 8 local variables. */ if (p != p1 || p != p2 || p != p3 || p != p4 || p != p5 || p != p6 || p != p7) _exit(1); /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent from child file descriptors. If the child closes a descriptor before it execs or exits, this munges the parent's descriptor as well. Test for this by closing stdout in the child. */ _exit(close(fileno(stdout)) != 0); } else { int status; struct stat st; while (wait(&status) != child) ; return ( /* Was there some problem with vforking? */ child < 0 /* Did the child fail? (This shouldn't happen.) */ || status /* Did the vfork/compiler bug occur? */ || parent != getpid() /* Did the file descriptor bug occur? */ || fstat(fileno(stdout), &st) != 0 ); } } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_vfork_works=yes else ac_cv_func_vfork_works=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_vfork_works" >&5 $as_echo "$ac_cv_func_vfork_works" >&6; } fi; if test "x$ac_cv_func_fork_works" = xcross; then ac_cv_func_vfork_works=$ac_cv_func_vfork { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 $as_echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi if test "x$ac_cv_func_vfork_works" = xyes; then $as_echo "#define HAVE_WORKING_VFORK 1" >>confdefs.h else $as_echo "#define vfork fork" >>confdefs.h fi if test "x$ac_cv_func_fork_works" = xyes; then $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5 $as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; } if ${ac_cv_func_lstat_dereferences_slashed_symlink+:} false; then : $as_echo_n "(cached) " >&6 else rm -f conftest.sym conftest.file echo >conftest.file if test "$as_ln_s" = "ln -s" && ln -s conftest.file conftest.sym; then if test "$cross_compiling" = yes; then : ac_cv_func_lstat_dereferences_slashed_symlink=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { struct stat sbuf; /* Linux will dereference the symlink and fail, as required by POSIX. That is better in the sense that it means we will not have to compile and use the lstat wrapper. */ return lstat ("conftest.sym/", &sbuf) == 0; ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_lstat_dereferences_slashed_symlink=yes else ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi else # If the `ln -s' command failed, then we probably don't even # have an lstat function. ac_cv_func_lstat_dereferences_slashed_symlink=no fi rm -f conftest.sym conftest.file fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_lstat_dereferences_slashed_symlink" >&5 $as_echo "$ac_cv_func_lstat_dereferences_slashed_symlink" >&6; } test $ac_cv_func_lstat_dereferences_slashed_symlink = yes && cat >>confdefs.h <<_ACEOF #define LSTAT_FOLLOWS_SLASHED_SYMLINK 1 _ACEOF if test "x$ac_cv_func_lstat_dereferences_slashed_symlink" = xno; then case " $LIBOBJS " in *" lstat.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lstat.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if ${ac_cv_func_malloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_malloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_malloc_0_nonnull=yes else ac_cv_func_malloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then : $as_echo "#define HAVE_MALLOC 1" >>confdefs.h else $as_echo "#define HAVE_MALLOC 0" >>confdefs.h case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac $as_echo "#define malloc rpl_malloc" >>confdefs.h fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether time.h and sys/time.h may both be included" >&5 $as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; } if ${ac_cv_header_time+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_time=yes else ac_cv_header_time=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_time" >&5 $as_echo "$ac_cv_header_time" >&6; } if test $ac_cv_header_time = yes; then $as_echo "#define TIME_WITH_SYS_TIME 1" >>confdefs.h fi for ac_header in $ac_header_list do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in $ac_func_list do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mktime" >&5 $as_echo_n "checking for working mktime... " >&6; } if ${ac_cv_func_working_mktime+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_working_mktime=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Test program from Paul Eggert and Tony Leneis. */ #ifdef TIME_WITH_SYS_TIME # include # include #else # ifdef HAVE_SYS_TIME_H # include # else # include # endif #endif #include #include #ifdef HAVE_UNISTD_H # include #endif #ifndef HAVE_ALARM # define alarm(X) /* empty */ #endif /* Work around redefinition to rpl_putenv by other config tests. */ #undef putenv static time_t time_t_max; static time_t time_t_min; /* Values we'll use to set the TZ environment variable. */ static const char *tz_strings[] = { (const char *) 0, "TZ=GMT0", "TZ=JST-9", "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00" }; #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0])) /* Return 0 if mktime fails to convert a date in the spring-forward gap. Based on a problem report from Andreas Jaeger. */ static int spring_forward_gap () { /* glibc (up to about 1998-10-07) failed this test. */ struct tm tm; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); tm.tm_year = 98; tm.tm_mon = 3; tm.tm_mday = 5; tm.tm_hour = 2; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; return mktime (&tm) != (time_t) -1; } static int mktime_test1 (time_t now) { struct tm *lt; return ! (lt = localtime (&now)) || mktime (lt) == now; } static int mktime_test (time_t now) { return (mktime_test1 (now) && mktime_test1 ((time_t) (time_t_max - now)) && mktime_test1 ((time_t) (time_t_min + now))); } static int irix_6_4_bug () { /* Based on code from Ariel Faigon. */ struct tm tm; tm.tm_year = 96; tm.tm_mon = 3; tm.tm_mday = 0; tm.tm_hour = 0; tm.tm_min = 0; tm.tm_sec = 0; tm.tm_isdst = -1; mktime (&tm); return tm.tm_mon == 2 && tm.tm_mday == 31; } static int bigtime_test (int j) { struct tm tm; time_t now; tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j; now = mktime (&tm); if (now != (time_t) -1) { struct tm *lt = localtime (&now); if (! (lt && lt->tm_year == tm.tm_year && lt->tm_mon == tm.tm_mon && lt->tm_mday == tm.tm_mday && lt->tm_hour == tm.tm_hour && lt->tm_min == tm.tm_min && lt->tm_sec == tm.tm_sec && lt->tm_yday == tm.tm_yday && lt->tm_wday == tm.tm_wday && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst) == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst)))) return 0; } return 1; } static int year_2050_test () { /* The correct answer for 2050-02-01 00:00:00 in Pacific time, ignoring leap seconds. */ unsigned long int answer = 2527315200UL; struct tm tm; time_t t; tm.tm_year = 2050 - 1900; tm.tm_mon = 2 - 1; tm.tm_mday = 1; tm.tm_hour = tm.tm_min = tm.tm_sec = 0; tm.tm_isdst = -1; /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0" instead of "TZ=America/Vancouver" in order to detect the bug even on systems that don't support the Olson extension, or don't have the full zoneinfo tables installed. */ putenv ((char*) "TZ=PST8PDT,M4.1.0,M10.5.0"); t = mktime (&tm); /* Check that the result is either a failure, or close enough to the correct answer that we can assume the discrepancy is due to leap seconds. */ return (t == (time_t) -1 || (0 < t && answer - 120 <= t && t <= answer + 120)); } int main () { time_t t, delta; int i, j; /* This test makes some buggy mktime implementations loop. Give up after 60 seconds; a mktime slower than that isn't worth using anyway. */ alarm (60); for (;;) { t = (time_t_max << 1) + 1; if (t <= time_t_max) break; time_t_max = t; } time_t_min = - ((time_t) ~ (time_t) 0 == (time_t) -1) - time_t_max; delta = time_t_max / 997; /* a suitable prime number */ for (i = 0; i < N_STRINGS; i++) { if (tz_strings[i]) putenv ((char*) tz_strings[i]); for (t = 0; t <= time_t_max - delta; t += delta) if (! mktime_test (t)) return 1; if (! (mktime_test ((time_t) 1) && mktime_test ((time_t) (60 * 60)) && mktime_test ((time_t) (60 * 60 * 24)))) return 1; for (j = 1; ; j <<= 1) if (! bigtime_test (j)) return 1; else if (INT_MAX / 2 < j) break; if (! bigtime_test (INT_MAX)) return 1; } return ! (irix_6_4_bug () && spring_forward_gap () && year_2050_test ()); } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_working_mktime=yes else ac_cv_func_working_mktime=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_working_mktime" >&5 $as_echo "$ac_cv_func_working_mktime" >&6; } if test $ac_cv_func_working_mktime = no; then case " $LIBOBJS " in *" mktime.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mktime.$ac_objext" ;; esac fi for ac_header in stdlib.h do : ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default" if test "x$ac_cv_header_stdlib_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_STDLIB_H 1 _ACEOF fi done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible realloc" >&5 $as_echo_n "checking for GNU libc compatible realloc... " >&6; } if ${ac_cv_func_realloc_0_nonnull+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_realloc_0_nonnull=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *realloc (); #endif int main () { return ! realloc (0, 0); ; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_realloc_0_nonnull=yes else ac_cv_func_realloc_0_nonnull=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5 $as_echo "$ac_cv_func_realloc_0_nonnull" >&6; } if test $ac_cv_func_realloc_0_nonnull = yes; then : $as_echo "#define HAVE_REALLOC 1" >>confdefs.h else $as_echo "#define HAVE_REALLOC 0" >>confdefs.h case " $LIBOBJS " in *" realloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; esac $as_echo "#define realloc rpl_realloc" >>confdefs.h fi for ac_func in alarm dup2 floor getcwd gethostbyname gettimeofday inet_ntoa memmove memset mkdir modf perror pow putenv rmdir select setlocale socket sqrt strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr tzset utime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile doc/Makefile doc/html/Makefile etc/Makefile man/Makefile include/Makefile scripts/Makefile src/Makefile src/X11/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_X_LIBS_TRUE}" && test -z "${HAVE_X_LIBS_FALSE}"; then as_fn_error $? "conditional \"HAVE_X_LIBS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_NCURSES_TRUE}" && test -z "${HAVE_NCURSES_FALSE}"; then as_fn_error $? "conditional \"HAVE_NCURSES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by fbb $as_me 7.0.10, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ fbb config.status 7.0.10 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "doc/html/Makefile") CONFIG_FILES="$CONFIG_FILES doc/html/Makefile" ;; "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;; "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "src/X11/Makefile") CONFIG_FILES="$CONFIG_FILES src/X11/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. case $CONFIG_FILES in #( *\'*) : eval set x "$CONFIG_FILES" ;; #( *) : set x $CONFIG_FILES ;; #( *) : ;; esac shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`$as_dirname -- "$am_mf" || $as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` am_filepart=`$as_basename -- "$am_mf" || $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` { echo "$as_me:$LINENO: cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles" >&5 (cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } fi { am_dirpart=; unset am_dirpart;} { am_filepart=; unset am_filepart;} { am_mf=; unset am_mf;} { am_rc=; unset am_rc;} rm -f conftest-deps.mk } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi fbb-7.0.10/install-sh0000755000175000017500000003601013747457127011276 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2018-03-11.20; # 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. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # 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_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 is_target_a_directory=possibly 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 *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi 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 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac 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 if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 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 problematic for 'test' and other utilities. 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 # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac 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. ;; *) # Note that $RANDOM variable is not portable (e.g. dash); Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p' feature. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/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-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 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 oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && 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=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_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` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && 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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fbb-7.0.10/compile0000755000175000017500000001632713747457127010661 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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 . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fbb-7.0.10/configure.ac0000644000175000017500000001372313657545532011564 00000000000000AC_PREREQ([2.63]) AC_INIT(fbb, 7.0.10, f6bvp@free.fr) AC_CONFIG_SRCDIR([src/xfbbd.c]) AC_CONFIG_HEADERS([config.h]) # We don't use "subdir-objects" yet because it breaks "make distclean" # and "make distcheck", and therefore ./autogen.sh when dependencies # are enabled (as of Automake 1.14) due to this bug: # http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17354 # The -Wno-unsupported is used to silence warnings about missing # "subdir-objects". # Maybe we'll look at re-organizing things to be non-recursive, or # maybe we'll leave it for the time being. AM_INIT_AUTOMAKE([-Wall -Werror dist-bzip2 -Wno-unsupported]) m4_include([m4/ax_with_curses.m4]) m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) # Determine versions for package managers. basever=$(echo $PACKAGE_VERSION | sed -e 's@-.*$@@') AC_SUBST(BASEVERSION, [$basever]) extraver=$(echo $PACKAGE_VERSION | sed -e 's@'$basever'@@' -e 's@^-@_@') AC_SUBST(EXTRAVERSION, [$extraver]) SVNREV=`( svnversion -n $srcdir )` if { ! ( svnversion ) >/dev/null 2>&1 || test "$SVNREV" = "exported"; } ; then SVNREV=`cat $srcdir/SVNREV` else echo $SVNREV>$srcdir/SVNREV fi AC_SUBST(SVNREV) # Decompose the version number. # # We must do this rather than construct PACKAGE_VERSION from the components # because AC_INIT rejects anything but a literal for the version number. PACKAGE_VERSION_MAJOR=`echo "$PACKAGE_VERSION" | cut -d. -f1` PACKAGE_VERSION_MINOR=`echo "$PACKAGE_VERSION" | cut -d. -f2` PACKAGE_VERSION_MICRO=`echo "$PACKAGE_VERSION" | cut -d. -f3 | sed -e 's@-.*$@@'` AC_SUBST([PACKAGE_VERSION_MAJOR]) AC_SUBST([PACKAGE_VERSION_MINOR]) AC_SUBST([PACKAGE_VERSION_MICRO]) AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MAJOR, $PACKAGE_VERSION_MAJOR, [Define to the major version of this package.]) AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MINOR, $PACKAGE_VERSION_MINOR, [Define to the minor version of this package.]) AC_DEFINE_UNQUOTED(PACKAGE_VERSION_MICRO, $PACKAGE_VERSION_MICRO, [Define to the micro version of this package.]) # Checks for programs. AC_PROG_CXX AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB AC_PROG_MKDIR_P AM_PROG_CC_C_O # We want to test for the presence of all the necessary Xlibs. # Default to building the X binaries, IF we have all the right # libraries involved. If we do not have all the necessary # libraries OR configure is run with --disable-x-utils, then # we won't build any of the X binaries. # Check how configure is executed and see if we are forced to # not build the X binaries, otherwise default to yes. AC_ARG_ENABLE([x-utils], [AS_HELP_STRING([--disable-x-utils], [disable building X windows utils @<:@default: no@:>@])], [x_utils=${enableval}], [x_utils=yes]) # Check for all the necessary X libraries. # Use conditional tests for each library so we can stop # when we hit one that is missing. Note the first test is different # than the others, it checks to see if we are even building X utilities. have_xlibs=no if test "x${x_utils}" = xyes; then AC_CHECK_LIB([X11], [XOpenDisplay], [have_xlibs=yes], [have_xlibs=no]) fi if test "x${have_xlibs}" = xyes; then AC_CHECK_LIB([Xext], [main], [have_xlibs=yes], [have_xlibs=no]) fi if test "x${have_xlibs}" = xyes; then AC_CHECK_LIB([Xm], [XmCreateMainWindow], [have_xlibs=yes], [have_xlibs=no]) fi if test "x${have_xlibs}" = xyes; then AC_CHECK_LIB([Xpm], [main], [have_xlibs=yes], [have_xlibs=no]) fi if test "x${have_xlibs}" = xyes; then AC_CHECK_LIB([Xt], [XtOpenDisplay], [have_xlibs=yes], [have_xlibs=no]) fi # If we want to build the X binaries (default is yes), but we are # missing one of the required libraries, throw a warning but # continue to build without X support. The user can go back and # resolve the dependencies if they really want X. if test "x${have_xlibs}" = xno; then if test "x${x_utils}" = xyes; then AC_MSG_WARN([ ---------------------------------- Missing one of X11, Xext, Xm, Xpm or Xt libraries. Not building X Windows utilities. If you want to build the X Windows utilities, you need: libx11-dev (provides -lX11) libxext-dev (provides -lXext) lesstif2-dev (provides -lXm) libxpm-dev (provides -lXpm) libxt-dev (provides -lXt) Or the equivalent packages on your OS. ----------------------------------]) fi x_utils=no fi # If all the tests for X libraries pass, set a HAVE_X_LIBS conditional # to allow us to conditionally build the sources in src/X11 AM_CONDITIONAL([HAVE_X_LIBS], [test "$x_utils" = yes]) # Check for libmath AC_CHECK_LIB([m], [cos], [], [AC_MSG_ERROR([Could not find libmath; aborting])]) # Check for AX25 AC_CHECK_LIB([ax25], [ax25_config_load_ports], [AX25_LIB="-lax25"], [AC_MSG_ERROR(Could not find the libax25 libraries; aborting)]) AC_SUBST(AX25_LIB) # Check for ncurses libraries AC_CHECK_LIB(ncurses, initscr, NCURSES_LIB="-lncurses", AC_MSG_ERROR([Could not find the ncurses libraries; aborting])) # Use an m4 macro to check for curses AX_WITH_CURSES case "$ax_cv_ncurses" in "no") AC_MSG_WARN([ncurses not found.]) AC_MSG_WARN([xfbbC will be built with terminal mode.]) esac AM_CONDITIONAL(HAVE_NCURSES, test x$ax_cv_ncurses = xyes -o x$ax_cv_ncursesw = xyes) AC_SUBST(CURSES_LIB) # Checks for header files. AC_CHECK_HEADERS([arpa/inet.h fcntl.h locale.h malloc.h netdb.h netinet/in.h stdlib.h string.h sys/file.h sys/ioctl.h sys/socket.h sys/time.h sys/vfs.h syslog.h termios.h unistd.h utime.h values.h limits.h stdio.h]) # Checks for typedefs, structures, and compiler characteristics. AC_HEADER_STDBOOL AC_C_INLINE AC_TYPE_SIZE_T # Checks for library functions. AC_FUNC_CHOWN AC_FUNC_FORK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_MALLOC AC_FUNC_MKTIME AC_FUNC_REALLOC AC_CHECK_FUNCS([alarm dup2 floor getcwd gethostbyname gettimeofday inet_ntoa memmove memset mkdir modf perror pow putenv rmdir select setlocale socket sqrt strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr tzset utime]) AC_CONFIG_FILES([Makefile doc/Makefile doc/html/Makefile etc/Makefile man/Makefile include/Makefile scripts/Makefile src/Makefile src/X11/Makefile]) AC_OUTPUT fbb-7.0.10/m4/0000755000175000017500000000000013747536076007673 500000000000000fbb-7.0.10/m4/ax_with_curses.m40000644000175000017500000006106713613360505013076 00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_with_curses.html # =========================================================================== # # SYNOPSIS # # AX_WITH_CURSES # # DESCRIPTION # # This macro checks whether a SysV or X/Open-compatible Curses library is # present, along with the associated header file. The NcursesW # (wide-character) library is searched for first, followed by Ncurses, # then the system-default plain Curses. The first library found is the # one returned. # # The following options are understood: --with-ncursesw, --with-ncurses, # --without-ncursesw, --without-ncurses. The "--with" options force the # macro to use that particular library, terminating with an error if not # found. The "--without" options simply skip the check for that library. # The effect on the search pattern is: # # (no options) - NcursesW, Ncurses, Curses # --with-ncurses --with-ncursesw - NcursesW only [*] # --without-ncurses --with-ncursesw - NcursesW only [*] # --with-ncursesw - NcursesW only [*] # --with-ncurses --without-ncursesw - Ncurses only [*] # --with-ncurses - NcursesW, Ncurses [**] # --without-ncurses --without-ncursesw - Curses only # --without-ncursesw - Ncurses, Curses # --without-ncurses - NcursesW, Curses # # [*] If the library is not found, abort the configure script. # # [**] If the second library (Ncurses) is not found, abort configure. # # The following preprocessor symbols may be defined by this macro if the # appropriate conditions are met: # # HAVE_CURSES - if any SysV or X/Open Curses library found # HAVE_CURSES_ENHANCED - if library supports X/Open Enhanced functions # HAVE_CURSES_COLOR - if library supports color (enhanced functions) # HAVE_CURSES_OBSOLETE - if library supports certain obsolete features # HAVE_NCURSESW - if NcursesW (wide char) library is to be used # HAVE_NCURSES - if the Ncurses library is to be used # # HAVE_CURSES_H - if is present and should be used # HAVE_NCURSESW_H - if should be used # HAVE_NCURSES_H - if should be used # HAVE_NCURSESW_CURSES_H - if should be used # HAVE_NCURSES_CURSES_H - if should be used # # (These preprocessor symbols are discussed later in this document.) # # The following output variable is defined by this macro; it is precious # and may be overridden on the ./configure command line: # # CURSES_LIB - library to add to xxx_LDADD # # The library listed in CURSES_LIB is NOT added to LIBS by default. You # need to add CURSES_LIB to the appropriate xxx_LDADD line in your # Makefile.am. For example: # # prog_LDADD = @CURSES_LIB@ # # If CURSES_LIB is set on the configure command line (such as by running # "./configure CURSES_LIB=-lmycurses"), then the only header searched for # is . The user may use the CPPFLAGS precious variable to # override the standard #include search path. If the user needs to # specify an alternative path for a library (such as for a non-standard # NcurseW), the user should use the LDFLAGS variable. # # The following shell variables may be defined by this macro: # # ax_cv_curses - set to "yes" if any Curses library found # ax_cv_curses_enhanced - set to "yes" if Enhanced functions present # ax_cv_curses_color - set to "yes" if color functions present # ax_cv_curses_obsolete - set to "yes" if obsolete features present # # ax_cv_ncursesw - set to "yes" if NcursesW library found # ax_cv_ncurses - set to "yes" if Ncurses library found # ax_cv_plaincurses - set to "yes" if plain Curses library found # ax_cv_curses_which - set to "ncursesw", "ncurses", "plaincurses" or "no" # # These variables can be used in your configure.ac to determine the level # of support you need from the Curses library. For example, if you must # have either Ncurses or NcursesW, you could include: # # AX_WITH_CURSES # if test "x$ax_cv_ncursesw" != xyes && test "x$ax_cv_ncurses" != xyes; then # AX_MSG_ERROR([requires either NcursesW or Ncurses library]) # fi # # If any Curses library will do (but one must be present and must support # color), you could use: # # AX_WITH_CURSES # if test "x$ax_cv_curses" != xyes || test "x$ax_cv_curses_color" != xyes; then # AC_MSG_ERROR([requires an X/Open-compatible Curses library with color]) # fi # # Certain preprocessor symbols and shell variables defined by this macro # can be used to determine various features of the Curses library. In # particular, HAVE_CURSES and ax_cv_curses are defined if the Curses # library found conforms to the traditional SysV and/or X/Open Base Curses # definition. Any working Curses library conforms to this level. # # HAVE_CURSES_ENHANCED and ax_cv_curses_enhanced are defined if the # library supports the X/Open Enhanced Curses definition. In particular, # the wide-character types attr_t, cchar_t and wint_t, the functions # wattr_set() and wget_wch() and the macros WA_NORMAL and _XOPEN_CURSES # are checked. The Ncurses library does NOT conform to this definition, # although NcursesW does. # # HAVE_CURSES_COLOR and ax_cv_curses_color are defined if the library # supports color functions and macros such as COLOR_PAIR, A_COLOR, # COLOR_WHITE, COLOR_RED and init_pair(). These are NOT part of the # X/Open Base Curses definition, but are part of the Enhanced set of # functions. The Ncurses library DOES support these functions, as does # NcursesW. # # HAVE_CURSES_OBSOLETE and ax_cv_curses_obsolete are defined if the # library supports certain features present in SysV and BSD Curses but not # defined in the X/Open definition. In particular, the functions # getattrs(), getcurx() and getmaxx() are checked. # # To use the HAVE_xxx_H preprocessor symbols, insert the following into # your system.h (or equivalent) header file: # # #if defined(HAVE_NCURSESW_CURSES_H) # # include # #elif defined(HAVE_NCURSESW_H) # # include # #elif defined(HAVE_NCURSES_CURSES_H) # # include # #elif defined(HAVE_NCURSES_H) # # include # #elif defined(HAVE_CURSES_H) # # include # #else # # error "SysV or X/Open-compatible Curses header file required" # #endif # # For previous users of this macro: you should not need to change anything # in your configure.ac or Makefile.am, as the previous (serial 10) # semantics are still valid. However, you should update your system.h (or # equivalent) header file to the fragment shown above. You are encouraged # also to make use of the extended functionality provided by this version # of AX_WITH_CURSES, as well as in the additional macros # AX_WITH_CURSES_PANEL, AX_WITH_CURSES_MENU and AX_WITH_CURSES_FORM. # # LICENSE # # Copyright (c) 2009 Mark Pulford # Copyright (c) 2009 Damian Pietras # Copyright (c) 2011 Reuben Thomas # Copyright (c) 2011 John Zaitseff # # 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 . # # Parts of code have been taken from many other softwares. # Thanks for the help. # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 12 AU_ALIAS([MP_WITH_CURSES], [AX_WITH_CURSES]) AC_DEFUN([AX_WITH_CURSES], [ AC_ARG_VAR([CURSES_LIB], [linker library for Curses, e.g. -lcurses]) AC_ARG_WITH([ncurses], [AS_HELP_STRING([--with-ncurses], [force the use of Ncurses or NcursesW])], [], [with_ncurses=check]) AC_ARG_WITH([ncursesw], [AS_HELP_STRING([--without-ncursesw], [do not use NcursesW (wide character support)])], [], [with_ncursesw=check]) ax_saved_LIBS=$LIBS AS_IF([test "x$with_ncurses" = xyes || test "x$with_ncursesw" = xyes], [ax_with_plaincurses=no], [ax_with_plaincurses=check]) ax_cv_curses_which=no # Test for NcursesW AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncursesw" != xno], [ LIBS="$ax_saved_LIBS -lncursesw" AC_CACHE_CHECK([for NcursesW wide-character library], [ax_cv_ncursesw], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_ncursesw=yes], [ax_cv_ncursesw=no]) ]) AS_IF([test "x$ax_cv_ncursesw" = xno && test "x$with_ncursesw" = xyes], [ AC_MSG_ERROR([--with-ncursesw specified but could not find NcursesW library]) ]) AS_IF([test "x$ax_cv_ncursesw" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncursesw CURSES_LIB="-lncursesw" AC_DEFINE([HAVE_NCURSESW], [1], [Define to 1 if the NcursesW library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) AC_CACHE_CHECK([for working ncursesw/curses.h], [ax_cv_header_ncursesw_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncursesw_curses_h=yes], [ax_cv_header_ncursesw_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSESW_CURSES_H], [1], [Define to 1 if is present]) ]) AC_CACHE_CHECK([for working ncursesw.h], [ax_cv_header_ncursesw_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncursesw_h=yes], [ax_cv_header_ncursesw_h=no]) ]) AS_IF([test "x$ax_cv_header_ncursesw_h" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSESW_H], [1], [Define to 1 if is present]) ]) AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h_with_ncursesw], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_header_ncurses_h_with_ncursesw=yes], [ax_cv_header_ncurses_h_with_ncursesw=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_h_with_ncursesw" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) ]) AS_IF([test "x$ax_cv_header_ncursesw_curses_h" = xno && test "x$ax_cv_header_ncursesw_h" = xno && test "x$ax_cv_header_ncurses_h_with_ncursesw" = xno], [ AC_MSG_WARN([could not find a working ncursesw/curses.h, ncursesw.h or ncurses.h]) ]) ]) ]) # Test for Ncurses AS_IF([test "x$CURSES_LIB" = x && test "x$with_ncurses" != xno && test "x$ax_cv_curses_which" = xno], [ LIBS="$ax_saved_LIBS -lncurses" AC_CACHE_CHECK([for Ncurses library], [ax_cv_ncurses], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_ncurses=yes], [ax_cv_ncurses=no]) ]) AS_IF([test "x$ax_cv_ncurses" = xno && test "x$with_ncurses" = xyes], [ AC_MSG_ERROR([--with-ncurses specified but could not find Ncurses library]) ]) AS_IF([test "x$ax_cv_ncurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=ncurses CURSES_LIB="-lncurses" AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if the Ncurses library is present]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) AC_CACHE_CHECK([for working ncurses/curses.h], [ax_cv_header_ncurses_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_header_ncurses_curses_h=yes], [ax_cv_header_ncurses_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xyes], [ ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_CURSES_H], [1], [Define to 1 if is present]) ]) AC_CACHE_CHECK([for working ncurses.h], [ax_cv_header_ncurses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_header_ncurses_h=yes], [ax_cv_header_ncurses_h=no]) ]) AS_IF([test "x$ax_cv_header_ncurses_h" = xyes], [ ax_cv_curses_color=yes ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) AC_DEFINE([HAVE_NCURSES_H], [1], [Define to 1 if is present]) ]) AS_IF([test "x$ax_cv_header_ncurses_curses_h" = xno && test "x$ax_cv_header_ncurses_h" = xno], [ AC_MSG_WARN([could not find a working ncurses/curses.h or ncurses.h]) ]) ]) ]) # Test for plain Curses (or if CURSES_LIB was set by user) AS_IF([test "x$with_plaincurses" != xno && test "x$ax_cv_curses_which" = xno], [ AS_IF([test "x$CURSES_LIB" != x], [ LIBS="$ax_saved_LIBS $CURSES_LIB" ], [ LIBS="$ax_saved_LIBS -lcurses" ]) AC_CACHE_CHECK([for Curses library], [ax_cv_plaincurses], [ AC_LINK_IFELSE([AC_LANG_CALL([], [initscr])], [ax_cv_plaincurses=yes], [ax_cv_plaincurses=no]) ]) AS_IF([test "x$ax_cv_plaincurses" = xyes], [ ax_cv_curses=yes ax_cv_curses_which=plaincurses AS_IF([test "x$CURSES_LIB" = x], [ CURSES_LIB="-lcurses" ]) AC_DEFINE([HAVE_CURSES], [1], [Define to 1 if a SysV or X/Open compatible Curses library is present]) # Check for base conformance (and header file) AC_CACHE_CHECK([for working curses.h], [ax_cv_header_curses_h], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; initscr(); ]])], [ax_cv_header_curses_h=yes], [ax_cv_header_curses_h=no]) ]) AS_IF([test "x$ax_cv_header_curses_h" = xyes], [ AC_DEFINE([HAVE_CURSES_H], [1], [Define to 1 if is present]) # Check for X/Open Enhanced conformance AC_CACHE_CHECK([for X/Open Enhanced Curses conformance], [ax_cv_plaincurses_enhanced], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include @%:@ifndef _XOPEN_CURSES @%:@error "this Curses library is not enhanced" "this Curses library is not enhanced" @%:@endif ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; attr_t d = WA_NORMAL; cchar_t e; wint_t f; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); wattr_set(stdscr, d, 0, NULL); wget_wch(stdscr, &f); ]])], [ax_cv_plaincurses_enhanced=yes], [ax_cv_plaincurses_enhanced=no]) ]) AS_IF([test "x$ax_cv_plaincurses_enhanced" = xyes], [ ax_cv_curses_enhanced=yes ax_cv_curses_color=yes AC_DEFINE([HAVE_CURSES_ENHANCED], [1], [Define to 1 if library supports X/Open Enhanced functions]) AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) ]) # Check for color functions AC_CACHE_CHECK([for Curses color functions], [ax_cv_plaincurses_color], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@define _XOPEN_SOURCE_EXTENDED 1 @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; chtype c = COLOR_PAIR(1) & A_COLOR; initscr(); init_pair(1, COLOR_WHITE, COLOR_RED); ]])], [ax_cv_plaincurses_color=yes], [ax_cv_plaincurses_color=no]) ]) AS_IF([test "x$ax_cv_plaincurses_color" = xyes], [ ax_cv_curses_color=yes AC_DEFINE([HAVE_CURSES_COLOR], [1], [Define to 1 if library supports color (enhanced functions)]) ]) # Check for obsolete functions AC_CACHE_CHECK([for obsolete Curses functions], [ax_cv_plaincurses_obsolete], [ AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @%:@include ]], [[ chtype a = A_BOLD; int b = KEY_LEFT; int g = getattrs(stdscr); int h = getcurx(stdscr) + getmaxx(stdscr); initscr(); ]])], [ax_cv_plaincurses_obsolete=yes], [ax_cv_plaincurses_obsolete=no]) ]) AS_IF([test "x$ax_cv_plaincurses_obsolete" = xyes], [ ax_cv_curses_obsolete=yes AC_DEFINE([HAVE_CURSES_OBSOLETE], [1], [Define to 1 if library supports certain obsolete features]) ]) ]) AS_IF([test "x$ax_cv_header_curses_h" = xno], [ AC_MSG_WARN([could not find a working curses.h]) ]) ]) ]) AS_IF([test "x$ax_cv_curses" != xyes], [ax_cv_curses=no]) AS_IF([test "x$ax_cv_curses_enhanced" != xyes], [ax_cv_curses_enhanced=no]) AS_IF([test "x$ax_cv_curses_color" != xyes], [ax_cv_curses_color=no]) AS_IF([test "x$ax_cv_curses_obsolete" != xyes], [ax_cv_curses_obsolete=no]) LIBS=$ax_saved_LIBS ])dnl fbb-7.0.10/etc/0000755000175000017500000000000013747536100010112 500000000000000fbb-7.0.10/etc/Makefile.in0000644000175000017500000003456413747457130012120 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = etc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = SCRIPTS = $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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@ # Define all the paths we want to use to install the files in FBB_SYSCONFDIR = $(sysconfdir)/ax25/fbb etcfilesdir = $(FBB_SYSCONFDIR) sysfilesdir = $(FBB_SYSCONFDIR) langfilesdir = $(FBB_SYSCONFDIR)/lang fwdfilesdir = $(FBB_SYSCONFDIR)/fwd # Gather all our file names and sort them by target # etcfiles and sysfile are going to be manually installed # by make installconf etcfiles = \ fbbopt.conf\ port.sys.sample\ protect.sys sysfiles = \ bbs.sys\ cron.sys\ forward.sys\ langue.sys\ passwd.sys\ redist.sys\ reject.sys\ swapp.sys\ themes.sys # langfiles and fwdfiles will be installed by make install langfiles = \ lang/english.ent.sample\ lang/english.hlp\ lang/english.inf\ lang/english.txt\ lang/francais.ent.sample\ lang/francais.hlp\ lang/francais.inf\ lang/francais.txt fwdfiles = amsat.fwd # This is a trigger for automake to run the do_subst routine # which will run sed to update the paths in the input files noinst_SCRIPTS = do_subst amsat.fwd # This subroutine uses sed to do find and replace in a file # to dynamically update the paths based on how configure was called edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@prefix[@]|$(prefix)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@package_string[@]|$(PACKAGE_NAME)$(PACKAGE_VERSION)|g' # Remove any files processed with sed when we make clean CLEANFILES = $(etcfiles) $(fwdfiles) EXTRA_DIST = \ $(sysfiles)\ $(langfiles)\ fbbopt.conf.in\ port.sys.sample.in\ protect.sys.in\ amsat.fwd.in 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 etc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu etc/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 check: check-am all-am: Makefile $(SCRIPTS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am 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 tags-am uninstall uninstall-am .PRECIOUS: Makefile # Normally (like with amsat.fwd), we would use per-file make targets # to do the substitution in the files. For etcfiles, we use the automake # noinst_SCRIPTS target to run this subroutine and process them all do_subst: Makefile @list='$(etcfiles)'; for p in $$list; do \ $(edit) $(srcdir)/$$p.in >$$p; \ done amsat.fwd: amsat.fwd.in Makefile $(edit) $(srcdir)/$@.in > $@ # We only want to install the etcfiles and sysfiles if the user # specifically runs make installconf, as they will clobber # any existing files on a working system. This target still lets # us build and isntall them for new installs and packaging. installconf: $(mkinstalldirs) $(DESTDIR)$(etcfilesdir) @list='$(etcfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p; \ done $(mkinstalldirs) $(DESTDIR)$(sysfilesdir) @list='$(sysfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(sysfilesdir)/$$p; \ done $(mkinstalldirs) $(DESTDIR)$(langfilesdir) @list='$(langfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p; \ done $(mkinstalldirs) $(DESTDIR)$(fwdfilesdir) @list='$(fwdfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(fwdfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(fwdfilesdir)/$$p; \ done # 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: fbb-7.0.10/etc/reject.sys0000644000175000017500000000417113613360505012045 00000000000000# # Fichier de rejets # # Dans l'ordre, et a partir de la 1ere colonne : # Type, expediteur, routage, destinataire, taille maximale acceptee # # L'* et le ? peuvent se substituer aux caracteres (syntaxe MS-DOS) # # A partir du 2-05-92 # # Type Exp Via Pour BID MaxLg #------------------------------------------- L B * * * * 0 H * * * HUMOUR * 0 H * F1BBI * * * 0 #H * F6HED * * * 0 #H * F6CDD * * * 0 #H * * * F6CDD * 0 H * F5OJL * * * 0 H B G3RJM * * * 0 H B F1VY * * * 0 H B F6AOK * * * 0 H B F6CDX * * * 0 H B F6CVM * * * 0 H B F6IQF * * * 0 H * EA5EC * * * 0 H * * * * *_F*5SV 0 H * EB5HST * * * 0 H * FD1SLQ * SYSOP * 0 H * DL0SS * * * 0 H * F5PJE * * * 0 H * VE3RZX * * * 0 H B * * CB * 0 H B I0PMW * * * 0 # R B * EA * * 0 R B * AF * * 0 R B * NEWSUU * * 0 R * * FRANCA VENTE* * 0 R * * FRANCA ACHAT* * 0 R * FXXXX * * * 0 R * FILTER * * * 0 #R B * EU * * 0 #R B * FRA * * 0 #R B * FRANCA * * 0 #R B * WW * * 0 R * ALB#* * * * 0 R * FRA#* * * * 0 R * GER#* * * * 0 R * PPN#* * * * 0 R * POL#* * * * 0 R * POR#* * * * 0 R * PWR#* * * * 0 R * TIP#* * * * 0 R * AP1BOX * * * 0 H * @@@#* * * * 0 H * FE6FBB * * * 0 H B * USA * * 0 # fbb-7.0.10/etc/Makefile.am0000644000175000017500000000605013613360505012063 00000000000000# Define all the paths we want to use to install the files in FBB_SYSCONFDIR=$(sysconfdir)/ax25/fbb etcfilesdir = $(FBB_SYSCONFDIR) sysfilesdir = $(FBB_SYSCONFDIR) langfilesdir = $(FBB_SYSCONFDIR)/lang fwdfilesdir = $(FBB_SYSCONFDIR)/fwd # Gather all our file names and sort them by target # etcfiles and sysfile are going to be manually installed # by make installconf etcfiles = \ fbbopt.conf\ port.sys.sample\ protect.sys sysfiles = \ bbs.sys\ cron.sys\ forward.sys\ langue.sys\ passwd.sys\ redist.sys\ reject.sys\ swapp.sys\ themes.sys # langfiles and fwdfiles will be installed by make install langfiles = \ lang/english.ent.sample\ lang/english.hlp\ lang/english.inf\ lang/english.txt\ lang/francais.ent.sample\ lang/francais.hlp\ lang/francais.inf\ lang/francais.txt fwdfiles = amsat.fwd # This is a trigger for automake to run the do_subst routine # which will run sed to update the paths in the input files noinst_SCRIPTS = do_subst amsat.fwd # This subroutine uses sed to do find and replace in a file # to dynamically update the paths based on how configure was called edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@prefix[@]|$(prefix)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@package_string[@]|$(PACKAGE_NAME)$(PACKAGE_VERSION)|g' # Normally (like with amsat.fwd), we would use per-file make targets # to do the substitution in the files. For etcfiles, we use the automake # noinst_SCRIPTS target to run this subroutine and process them all do_subst: Makefile @list='$(etcfiles)'; for p in $$list; do \ $(edit) $(srcdir)/$$p.in >$$p; \ done amsat.fwd: amsat.fwd.in Makefile $(edit) $(srcdir)/$@.in > $@ # We only want to install the etcfiles and sysfiles if the user # specifically runs make installconf, as they will clobber # any existing files on a working system. This target still lets # us build and isntall them for new installs and packaging. installconf: $(mkinstalldirs) $(DESTDIR)$(etcfilesdir) @list='$(etcfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p; \ done $(mkinstalldirs) $(DESTDIR)$(sysfilesdir) @list='$(sysfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(sysfilesdir)/$$p; \ done $(mkinstalldirs) $(DESTDIR)$(langfilesdir) @list='$(langfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(etcfilesdir)/$$p; \ done $(mkinstalldirs) $(DESTDIR)$(fwdfilesdir) @list='$(fwdfiles)'; for p in $$list; do \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(fwdfilesdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(fwdfilesdir)/$$p; \ done # Remove any files processed with sed when we make clean CLEANFILES = $(etcfiles) $(fwdfiles) EXTRA_DIST = \ $(sysfiles)\ $(langfiles)\ fbbopt.conf.in\ port.sys.sample.in\ protect.sys.in\ amsat.fwd.in fbb-7.0.10/etc/port.sys.sample.in0000644000175000017500000000622013613360505013437 00000000000000# BBS sample port file # To be located in @sysconfdir@/ax25/fbb/port.sys # # @package_string@ # # Number of Com Ports (not including Com 0) and TNCs 2 5 # # Interface 6 = Windows # Interface 7 = TCPIP # Interface 8 = TFWin.dll # Interface 9 = LINUX # #Com Interface Adress (Hex) Baud 1 9 0 115200 2 9 189C 0 # Preceding line declares telnet port address 189C in Hexadecimal notation. # 189C = 6300 decimal ---> sample usage syntaxe : telnet f6xyz.no-ip.org 6300 # Com 2 line should be #commented if not using telnet. # # Maxframe: The maximum number of frames the TNC will send at a time. # NbFwd : Number of channels for OUTGOING forward at the same time. # MxBloc : Size of forward-block in Kb. # # M/P-Fwd : Minute of the hour for start of forward, and period # (how many minutes between each forward-start). # Mode : One of these: # B : BBS-mode. # G : "Guest"-mode. # U : Normal-mode. # Type host-mode, one of these: # D : WA8DED # K : KAM hostmode. # M : Telephone-modem. # P : PK-232 # Q : BPQ v 4.x # Addition: One of these letters can be used too: # L : Send unproto beacon after each arriving mail. # Y : Yapp allowed on this QRG. # W : Gateway allowed TO this QRG. # R : Read-Only acces. # E : Recommanded by JP F6FBB # # Freq. : Text to describe this port (max 9 characters, no space) # Same number of lines as number of TNCs. # #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq 0 0 0 0 0 0 0 0 00/01 ---- File-fwd. 1 4 1 vhfdrop 250 2 2 10 15/15 XULWY VHF 2 4 1 uhfdrop 250 2 2 10 14/30 XULWY UHF 3 4 1 hfdrop 250 2 2 10 25/15 QULWY HF 4 4 2 0 250 2 4 10 13/60 TUY Telnet 5 4 1 axudp 250 2 2 10 12/60 XUWY AXUDP # 6 6 1 rose0 250 2 6 10 11/60 XUWY Rose0 # 7 4 1 netbbs 250 2 2 10 30/15 XUWY NetRom # # On line (TNC 6) multch is rose0 that is the device providing internal # interface with ROSE kernel module when an FPAC node is installed. # For example BBS or users wanting to connect this BBS via ROSE network routing should call F6XYZ-1 2080194501 # in order to let ROSE/FPAC network know how to relay the frames between ROSE nodes. # TNC 5 line declares port AX.25<->UDP toward LAN local area network and Internet # If forward is done through AXUDP (TNC 5), forward file will state "P E" # If forward is done through Telnet (TNC 4), forward file will state "P D" etc... # TNC 4 declares telnet port 6300 --> COM 2. This line to be #commented if telnet not in use. # MultCh: 0, axudp, uhfdrop,..., are the names of ports in /usr/local/etc/ax25/axports # axudp is a device associated with ax25ipd application for IP encapsulation of AX.25 frames # allowing forward via Internet # netbbs is a NetRom device declared in nrports. # # Special callsigns and modes for some channels # TNC Nbs Callsign-SSID Mode # 1 2 XXXXX-1 B # # End of file fbb-7.0.10/etc/langue.sys0000644000175000017500000000074313613360505012045 00000000000000# # Fichier d'affectation des langues aux premieres connexions. # Tout indicatif non reconnu prend par defaut la langue 1 # 3 parametres dans l'ordre : Nb-Langues Nb-Buffers Langue-defaut 2 1 1 # ENGLISH FRANCAIS # # 1 : Anglais # 2 : Francais # C3* 7 CT* 9 CU* 9 DU* 1 D* 6 EK* 1 E?3* 7 E?5* 7 E?6* 7 E* 3 F* 2 H* 2 I* 4 LA* 8 ON1A* 5 ON1B* 5 ON1C* 5 ON1K* 2 ON4* 2 ON5* 2 ON6* 2 ON7* 2 ON8* 1 ON9* 1 OZ* 10 PY* 9 P* 5 SK* 11 SM* 11 TU* 2 TK* 2 VE2* 2 YU* 12 YT* 12 # 3A* 2 3B* 2 # fbb-7.0.10/etc/protect.sys.in0000644000175000017500000000043513613360505012655 00000000000000# # protect.sys file for FBB # # # This files gives a list of directory trees in which # files cannot be modified/created by FbbDos except # in sysop mode with the needed rights # # path MUST be LINUX ABSOLUTE path (starting with a "/") # @localstatedir@/ax25/fbb/fbbdos/readonly fbb-7.0.10/etc/passwd.sys0000644000175000017500000000033513613360505012070 00000000000000# # Password for all non defined callsigns (one case dependant line) # password # # Rights and password specific to callsigns (one or more lines) # F6ZZZ 63 1023 THIS_IS_THE_PASSWORD_OF_F6ZZZ # # End of passwd.sys file # fbb-7.0.10/etc/fbbopt.conf.in0000644000175000017500000000664613613360505012572 00000000000000 ################################################################## # # Optional lines # # Callsign (and route if needed) that will have copy of SYSOP messages #sysmail = F6XXX F5XXX@F6XXX.FMLR.FRA.EU # Line to send WP messages #wpcalls = F1XXX # BBS-UP batch or program #upbatch = # BBS-DW batch or program #dwbatch = # # Servers will be searched and run in the "server" directory # # REQCFG, REDIST and WP are already built-in # # Name Filename Information server = REQDIR reqdir Directory request ################################################################## # # The rest of lines overwrites defaults. Here are the default values # # Directory of data files data = @localstatedir@/ax25/fbb # Directory of config files config = @sysconfdir@/ax25/fbb # Directory of message files messages = @localstatedir@/ax25/fbb/mail # Directory of compressed files compressed = @localstatedir@/ax25/fbb/binmail # Directory of users fbbdos = *,*,@localstatedir@/ax25/fbb/fbbdos,*,*,*,*,* # Directory of YAPP files yapp = @localstatedir@/ax25/fbb/fbbdos/yapp # Directory of documentation files docs = @docdir@ # Directory of the pg programs pg = @libdir@/fbb/pg # Directory of the filter programs fdir = @libdir@/fbb/filter # Directory of the server programs sdir = @libdir@/fbb/server # Directory of the tool programs (fbbdos, forward, cron...) tdir = @libdir@/fbb/tool # Path and filename for import file import = @localstatedir@/ax25/fbb/mail/mail.in # Full log logs = OK # Test mode test = NO # Use (when possible) forward type FBB fbbfwd = OK 160 # Use (when possible) compressed forward fbbcomp = OK 3 # Wait for informations (Name, HomeBBS, Qth, ZIP) askinfo = OK # First connection mask : # 0 : Disable # 1 : Excluded # 2 : Local # 4 : Expert # 8 : Sysop # 16 : BBS # 32 : Pagination # 64 : Guest # 128: Modem # 256: See-all-messages # 512: Unproto list asking is allowed # 1024: Liste des messages nouveaux. # 2048: mask = 3616 # Security codes. # Users can : # 1 : Read all messages, including private messages # 2 : Kill all messages # 4 : Send SYS command # 8 : Use remote sysop commands (edit, forward, etc...) # 16 : Edit labels in YAPP, FBBDOS, DOCS # 32 : Can delete files in YAPP, FBBDOS # 64 : Have access to all gateways # 128: Run DOS commands # 256: Have access to the entire hard disk # 512: Have access to commands /A (stop) and /R (Reboot) # All: Sysop: Sysop after successful SYS-command: security = 0 4 59 # WARNING messages to sysop # 1 : Less than 1MB in disk # 2 : Error in system file (FORWARD, BBS, REJECT...) # 4 : Server error/warning # 8 : Ping-Pong warning # 16 : Unknown route warning # 32 : Unknown NTS warning # 64 : Message file not found # 128: Error in proposal # 256: Message rejected in remote BBS # 512: Message held in remote BBS # warning = 255 # Time (hour) for housekeeping (cleanup of messages) housekeeping = 2 # Time-out for normal users / forward timeout = 10 20 # Download size YAPP / MODEM maxdownload = 0 0 # Hours +/- in relation with UTC #localtime = 0 # Number of callsigns in mail beacon beacon = 8 # Number of lines in scroll buffers # # User Console Monitoring scroll = 1500 1500 1500 # Text for forward header (Do not change !) fwdheader = [$c] $$:$R # Number of saved BIDs maxbids = 30000 # Lifetime for bulletins (days) lifetime = 30 # Zip code of the BBS zipcode = 00000 # Number of back messages in unproto lists unprotoes = 500 5 P # # End of fbb.conf file fbb-7.0.10/etc/forward.sys0000644000175000017500000000024513613360505012233 00000000000000**************************** * LIST OF FORWARD SCRIPTS * * FICHIER DE FORWARD F6FBB * * * **************************** * < fwd/amsat.fwd * fbb-7.0.10/etc/lang/0000755000175000017500000000000013747536100011033 500000000000000fbb-7.0.10/etc/lang/english.hlp0000644000175000017500000017177313613360505013125 00000000000000################################ # ENGLISH.HLP for FBB 7.00 # # by LA6CU 18/1 1997 # # Modified by N1API 10/3/97 # # And again by LA6CU 2/6/1998 # # Revised by I0OJJ 20/04/2011 # ################################ ################# # Guests are -1 # ################# @@ -1 ? You have only a limited set of commands : H : Read this help text. KM : KILL all messages to you that you have read. LM : LIST all messages to you. O : Choose 'options' (language, paging). RM : Read all messages to you. RN : Read all NEW messages to you. S : SEND a message. T : 'Talk' to sysop. B : Bye (disconnect). ################# # SERVERS are 0 # ################# @@ 0 ? *** That command is not available here !! Available commands are : C : Connections - statistics. D : Documentation. N : Callbook (nomenclature). Q : QTH locator (calculations etc). T : Satellites, trajectory F : Return to BBS mode. B : Disconnect. Press ? [LETTER] for more detailed information on one special command. @@ 0 C CONNECTIONS - STATISITICS ------------------------- This is where you can get statistical information on the use of this BBS. @@ 0 D DOCUMENTATION ------------- This is where you can get information and documentation of various kinds. The commands are numerical. @@ 0 N CALLBOOK (NOMENCLATURE) ------------------------ In this module you will find any information that users want to leave, Surname, first name, address, telephone, etc ... You can enter your own information in the same way. @@ 0 Q QTH LOCATOR ----------- The QTH Locator describes one geographical position. This is done with a succession of 2 letters, 2 numbers and 2 letters. Example: FN31SH You can change a QTH locator into longitude and latitude, or viceversa, calculate the distances and headings between two QTH locators, or calculate your contest scores (cumulative distances). @@ 0 T SATELLITE TRAJECTORY -------------------- Trajectory calculator, orbital parameters and the charactaristics of several amateur satellites. @@ 0 F RETURN TO BBS MODE. ------------------- Use this command to return to BBS mode. @@ 0 B DISCONNECT. ----------- With this command you can log off the BBS directly without going back to the BBS mode. ########################### # QRA locator server is 2 # ########################### @@ 2 ? *** That command is not available here !! Available commands are : C : Sum the distances between a point and several QTH locators. D : Calculate distance and heading between two QTH locators. L : Change longitude and latitude into QTH locator. Q : Change QTH locator into longitude and latitude. F : Return to the server menu. B : Disconnect. Press ? [LETTER] for more detailed information on one special command. @@ 2 Q Command Q : Change a QTH Locator into longitude and latitude. The longitude and latitude are given in degrees/minutes and in gradians. @@ 2 L Command L : Change Longitude and Latitude into a QTH Locator. The longitude and latitude can be entered in degrees and hundredths, degrees and minutes, or in gradians. Correct format must be used: Degrees : 1:45:00 (direction) Gradians : 1.5 (direction) where [direction] must be replaced by North, South, East or West. Remember to use a CAPITAL letter as the first letter! @@ 2 D Command D : Calculate the distance and heading between two QTH locators. The distance is given in Km and the heading in degrees. @@ 2 C Command C : Sum of calculated distances. Having entered the QTH locator, which serves as the origin for the calculations, you could give a destination QTH locator. The calculated distance could be summed with a second or several other calculations. It permits you to calculate the total number of Km. Distances shorter than 1 km is given 1 point in the calculations. @@ 2 F Command F : ----------- With this command you can go back to the server menu, and continue from there. If you want to leave the server mode, you can press F once more. @@ 2 B Command B : ----------- With this command you can log off from the BBS without going back to the BBS mode. ################### # STATISTICS is 3 # ################### @@ 3 ? *** That command is not available here !! Available commands are : G : General statistics. H : Graphic display of use per hour. I : List of callsigns who have used this BBS. J : Graphic display of use per day. L : Detailed list of connected stations (can be aborted by the A command). O : Use of the mailbox and BBS servers (percentages). F : Return to the server menu. B : Disconnect. Press ? [LETTER] for more detailed information on one special command. @@ 3 O Command O : Shows the usage of the mailbox and servers (percentage), and also the usage of each server individually. @@ 3 G Command G : General statistics about the server: - Number of active messages. - Number of connections in this BBS. - Average time per connect. - Average number of connects per day. - High-traffic hours. @@ 3 L Command L : Show detailed information on each connect: - Port (A, B, etc) - Channel number - Number of each connect (starting from 1) - Callsign - Date - Time (start of connection) - Number of minutes and seconds for the connect The list is shown in reverse chronological order, and can be aborted with the A command. @@ 3 H H : Graphic display of mailbox usage each hour. H [call] : Graphic display of usage of a callsign. 'Wildcards' are allowed here. For example: H W* : Gives a graphic display of usage from all W stations. @@ 3 J J : Graphic display of daily total use of the mailbox. J [call] : Graphic display for a callsign. 'Wildcards' are allowed here. For example: J W* : Gives graphic display of usage from all W stations. @@ 3 I I : List all callsigns that have used this mailbox. The list is sorted in alphabetical order. 'Wildcards' are allowed, for example: I W* : Gives a list of all W stations. @@ 3 F Command F : ----------- With this command you can go back to server menu, and continue from there. If you want to leave server mode, you can press F once more. @@ 3 B Command B : ----------- With this command you can log off from the BBS without going back to the BBS mode first. ###################### # DOCUMENTATION is 4 # ###################### @@ 4 H DOCUMENTATION: -------------- To read a file from the list, just type the number for the file. New files are entered with the NEWDOC server in BBS mode. Get help for this in BBS mode (? NEWDOC). Send L to see the list of files. Sysop: DESCRIPTION can be changed with the D command: D BBS.DOC Description Press ? [LETTER] for more detailed information on one special command. @@ 4 F Command F : ----------- With this command you can go back to the server menu, and continue from there. If you want to leave the server mode, you can press F once more. @@ 4 B Command B : ----------- With this command you can log off from the BBS without going back to the BBS mode first. @@ 4 D Command D (only for sysop) : ---------------------------- SYSOPs can use this command to edit the description of a file. Command D (filename) (description) @@ 4 L Command L : ----------- Use this command to see list of available files. @@ 4 R Command R : ----------- If you have moved to a subdirectory of DOCS, use R to return to previous directory level. ##################### # NOMENCLATURE is 5 # ##################### @@ 5 ? *** That command is not available here !! Available commands are : I : List of callsigns that have connected. N : Change your name and address details, telephone number and QTH loc. R : Search for information on a user. F : Return to the server menu. B : Disconnect. Press ? [LETTER] for more detailed information on one special command. @@ 5 N Command N : Change your name and address. If the entries in the address file are incorrect or they have changed, you can change them with this command. A or in response to the question will not modify the contents. If the contents of the file are correct, you stop the changes by replying N to the Change (Y/N) question. For SYSOP : Sysop can change user-data with command N (callsign). @@ 5 R Command R : Search for information on a user. You can send R alone, then the BBS will prompt you for a callsign, or you can send R [callsign] directly. Example: R LA6CU @@ 5 I Command I : List of the callsigns that have connected to the BBS. This is in alphabetical order. @@ 5 F Command F : ----------- With this command you can go back to the server menu, and continue from there. If you want to leave the server mode, you can press F once more. @@ 5 B Command B : ----------- With this command you can log off from the BBS without going back to BBS mode first. ####################### # TRAJECTOGRAPHY is 6 # ####################### @@ 6 ? *** That command is not available here !! Available commands are : C : Charactaristics of amateur satellites. P : Obtain the orbital parameters. T : Calculate the trajectory of a satellite. F : Return to server menu. B : Disconnect. After commands C, P and T send L for list of satellites. Press ? [LETTER] for more detailed information on one special command. @@ 6 T Command T : Calculate a satellite's trajectory. After choosing the satellite for which you want the trajectory, you have to enter the date and time from which the calculations start. The geographical position is the QTH locator of the connected station, if it is in the file, else the QTH locator of the server will be used by default. Following the satellites, the calculated pass could be variable, and a line of parameters will be displayed each pass. This calculated line corresponds to a minimum elevation of -5 degrees, when the satellite is 5 degrees below the horizon. After command T send L for list of satellites. @@ 6 P Command P : Display the orbital parameters of the selected satellite. These parameters are used for the calculations. After command P send L for list of satellites. @@ 6 C Command C : Characteristics and information on the selected satellite. After command C send L for list of satellites. @@ 6 F Command F : ----------- With this command you can go back to the servermenu, and continue from there. If you want to leave the server mode, you can press F once more. @@ 6 B Command B : ----------- With this command you can log off from the BBS without going back to BBS mode first. ############### # 9 is FBBDOS # ############### @@ 9 ? Available commands in FBBDOS are: ? and HELP - This help text. O - Options (paging, base number, etc) BGET - Download a file with Autobin (via modem) BPUT - Upload a file with Autobin (via modem) DIR - Show directory listing. ########################################################################### # New in 5.15: DU - Show disk usage. ########################################################################### EDIT - Edit a file. GET - Download an ASCII file from the BBS. PUT - Upload an ASCII file to the BBS. CD - Change Directory. MD and MKDIR - Make Directory. COPY - Copy a file. DEL - Delete a file. RD and RMDIR - Remove a Directory. TYPE - Download an ASCII file with paging. ############################################################################ # New in 5.15b BGET - Download a file with AUTOBIN (via radio) BPUT - Upload a file with AUTOBIN (via radio) YGET - Download a file with YAPP (via radio) YPUT - Upload a file with YAPP (via radio) XGET - Download a file with XMODEM (via modem) XPUT - Upload a file with XMODEM (via modem) X1GET - Download a file with 1k XMODEM (via modem) YGET - Download a file with YMODEM (via modem) ZGET - Download a file with ZMODEM (via modem) ############################################################################ LIST - Show directory-listing WITH labels (if available). PRIV - Go to a special directory (private...). VIEW - See contents of .ZIP, .ARC and .LZH files. WHERE filename - To find one or more files. NEW - See all new files since last NEW command. EXIT, F and QUIT - Return to BBS mode. B - Disconnect. You can go from one disk to another (like in MSDOS) with commands A: or C: ect. if the BBS uses more than one (physical or virtual) disk. For more detailed help with one command, type ? (command) @@ 9 HELP Command "HELP": --------------- Command "HELP" shows all available commands under FBBDOS. @@ 9 B Command "B": ------------ Logs off the BBS directly (disconnects). @@ 9 CD Command "CD": ------------- Command 'CD' is used (like in DOS) to change directory. Example: CD \TEST 'CD ..' is used to go back to the previous directory level. @@ 9 COPY Command "COPY": --------------- COPY command is for copying files. If the filename already is used, the old file will be overwritten. Example: COPY TOTO.TXT TEST.TXT @@ 9 DEL Command "DEL": -------------- DEL command is for deleting files. You can only delete files that YOU have uploaded, only SYSOP can delete other users' files. @@ 9 DIR Command "DIR": -------------- DIR command shows the contents of the present directory. DIR can also use a path, like: DIR \TEST Wildcards are also allowed here, like: DIR *.SYS @@ 9 DOS SYSOP can now run DOS programs from remote. Sysop must be in FBBDOS and send the command DOS [program] [parameter] Output from that program will go back to the sysop. The program cannot take any input from the SYSOP after it has started. If anything goes wrong in the task the DOS program is run, the task will be shut down after 3 minutes and the BBS will continue to work as before. ########################################################################### # New in 5.15: @@ 9 DU Command "DU": ------------- Use DU command to see the used/available disk space. ########################################################################### @@ 9 EDIT Command "EDIT": --------------- This command is used for editing text files in this BBS. These are the available commands: ? : Shows all commands that can be used in the editor. A : Adds a line after the current line. The text for the new line shall follow the letter A. If more commands are to follow after the text, the text must be ended with a '/' before next command. If the sign '/' itself is to used in the text, a '\' must be written just before the '/'. If again the '\' is to be used inside the text as a valid character, it must be written twice ('\\'). The pointer will be at the start of the new line. B : Go to start of file. E : Go to end of file. F : Search for the first occurrence of a character (or string of characters) in the file. The search starts at the current line. The string of characters must be ended with a '/' if more commands are chained (see the paragraph on the A command). I : Insert a line before the current line. Read about ending with a '/' in the paragraph on the A command. K : Delete the number of lines that are stated just before the letter K. Example: 3K If no number is used, then 1 line is deleted. L : Move a number of lines from the current line. The number can be negative to move towards the start of the file. Examples: 5L -10L N : Toggle line numbering on/off. P : Show a number of lines from the current line. Example 8P. This will show 8 lines, starting with the current line. R : Search and replace. Search for a string of characters and replace it with a new one. Example: 'R ALL/ALLE' will replace all ALL with ALLE from the current line to the end of the file. S : Save file. Q : Exit the editor without saving the file. Examples:: "EDIT>B5L10P" sets thepointer at start of file. Move 5 lines down, and shows 10 lines from there. 'EDIT>B4L6K-2L1OP' sets the pointer to the start of file. Move down 4 lines. Delete 6 lines. Move back 2 lines, and show 10 lines. 'EDIT>BFBonjour/K-2L5P' sets the pointer to the start of file, searches for 'Bonjour', deletes the line containing 'Bonjour', moves back 2 lines and shows 5 lines. 'EDIT>BFBonjour/IC'est une nouvelle ligne avec un \/ dedans/-1L3P' sets the pointer to start of file. Searches for 'Bonjour', inserts the new line. The new line also contains the character '/'. Goes back 1 line and shows 3 lines. "EDIT>SQ" save file and quit the editor. @@ 9 EXIT|QUIT|F Commands "EXIT", "QUIT", "F". ----------------------------- Leave FBBDOS and return to BBS mode. @@ 9 GET Command "GET": -------------- Use this command to download an ASCII file from the BBS without paging. Example: GET NORSK.MAN @@ 9 LIST Command "LIST": --------------- Lists files (also ASCII files) in the same manner as YI lists YAPP files with labels. @@ 9 MD|MKDIR Commands "MD" or "MKDIR": ------------------------- Use this command to make a new directory. Example: MD TEST @@ 9 NEW Command "NEW": -------------- List all new files, in all available directories, that have arrived since you last sent NEW. @@ 9 O|OL|ON|OR|OP Command "O". ------------ The O command gives you different options: O alone shows you what language you are using, paging and base number. - Type OP to toggle paging on messages. - Type OP [number of lines] to select paging with a specific number of lines per page. - Type OL alone to get a list of available languages. - Type OL[space][language number] to choose a language. - Type ON alone to see your base number. - Type ON [number] to choose a new base number. The number you type, will be multiplied by 1000, so if you type ON 54, your base number will be 54000. After that, you can type R 25 to read message number 6025. It is also allowed to type ON 54000. - Type OR to choose if you want to list/read all personal messages in the BBS. - Type OM to choose if you want to receive the list of new messages at every connect. @@ 9 PUT Command "PUT": -------------- Use this command to upload an ASCII file to the BBS. If the filename exists, the file will not be overwritten! You must delete it first. However, you cannot delete files that have been uploaded by other users, you can only write over your 'own' files. Example: 'PUT TEST.TXT' @@ 9 PRIV Command PRIV ------------ PRIV is a special command in FBBDOS. It gives authorized users access to a special directory. All users can be authorized, not only sysops. @@ 9 RD|RMDIR Commands "RD" or "RMDIR": ------------------------- Remove a directory with this command. You can only remove empty directories, and only if YOU have created that directory. @@ 9 TYPE Command "TYPE": --------------- Use this command to download a file from the BBS, using paging. (That is; if you also use paging in BBS mode...). @@ 9 VIEW Command "VIEW". --------------- Use this command to see the contents of archived files, like *.ZIP. *.LZH. *.ARC etc. Use it like this: VIEW filename.ext ########################################################################### # BGET/BPUT new in 5.15b @@ 9 BGET Command "BGET": --------------- Use via radio to download a file with AUTOBIN protocol. @@ 9 BPUT Command "BPUT": --------------- Use via radio to upload a file with AUTOBIN protocol. ############################################################################## ############################################################################# # New in 5.15b: X1GET @@ 9 XGET|X1GET Commands "XGET" and "X1GET": ---------------------------- This command is used for downloading files with the XMODEM or 1K XMODEM protocol. This works only on telephone modem port on the BBS. Example: 'XGET FICHIER.EXE' ############################################################################# You can resume a download from the point you last stopped, with the command XGET (filename) (offset). Example: XGET FICHIER.EXE 150000 starts the download from byte 150000. The files can later be put together with the program called CUT. @@ 9 XPUT Command "XPUT": --------------- This command is used for uploading files with the XMODEM protocole. This works only on the telephone modem port on the BBS. Example: 'XPUT TEST.EXE' ############################################################################# # New in 5.15b: YGET for modem: @@ 9 YGET Command "YGET": -------------- This command is used for downloading files with the YAPP protocole. Example: 'YGET FICHIER.EXE' Via telephone modem YGET can be used for downloading files with YMODEM, YMODEM BATCH or YMODEM G. ############################################################################## @@ 9 YPUT Command "YPUT": --------------- This command is used for uploading files with the YAPP protocol. Example: 'YPUT TEST.EXE' ########################################################################### # ZGET for modem new in 5.15b @@ 9 ZGET Command "ZGET": --------------- Use this command to download a file with the ZMODEM protocol. ############################################################################## ################## # BBS-mode is 14 # ################## @@ 14 ? - Type ? [COMMAND] for the HELP on that command. Examples: - type ? H for a list of all the most common commands. - type ? O for help on available options (languages, paging, etc). (Paging is toggled on/off with the OP command) - Type ? REQDIR or ? REQFIL for the help on those servers. Remember to press or after each command :). X : toggles your status between EXPERT and NORMAL user. A : can be used to abort listings. I : shows information about this system. Last used message number can be repeated by using the # character. Example: R 1235. Next command: K # For SYSOP: Overview of all commands for sysop with ? SYSOP. Overview of all the function keys with ? FUNCTION. @@ 14 A|ABORT In the middle of a long listing from the BBS, you can send the command A (ABORT) to stop the listing. The listing will stop after a short while, and the BBS will ask you if you want to read some of these messages. The listing continues after reading the mesages. If you want to continue listing messages, or if you want to stop all listings, the normal BBS prompt will return. ############################################################################# # New in 5.15: N of C When reading messages with paging, you can also use commands N and C if you are reading many messages. For example if you sent R 123 234 345 654, Use N to skip the rest of current message and start with the next one. Use C to cancel paging for the rest of the messages. ############################################################################## A can also be used many other places, for example when downloading long ASCII files, you can abort the file with the A command. @@ 14 ACK By typing /ACK in the first column of a line in a message, you will receive an acknowledge message from the receiver BBS when the message arrives there. This works ONLY with FBB BBSs. @@ 14 B The 'B' command logs you off the PBBS and disconnects you. - Type 'B' to LOG OFF gracefully [Bye]. (You may also type the full word BYE) Be sure to hit or after each command. ########################################################################### # Changed in 5.15 - NOTE: When you use B or Q to disconnect, your last listed message (from this session) is being saved till next connect. If for some reason you are disconnected, this last listed parameter is not changed. You can reconnect and relist the same messages once more. ########################################################################### @@ 14 Q The 'Q' command logs you off the PBBS and disconnects you. - Type 'Q' to LOG OFF gracefully [Quit]. (You may also type the full word QUIT) Be sure to hit or after each command. ########################################################################### # Changed in 5.15 - NOTE: When you use B or Q to disconnect, your last listed message (from this session) is being saved till next connect. If for some reason you are disconnected, this last listed parameter is not changed. You can reconnect and relist the same messages once more. ########################################################################### @@ 14 C|CW - The 'CW' command lists the callsigns in the conference. - The 'C' command lets you enter the conference. In the conference, all commands must begin by a period first. The commands are : .C [port] CALLSIGN [V DIGIPEATER ...] connects a callsign on a port. .D disconnects a user from the conference. .H gives you this help file. .W lists the call signs in conference. .Q lets you leave the conference. @@ 14 D|DOS|DOWNLOAD D command has 2 different functions. 1) If you send D [filename], the mailbox will send you the file with that name. This file must be in the root directory for users. If the file is in a subdirectory, you must use the full path, like this: D VHF/VHF.DX See also help with the W command (? W). 2) If you send the letter D alone, you will enter FBBDOS. The commands in FBBDOS are very similar to those of MSDOS. Users have access to a part of the BBS's harddisk in FBBDOS. The following commands are allowed: ? HELP >= Use one of these to get help. DIR >= List files in this directory. MD MKDIR [name] >= Use one of these to make a new directory. RD RMDIR [name] >= Use one of these to remove a directory. You cannot be in the directory you want to remove, and the directory must be empty. CD [name] >= Use CD to change directory. COPY [from] [to]>= Copy a file named [from] to a file named [to]. Can also be used to copy between directories. DEL [filename] >= Deletes the file [filename]. TYPE [filename] >= Download the ASCII-file [filename] from the BBS. The file is divided into pages, if you use paging when in BBS mode. The file must be in your current directory. GET [filename] >= Identical to TYPE, but always without paging, the file is always ended with a CTRL-Z. PUT [filename] >= Use this command to upload an ASCII-file to this directory. ############################################################################ # New in 5.15b: BPUT and BGET >= Use for upload or download of files via radio with AUTOBIN protocol. YPUT and YGET >= These are identical to PUT and GET, but uses the YAPP protocol for binary transfer. Except: Via telephone modem YGET can be used to download files with YMODEM, YMODEM BATCH or YMODEM-G. ############################################################################ XPUT and XGET >= These are identical to YPUT and YGET, but uses the XMODEM protocol for binary transfer. Only for telephone modem. ############################################################################ # New in 5.15b: X1GET >= As XGET, but with 1K-XMODEM protocol. ZGET >= As XGET, but with ZMODEM protocol. ############################################################################ EDIT [filename] >= This is a small editor for editing texts and files in the BBS. You can use this editor ONLY on files that YOU have uploaded to the BBS. Get more info with ? EDIT F B EXIT QUIT >= Use one of these to go back from FBBDOS to BBS-mode. O >= Use this to set 'options' like in BBS mode. LIST >= Same as DIR, but shows also descriptions of files, if users have provided such an description. PRIV >= Gives authorized users access to a special directory. VIEW >= See the contents of an archived file like *.ZIP, *.LZH etc. VIEW filename.ext NEW >= List all new files since you last sent NEW @@ 14 E|EU This command is only for sysop and remote sysop. EU [callsign] to edit a user. E [msg#] to edit a message. @@ 14 F F - command gives you access to SERVER mode and special commands. In 'server mode' you can do several things: Get statistics of the use of this mailbox. Read documentation of different kind. Read info on all users of this mailbox. Calculate QTH locator and distances between several QTH locators. Calculate trajectory of different sattellites. For more information, type ? when you have entered SERVER mode. For detailed information, type ? [command]. @@ 14 FUNCTION Here is an overview of all function keys: For WinFBB: F1 - Help. F2 - Connect to the BBS locally with the console-callsign. F3 - Disconnect a channel. F4 - Start or stop forwarding. Shows how many and the size of messages that are waiting to be forwarded right now (real time). F5 - Toggle monitoring on/off. F6 - Change console-callsign. That callsign is used when connecting to the BBS with F2 or via gateway F9. The callsign have SYSOP status. F7 - Program TNC directly. F8 - Not used F9 - Gateway, using console callsign. F10 - Talk to the user that has sent a T or initiate a chat with a user. ALT-F1 - Not used ALT-F2 - Not used ALT-F3 - Start or stop forward scan. ALT-F4 - Quit FBB. ALT-F5 - Start a texteditor (use F1 for help). ALT-F6 - Not used ALT-F7 - Shows last connections. ALT-F8 - Not used ALT-F9 - Not used ALT-F10- Not used ############################################################################ # New in 5.15: ALT-B - Not used ALT-D - Not used ALT-R - Not used ALT-S - Not used ALT-X - Not used ############################################################################ CTRL F1 to CTRL F10 holds pre defined texts, which are sent when pressing that key. The texts are in the file MEMO.SYS. Works only in the editor. Exceptions: CTRL-F1 and CTRL-10 are captured by Windows. CTRL-F4 exits the editor. For DosFBB: F1 - General help on all function keys. F2 - Connect to the BBS locally with the console callsign. F3 - Disconnect a channel. F4 - Start or stop forwarding. F5 - Toggle monitoring on/off. With monitor on, the lower part of the screen displays the monitored traffic, while the upper part of the screen shows traffic in the BBS. The number of lines in upper/ lower part of the screen can be adjusted with the arrow up or arrow down keys. F6 - Change console callsign. That callsign is used when connecting to the BBS with F2 or via gateway F9. The callsign has SYSOP status. F7 - Program TNC directly. F8 - Reboot PC. Can be done at once, or when all channels are free. F9 - Gateway, using console callsign. F10 - Talk to the user that has sent a T or initiate a chat with a user. ALT-F1 - Shows pending forward(s). Shows number of personal messages, bulletins, and the total amount of kB waiting to be forwarded. ALT-F2 - Shows all callsigns that are connected to the BBS. ALT-F3 - Start or stop forward scan. ALT-F4 - Shows the last connected callsigns. ALT-F5 - Starts a very simple text editor, (use F1 for help). ALT-F6 - Various 'options' : Sysop is in ? Beep at connect ? Show callsigns etc. on every channel ? Gateway allowed ? Justification ? ALT-F7 - Import messages from file. ALT-F8 - Export messages to file. Messages that are waiting to be forwarded to one BBS, can be forwarded to a file. ALT-F9 - Exit to DOS. The BBS is halted during that time. ALT-F10- Stop the mailbox program. Can be done at once, or when all channels are clear. ############################################################################ # New in 5.15: ALT-B - Blank screen. ALT-D - Save scroll buffer. ALT-R - Redisplay screen. ALT-S - Show last DOS screen. Press a key to return to the BBS. ALT-X - Stop the BBS (same as ALT-F10). ############################################################################ CTRL-F1 to CTRL-F10 holds pre defined texts, which are sent when pressing that key. The texts are in the file MEMO.SYS. @@ 14 G|GATEWAY G - command gives you access to the GATEWAY (if the BBS allows gateway), if there is a channel available on the gateway port). @@ 14 H|HELP List of available commands: A : Abort - Abort listing. B : Bye - Log off the BBS. C : Conference - Access to conference. D : DOS - Access to FBBDOS, or to download a file. F : FBB - Access to the server mode. G : Gateway - Access to the other frequences by 'gateway'. H : Help - Help. I : Info - Information about the system. J : Jheard - List of the last few connected stations. K : Kill - Kill messages. L : List - List messages. M : Make - Copy a message to a file. N : Name - Change your name. NZ: Zip - State your zipcode. NH: homeBBS - Type your homeBBS. O : Option - Select options (paging, language, list/read personal etc). PS: Servers - Show which servers are available in this BBS. PG: Program - Run (show) certain DOS programs. Q : Quit - Exit/logout of the BBS like the Bye command. R : Read - Read messages. S : Send - Send messages. T : Talk - Talk to SYSOP. U : Upload - Upload a file to the BBS. V : Verbose - Verbose read of messages (like R, but with forwarding headers). W : What - Which files are available. X : Expert - Change between Normal and Expert. Y : Yapp - Transfer binary files with the Yapp transfer protocol. Z : Delete - Delete a file. + : Append - Only for sysops: Append a file after a message. > : Send text - To send a text to another station connected to the BBS. = : Connect - To connect another station connected to the BBS. ! : Info - Short version of the I command. $$ : Forwarded - Only for sysop: Show which BBSs will receive, or already have received a message. * : Wildcard - Many possibilities, like @,?,#,=,* For detailed help on each command, type ? [command]. ######################################################################### # WP-info new in 5.15 @@ 14 I|IH|IQ|IN|IL|IZ|I@|INFO I - command gives you information about this BBS. For White Pages: I (call) - Gives WP info on this callsign. ID - Gives number of records in WP. IH zone - Look for users in zone (EU, NOR etc). IN (string) - Gives WP records with 'string' in name. IQ (string) - Gives WP records with 'string' in QTH. IZ (zip) - Look for users with specific zipcode. I@ (bbs) - Look for users of that BBS. In most WP commands, 'wildcards' are allowed. ######################################################################### @@ 14 J|JA|JB|J1|J2|JK J-command sends you a list of the last connected stations. - Type JK to see the last connected stations. - Type JA to see callsigns that have connected to TNC A. - Type J1 to see callsigns that have been MONITORED on TNC A. - Type JB to see callsigns that have connected to TNC B. - Type J2 to see callsigns that have been MONITORED on TNC B. and so on... @@ 14 K|KILL|KM|KK K-command is for killing messages TO or FROM you. - Type K[space][message#] to delete one paticular message. - Type KM to delete all messages to you, that you have read [Kill Mine]. This command will NOT kill messages that you have not read! PS : You cannot delete messages that are not TO you or FROM you, only the SYSOP can do that.. SYSOP: In front of K commands, you can put an extra K, like KKM, KKF etc. In that manner the messages will get A status (normally K) at once. @@ 14 L|LIST|LB|LM|LN|LL|LS|L<|L>|L@|LU|LR|LC|LD>|LD<|LA|LF|LK|LP|LX L command LISTS all messages in the mailbox. L lists all new messages since you last issued a L command. LA lists messages with A status LB lists only bulletins. LC for very special listings. See further down... LD< YYMMDD list all messages received before the specified date. LD> YYMMDD list all messages received after the specified date. LE lists messages that could not be forwarded. LF lists messages that have been forwarded. LH lists held messages. LK lists all killed messages LM lists all messages TO YOU [List Mine]. LN lists all UNREAD messages to you [List New]. LL 10 lists the last 10 messages in the mailbox [List Last]. LP list personal messages. LS [Text] lists messages with [text] in the subject. LT lists NTS Traffic messages LX lists messages with status X. LY lists messages that have been read (status Y) L< [callsign] lists messages FROM [callsign]. L> [callsign] lists messages TO [callsign]. L$ lists bulletins with status $ L@ lists local bulletins with no @BBS-field. L@ [callsign] lists messages @[callsign]. L [message#]- lists ONLY messages with higher number than [messages#]. L [message#]-[message#] lists all messages between these numbers. LU lists all UNREAD messages (status N) to and from you. LR lists messages in revers order, starting with the oldest one. LR can replace L in most contexts (ex: LR 1-100) Examples: - To list messages over #325, type L 325- - To list messages from #300 to #350, type L 300-350 PS: Check number of active messages before doing a list command, to avoid listing every messages in the system. This is easy to check with the V-command. Special command LC: With this command you can have very special listings. If you once type LC DX, then all list command (except LM and LN) will only list messages with a TO field of DX. If you type LC *DX*, listings will contain all 'To' fields that have DX in it, for example VHFDX, DXHF etc. To go back to 'normal', send LC * LC ? or LC ; gives a list of available LC fileds. @@ 14 M|MH|MV|MA|MVA|MHA M [number] [name] : Copy a message to file. MH [number] [name] : Same, but in same format as R (msg#). MV [number] [name] : Same, but in same format as V (msg#). These commands will overwrite old messages. MA [number] [name] : Copy a message to file. MHA [number] [name]: Same, but in same format as R (msg#). MVA [number] [name]: Same, but in same format as V (msg#). These commands do NOT overwrite old messages, but append the next text to the old file. Only for sysops; M can be used instead of L. The listing then will have the BID included in the subject. @@ 14 N|NAME N command is used to enter (or later change) your name in the BBS. You can use max 12 characters. 'Phoney' names will be deleted, use your own first name. - Type N[space][first-name] See also help with NP, NL, NQ, NZ, NH. @@ 14 NH|HOMEBBS Use this command to state your home BBS. @@ 14 NP This command is for changing your password for access to the modem port. ######################################################################## # Changed in 5.15 from NQ to NL. New NQ is city. @@ 14 NL Use this command to enter (or change) your QTH locator. @@ 14 NQ Use this command to enter (or change) your city. ######################################################################## @@ 14 NEWDOC NEWDOC is a server for entering new information/documentation in the DOCS server. To enter a file here, send a personal message like this: ############################################################################# # New in 5.15: NEWDOC can now also make new directories. ############################################################################# SP NEWDOC @ (bbs) The subject must hold 2 things: First it must contain the filename, complete with path (if needed), followed by a label that describes the file. Example: BBS.DOC Documentation for this BBS. The message will then become the file. After you have sent such a message using NEWDOC, the BBS will send you a message to confirm that the file was successfully saved under DOCS. Sysop can change the label with command L in DOCS server. @@ 14 NZ|ZIP Use this command to state your ZIP code. @@ 14 O|OP|OR|OL|ON O command gives you different options: O alone shows you what language you are using, paging and base number. - Type OP to toggle paging on messages. - Type OP [number-of-lines] to select paging with a specific number of lines per page. - Type OL alone to get a list of available languages. - Type OL[space][language-number] to choose a language. - Type ON alone to see your base number. - Type ON [number] to choose a new base-number. The number you type, will be multiplied by 1000, so if you type ON 54, your base number will be 54000. After that, you can type R 25 to read message number 54025. It is also allowed to type ON 54000. - Type OR to choose if you want to be able to list and read all personal messages in the BBS (if your BBS allows this...). - Type OM to choose if you want to receive the list of new messages at every connect. @@ 14 P|PR Only for sysops: Use PR to toggle printer on/off. @@ 14 PS Use this command (PS) to see which servers are available in this BBS. @@ 14 PG Send command PG to list available DOS programs. Run one DOS program with command PG (program name) (parameter) @@ 14 R|RM|RN|RU|R>|R< R-command is for reading messages (not files). - Type R[space][message#] to read one message. You can chain several message#, seperated by a space. - Type RM to read ALL messages adressed to you [Read Mine]. - Type RN to read all NEW messages to you [Read New]. - Type RU to read all UNREAD messages (status N) to or from you. - Type R< to read messages from a certain callsign. - Type R> to read messages to a certain callsign. ############################################################################# # New in 5.15 - When you read many different messages after each other (with paging), you can now send N to skip directly to next page, C to continue without paging, or A for Abort or ENTER to continue with next page. ############################################################################## @@ 14 REQCFG REQCFG lets you 'order' a file from another BBS, showing the configuration of that BBS. If you want to order the file from LA1B BBS, and your HomeBBS is F6FBB, you send a message like this: SP REQCFG @ LA1B As subject you type an @-sign and your HomeBBS. Like this: @ F6FBB (if F6FBB is your HomeBBS). The message can be empty, a CTRL-Z or /EX is enough. After some time, when the message has had time to be forwarded to LA1B BBS, you will receive a message here at this BBS containing the requested file. Beware: Not all BBS types support REQCFG. FBB does... @@ 14 REQDIR REQDIR lets you 'order' a list of available files from another BBS. Then, later, you can "order" one of those files with REQFIL. Type ? REQFIL for more info on the REQFIL server. If you want to see which files are in the root directory of LA1B BBS, and your own BBS if F6FBB, you send a message like this: SP REQDIR @ LA1B As subject you write *.* @ F6FBB (if F6FBB is your home BBS) The message can be empty, a CTRL-Z or /EX is enough. After some time, when the message has had time to be forwarded to LA1B BBS, you will receive a message here in this BBS containing a list of files available in the root directory of LA1B BBS. If you want to look in one subdirectory ( ), you can do this in a similar way. Example: If you want to look in the LOKALT-directory at LA1B, you send a message like this: SP REQDIR @ LA1B As subject you type LOKALT/*.* @ F6FBB (if F6FBB is your HomeBBS). Beware: Not all BBS types support REQDIR. FBB and MBL type BBSs do... @@ 14 REQFIL REQFIL lets you 'order' a file from another BBS. Only ASCII files can be ordered, binary files cannot be sent to you with REQFIL. A list of available files can be obtained using the REQDIR server. If you want to order a file from the root directory of LA1B BBS, and your HomeBBS is F6FBB, you send a message like this: SP REQFIL @ LA1B As subject you type the name of the requested file, followed by a @-sign and your HomeBBS. Like this: NORSK.MAN @ F6FBB (if F6FBB is your home-BBS). The message can be empty, a CTRL-Z or /EX is enough. After some time, when the message has had time to be forwarded to LA1B BBS, you will receive a message here in this BBS containing the requested file. If you want to order a file from a subdirectory, ( ), you do this is in a similar way. Example: If you want to order the file TEST.TST in subdir called LOKALT, you type: SP REQFIL @ LA1B As subject you type: LOKALT/TEST.TST @ F6FBB (if F6FBB is your HomeBBS) Beware: Not all BBS types support REQFIL. FBB and MBL type BBSs do... @@ 14 S|SB|SR|SC|SP|SC S command lets you send messages. - Type S[type][space][callsign] to send a message. Type can be P for Personal or B for Bulletin. - Type S[type][space][callsign] @ [callsign] to send a message to a station at another BBS. - Type SB ALL to send a bulletin to ALL. - Type SR[space][messages#] to reply to a paticular message. (Send Reply). - Type SC[space][messages#][space][callsign] to send a copy of a message to another callsign. (Send Copy). You can write a message before sending the CTRL-Z, then the copy will be appended to your text. If you don't want to do this, just send CTRL-Z instead of any text. @@ 14 SYS Only for sysops. Use the SYS command to become a remote sysops. ############################################################################# # New in 5.15: Sysop can send ! (password) directly. Careful....! ############################################################################## @@ 14 SYSOP These commands are available for sysop (local and remote): DOS : SYSOP can now run DOS programs from remote. Read the help for this under FBBDOS with command ? DOS. DU [callsign] : Show info on that callsign. DB : List all callsigns defined as BBS. DE : List all excluded callsigns. DL : List all Local users. DM : List all users with modem access. DS : List all sysops. DX : List all 'expert' users. DP : List all users that have paging on. E [msg#] : Edit a message #. EU [callsign] : Edit one user. A '.' deletes a field. FA [msg#] [BBS] : Mark message# for forward to a BBS. FB (BBS) : List messages that will be forwarded to a BBS. The messages are listed as with a standard L command with BIDs (M command). FC (BBS) : Shows the route a message from me to a BBS will take. If I send FC LA2D, and the BBS respond with LA8D, it means that messages from me to @LA2D, will be sent via LA8D. FD [msg#] [BBS] : Remove message# from forward to BBS. ############################################################################# # New in 5.15b: FG : Shows partly-received messages (forward resume). ############################################################################# ############################################################################# # New in 5.15: FH (BBS) : Show H route to that BBS. FI (BID) : Gives information on one BID. FI (BID) + : Add a BID to the list. FI (BID) - : Remove a BID from the list. ############################################################################ FL (BBS) : List messages that will be forwarded to BBS. ############################################################################# # New in 5.15: FP < (call) : Show if from-call is changed (SWAPP.SYS). FP > (call) : Show if to-call is changed (SWAPP.SYS). FP @ (route) : Show if routing is changed (SWAPP.SYS). ############################################################################# FT [BBS] : List size of messages ready for forward to BBS. Shows number of personal messages and bulletins, and also the total size in kilobytes. In real time. FT : FT alone shows the same as above, but for ALL BBSs that there pending forwards to. In real time. FU [number] : To disconnect a user from a channel. Channel-number must be used, not callsign. FV : Start forward scan. FN [messsage#] : List BBSs waiting for a message. FW [argument] : Start forward to BBS (callsign) or port. FW 9 starts forward out on all ports. FW LA1B starts forward to LA1B. FS [argument] : Stop forward. Argument; look under FW. FR [argument] : Start revers forward. Argument; look under FW. HO [msg#] : Hold messages, give them H-status. ############################################################################## # new in 5.15 IL (call) : (WP) Gives full information on user, both primary and secondary info. IE (call) : (WP) To edit a users data in WP. ############################################################################## $$ [message#] : Same as FN. K [message#] : From version 5.10i sysop can also kill UNREAD messages. KF : Kill all messages that have been forwarded. KK [message#] : Kill message. Goes directly to status A, and is deleted with next EPURMESS. K> [callsign] K< [callsign] : SYSOP can kill messages to or from a callsign. K@ [BBS] : Kill all messages to this @BBS route. LABEL (filename) : To change the description of a file in FBBDOS. N (callsign) : To change a user's data in USER DATA. NB: All K commands can be preceded by an extra K. Messages will then go directly to A status (not K). Example: KKM LU : List all UNREAD messages (status N) in the BBS. M (replace L) : Can be used by sysop to replace L, like: ML for LL, M 100- for L 100- etc. All listings will then have the BID in the subject-field. M [msg#] [file] : Copy a message to a file. Overwrites existing file. MH [msg#] [file] : Like M, but with same format as R [msg#]. Overwrites. MV [msg#] [file] : Like M, but with same format as V [msg#]. Overwrites. MA [msg#] [file] : Copy a message to a file. Appends to existing file. MHA [msg#] [file] : Like M, but with same format as R [msg#]. Appends. MVA [msg#] [file] : Like M, but with same format as V [msg#]. Appends. PR : Toggle printer on/off. CAREFUL when doing this remote ############################################################################## # New in 5.15: PR (msg#) (msg#) : Print messages on printer. PRV (msg#) (msg#) : Print messages (verbose format) on printer. PR> (filename) : Redirect printer to file. PR> - : Cancel redirect of printer. ############################################################################## N (call) : To change user data under DATA OM (INF.SYS). RE : REview messages with status Hold. RU : Read all UNREAD messages in the BBS. SYS : Send this command to become remote sysop. S [filename] : Send an ASCII file in GATEWAY mode. Must go to command mode first (by pressing ESC). ############################################################################## # New in 5.15: SR with filename : Sysop can now include filname in SR message. Format: SR (number) (+filename) (title) ############################################################################## W (filename) : To be used under GATEWAY to capture text in a file. You must first change to Cmd: mode. End capture with W. YL [filename] : Change the label of a YAPP file. YZ [filename] : Delete a YAPP file. YU [filename] : Send a binary file in GATEWAY mode. Must go to command mode first (by pressing ESC). YD [filename] : Receive a binary file in GATEWAY mode. Must go to command- mode first (by pressing ESC). % : Show status for all channels right now. /A : Stops the BBS program ############################################################################## # New in 5.15b: /K : Reboot BBS, including 'house-keeping'. /L : Reboot BBS, wait until all have disconnected. /M : Reboot BBS, immediately. ############################################################################## /R : Reboot PC. @@ 14 T|TALK T command calls the BBS System Operator (SysOp). If SysOp IS available to chat, you'll get a response within ONE MINUTE. Otherwise, the BBS will advise you that SysOp did not answer. You will be returned to the command prompt and can continue normally. @@ 14 TH Gives access to the themes zone. Lists messages by themes, as setup in the file THEMES.SYS. Available commands in this zone, are H (list themes) L (list messages in current theme) R msg# (read message in current theme) number (change to theme#) @@ 14 U|UPLOAD U command can be used to upload an ASCII-file to the 'root' directory of the FBBDOS. - Type U [filename] to send the ASCII-file. You can also use U command to upload a file to a subdirectory of FBBDOS, like this: U VHF/TEST.RES @@ 14 V|VERSION|VERBOSE|VM|VN The V command shows you the specific version of this PBBS, the date of the software release and the copyright notice. This also shows the number of active messages and the next message number. - Type V to see this PBBS's software version. The V-command also lets you READ MESSAGES with a verbose listing, which includes the message routing. Use like R-commands. - Type V[space][message#] to READ a specific message. You may have several message numbers per line. - Type VM to READ ALL messages addressed to YOU [Read Mine]. - Type VN to READ ALL NEW messages addressed to YOU [Read New]. - To READ msgs #313 and #325 type 'V 313 325'. Don't forget SPACE. ############################################################################## # New in 5.15 - When you read many different messages after each other (with paging), you can now send N to skip directly to next page, C to continue without paging, or A for Abort or ENTER to continue with next page. ############################################################################## @@ 14 W Use the W command (alone) to get a list of files in the users root-directory. Use the W command with path to see what is in the sub-directories, like this: W LOCAL (see what is in the LOCAL subdirectory) ############################################################################# # New in 5.15 @@ 14 WP Check help on WP commands with the command ? I Ask for WP info from another WP-server by sending a message like this: SP WP @ LA1B WP query (Any title...) F6FBB ? (send info on F6FBB) LA6CU ? (Send info on LA6CU) Terminate by /EX ############################################################################# @@ 14 WILDCARDS|@|?|#|=|* The following "wildcards" are allowed: '@' replace one letter '?' replace one alfanumeric character (A-Z, a-z and 0-9) '#' replace one digit '=' replace any character, except space '*' replace any string of characters ############################################################################## # New in 5.15 '&' look for a period (.), or the end of the string. Ex: *.FRA& will match xxxxx.FRA and xxxxx.FRA.xxxxx, but not xxxxx.FRANCA or xxxxx.FRANCA.xxxxxx ############################################################################## @@ 14 X|EXPERT The X-command toggles your status between 'normal' and 'eXpert' user. 'Normal' mode gives you complete prompts and standard messages. 'eXpert' mode gives you a very short command line and nothing else. - Type X to toggle your status between 'normal' and 'eXpert'. @@ 14 Y|YAPP|YW|YI|YN|YU|YD|YZ The Y command calls YAPP protocol for binary file transfer. Your software must use YAPP protocol to transfer binary files. - Type YW to list directory of binary files. - Type YI to list directory with labels. - Type YN to list directory of new binary files since your last logon. - Type YU [filename] to send a file TO the BBS. You can't replace an existing file. - Type YD [filename] to receive a file FROM the BBS. - Type YZ [filename] to delete a file from the BBS. @@ 14 Z Use the Z command to for delete files in the BBS from BBS mode. Type Z [filname] to delete the file. @@ 14 +|APPEND - Only for sysops. Use this to append a file after the message, like this: SP [call] @ [bbs] + [filename and path] Example: SP LA6CU @ LA1B + c:\lokalt\lokal.inf Here the file LOKAL.INF vil be appended behind the message when you type CTRL-Z. @@ 14 > - Send > [callsign] [text] to send a text to another station that also is connected to the BBS. Get an overview of connected stations with the !-command. This command is not allowed in read-only mode. @@ 14 = - Send = [callsign] to connect to another station that also is connected to the BBS. Get an overview of connected stations with the ! command. This command is not allowed in read-only mode. @@ 14 ! - This command is similar to the I command, but in a shorter form. @@ 14 $$ Only for sysops: $$ [message#] gives a list of all BBSs that the message has been forwarded to, or is waiting to be forwarded to. @@ 14 % Use this command to see the status of all channels in the BBS right now. ############################################################################# # GATEWAY is 16 # ############################################################################# @@ 16 H Gateway commands: C : Connect. D : Disconnect. F : Frequency selection (on PACTOR mode) H : Help (this text). J : List of the last 20 monitored stations. K : Converse mode. M : Monitor on/off. Monitor the port. P : Go directly from one port to another. i.e. Send P1 to go from current port to port 1. Q : Return to BBS mode. CQ : CQ command (bare for PACTOR !). > or ESC to go back to Cmd: mode. First, you get an available port. If a link is not busy, it will be assigned and take your callsign. The mode will automatically change to converse when connecting your correspondent. The K command also changes to converse mode. You will return to command mode when disconnecting, or with Esc or > followed by a . The C command must be followed by a callsign, and if necessary by the V and a list of repeaters. C callsign V digi1 digi2 ... Monitor the port with the M command @@ 16 B|Q Send Q to return to BBS mode. If you are connected to a station via the gateway, the other station will be disconnected. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 C Send C (callsign) to connect to a station via the gateway. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 D Send D to disconnect a station via the gateway. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 F Send F (only for PACTOR) to get a list of available frequencies. Set the frequency by sending the number that precedes the frequency. @@ 16 J Send J to list the last 20 monitored stations. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 K Send K to enter CONVERS mode. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 M Send M to toggle monitoring via gateway on/off. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 P Send P (port number) to go directly from one port to another. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) @@ 16 > Send > (or press ESC) and press ENTER to go to Cmd: mode. (All commands in gateway mode must be sent in Cmd: mode. Enter Cmd: mode by sending a > (or press ESC) and press ENTER.) fbb-7.0.10/etc/lang/francais.txt0000644000175000017500000003467713613360505013317 00000000000000############################## # Textes francais (V1.1) # # Pour F6FBB BBS (V5.15b) # # # # Version non accentuee # # adaptee de G7EVY @ GB7EVY # # par F6FBB @ F6FBB # ############################## # ############################################################## # NOTA: # # ~~~~~ # # La longueur des lignes ne doit pas depasser 255 caracteres # # L'ordre des lignes ne doit pas etre modifie # # Seules des lignes commentaires (commancant par un '#' # # peuvent etre ajoutees ou enlevees # # # ############################################################## # # # LANGUAGE, REPONSES, FORMATS (DATE, POINTS CARDINAUX) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Francais OL: Le langage selectionne est : Francais$W Oui Non DimLunMarMerJeuVenSam JanFevMarAvrMaiJuiJulAouSepOctNovDec Nord Sud Est Ouest # # T_MES (MESSAGES DE BIENVENUE) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # BBS, EXPERT, NON-EXPERT # OK $I - %l Msg(s) - %k KB$W $WBonjour $I.$W $WBonjour $I, Bienvenue a $c.$WTapez ? pour avoir de l'aide.$W # # INFOS NOM, QTH, HOME-BBS, CODE-POSTAL # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # $WSVP entrez votre prenom : N (prenom). $WSVP entrez votre QTH : NQ (ville). $WSVP entrez votre BBS habituelle : NH (Home-BBS). $WSVP entrez votre code postal : NZ (code postal).$W$W # # MESSAGE POUR LES INVITES # ~~~~~~~~~~~~~~~~~~~~~~~~ # Vous avez un acces limite sur ce port.$W$W$=:$O>$W # # RESPONSE TO NON-BBS ON "BBS ONLY" PORT # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #Desole, acces reserve aux BBS sur ce port.$W Desole, La messagerie F6FBB est arretee.$W # # MESSAGES DE CONNEXION # ~~~~~~~~~~~~~~~~~~~~~ # $WC'est votre premiere connexion sur cette messagerie.$W$O est situe a $c, $?.$WVous avez $0 message(s) nouveau(x).$W $WIl y a $0 message(s) nouveau(x). RN pour le(s) lire.$W $WIl y a $0 message(s) que vous avez lu(s) mais pas supprime(s).$W Vous etes reste connecte $: - Temps CPU : $.$W73 de $O.$W # # REPONSE A LA COMMANDE ! # ~~~~~~~~~~~~~~~~~~~~~~~ # $WBBS et Serveur par F6FBB V$E$W$Wcanaux:$W$% $W$N messages actifs - Dernier message $L - Dernier message liste $Z.$WMessages nouveaux pour:$W$Q$W$WVotre selection de message est $l.$WTemps de connexion : $: - Temps CPU : $.$W # # T_QST (QUESTIONS ET REPONSES STANDARDS) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Continue rret ontinue sans pagination Message suivant ..> Modification (O/N) ? Merci!$W $WAbandon!$W Creation (O/N) ? $WVotre choix (L=Liste, F=Fin) : Continue rret Lire Message # ..> # # T_ERR (MESSAGES D'ERREUR) # ~~~~~~~~~~~~~~~~~~~~~~~~~ # *** Erreur : Reponse erronnee.$W *** Erreur : La commande $0 est incorrecte, $I.$W *** Erreur : Il manque un espace ou un caractere apres la commande, $I.$W *** Erreur : Seule une reponse numerique est autorisee, $I.$W *** Erreur : Il manque le texte apres l'indicatif, $I.$W *** Desole : Il n'y a pas d'aide disponible pour $0.$W *** Erreur : Il manque l'indicatif de l'autre station, $I.$W *** Erreur : Il manque l'indicatif $I.$W *** Erreur : Il n'y a pas de fichier de ce nom, $I.$W *** Erreur : Le caractere $0 n'est pas interprete, $I.$W *** Erreur : Le message #%M n'existe pas, $I.$W *** Erreur : Le fichier $f n'existe pas, $I.$W *** Erreur : Vous ne pouvez pas supprimer le message #%M, $I.$W *** Erreur : #%M n'existe pas, $I.$W *** Erreur : Ce port n'est pas valide, $I.$W *** Erreur : Utilisez la commande CD, $I.$W *** Erreur : Le champ $0 est trop long.$W *** Erreur : L'adresse $0 est erronnee.$W *** Desole, vous avez deja transfere %d KB.$W *** Desole : Pas trouve!$W *** Erreur : Il manque le nom de fichier.$W *** Erreur : Il manque le fichier destination.$W *** Erreur : Cette langue est inconnue, $I.$W *** Erreur : Impossible de modifier $f.$W *** Erreur : Le repertoire "$0" n'existe pas, ou n'est pas vide.$W *** Erreur : Il manque le repertoire, $I.$W *** Erreur : Impossible de creer le repertoire "$0".$W *** Erreur : Il manque le chemin d'acces, $I.$W *** Erreur : Le chemin d'acces est trop long, $I.$W *** Erreur : Ce chemin d'acces n'existe pas, $I.$W *** Erreur : Impossible de creer le fichier $f, desole $I.$W *** Depassement temps!$W # # T_MBL (MESSAGERIE) # ~~~~~~~~~~~~~~~~~~ # # EXPERT, GUEST, NON-EXPERT PROMPTS # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $W$*:$O>$W $W$*:$O (B,KM,LM,O,RM,S,T,?) >$W $W$*:$O (A,B,C,D,F,G,I,J,K,L,M,N,O,P,R,S,T,U,V,W,X,Y,Z,?) >$W # # TEXTES GENERAUX #1 # ~~~~~~~~~~~~~~~~~~ # Il n'y a pas de message.$W Il n'y a pas de message nouveau.$W Entrez le sujet: Entrez le message, (Fin avec /EX ou Ctrl-Z):$W Le message #%M a ete supprime.$W # # REPONSE A LA COMMANDE V # ~~~~~~~~~~~~~~~~~~~~~~~ Logiciel F6FBB (V$E). $N messages actifs - Dernier message #$L.$W # # TEXTES GENERAUX #2 # ~~~~~~~~~~~~~~~~~~ Entrez votre prenom : Merci $I.$W Indicatif Dern-Connex #Cnx RPBSXLFEMUI Nom Password PRIV.$W $V n'est pas disponible, mais vous pouvez lui laisser un message.$W Attendez $I, j'appelle $V.$W $V n'est pas la mais vous pouvez lui laisser un message.$W $I, $V est au clavier:$W $W$I, $V voudrait vous parler.$W Vous etes maintenant en mode Expert.$W Vous etes maintenant en mode Normal.$W Vous etes en mode Serveur. Tapez F pour revenir en mode BBS.$W Le fichier $f a ete copie.$W Le message pour %G a ete annule (erreur d'adresse ou pas de titre).$W OP: Pagination programmee a : Devalidee$W OP: Pagination programmee a : $p lignes$W L'utilisateur est connecte, l'edition est impossible.$W $0 $1 $2 $3 $j $K = $4'$5 ON: Base Message programmee a : $0$W (B)id, (F)=Exp, (V)ia, (T)=Dest, T(I)tre, (S)tatus, T(Y)pe, (CR) fin >$W $W(R)=Ts msg, (P)agination, (B)BS, (S)ysop, e(X)pert, (L)ocal, (E)xclus, (M)odem,$W(U)=Unpro Msg, lan(G)ue, (N)om, pass(W)ord, pri(V), (H)omeBBS, (Z)=Code-postal,$W(CR)=fin >$W L'indicatif $0 est inconnu, creation (O/N) ? $WSupression de $0 O/[N] ? Langues disponibles:$W ($0):$1 $W ========== Fin du message #%M ==========$W$W # # REPONSE AUX COMMANDES $ (MESSAGE-#) OU FN (MESSAGE-#) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Message #$0$W # # HEADER DE MESSAGE # ~~~~~~~~~~~~~~~~~ # $WExpediteur : %P$WDestinataire: %G$0$WType/status : $t$s$WDate/heure : $j $K$WBid : $R$WNb lectures : %C$W # # HEADER DE LISTES # ~~~~~~~~~~~~~~~~ # #$WSelection des messages - [$l]$WMsg # TSL Dim Pour @ BBS Exped Date/Heure Sujet$W====== === ==== ===== ======= ====== ====/==== =======$W Msg # TSD Dim Pour @ BBS Exped Date/Heur Sujet Selection = [$l]$W # # CONTENU DES LIGNES DE LISTES # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $M $t$s%r $n $G$0 $P $i $1$W # Message # : %M$WTitre : $S$W Bid (Mid) : $R$W$W Routage vers $0-Routage via $v$W # # PROMPTS DU REVERSE FORWARDING, ET DU FORWARDING STANDARD # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ F>$W >$W # # MESSAGES DU FORWARDING # ~~~~~~~~~~~~~~~~~~~~~~ NO - Wrong parameter.$W NO - BID$W OK $W *** Done$W # Taille: %n$W Pas de routage programme vers %A. Je previens le sysop.$W La reponse sera adressee a %G@$v.$W OR: Acces a tous les messages : $0$W OM: Messages nouveaux a la connexion : $0$W Entrez votre BBS habituelle: Entrez votre code postal : HomeBBS: $0 Code postal : $1$W Attention! Pas de WP-Routage connu pour %G$W $W$0 message(s) retenu(s)$W $W(A)rchive,(K)=Supp,(L)ocal,(Q)uitte,(R,V)=Lit,(U)=Valide, (CR) fin >$W Message retenu pour validation par le Sysop.$W # # T_TRT # ~~~~~ # *** Occupe - Patientez SVP.$W *** Occupe - Connexion impossible.$W *** $0 n'est pas connecte.$W $W$B*** Connecte a $0 (Fin avec Ctrl-Z).$W *** Deconnecte.$W *** "Break" de $0 ***$W *** Fin du "break" ***$W "Break" pour $0 envoye.$W Demande d'arret de $0. Code: $1$W Demande d'arret acceptee, connexions interdites.$W Demande de reset acceptee, re-initialisation en cours.$W ################ Modifie pour 5.16 ######################### Continue rret ..> Demande d'arret rejetee.$W Vous etes en mode BBS. Tapez F pour revenir en mode Serveur.$W # # T_MEN (MENU SERVEUR) # ~~~~~~~~~~~~~~~~~~~~ # $WSERVEUR (C,D,N,Q,T,F,B,?) > $W $W(C) Connexions-Stat.$W(D) Documentations$W(Q) Qra-Locator$W(N) Nomenclature$W(T) Trajecto. Satellites$W(F) Retour en mode BBS$W(B) Deconnexion$W$WSERVEUR (C,D,N,Q,T,F,B,?) > # # T_STA (MODULE STATISTIQUES) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # $WCONNEXIONS-STAT. (G,H,I,J,L,O,F,B,?) > $W $W(G) Generalites$W(H) Utilisation horaire$W(I) Liste des indicatifs$W(J) Utilisation par jours$W(L) Details$W(O) Pourcentages$W(F) Retour au serveur$W(B) Deconnexion$W$WCONNECTIONS-STAT. (G,H,I,J,L,O,F,B,?) > Utilisation par jour$W LUN MAR MER JEU VEN SAM DIM$W Utilisation par heure$W 0 0 0 0 0 1 1 1 1 1 2 2 Heure$W 0 2 4 6 8 0 2 4 6 8 0 2$W $N messages actifs$W $0 Connexions depuis $j$W Connexions$W Temps moyen par connexion : $0min $1s$W Nombre de conexions / jour : $0$W Heures de pointe : A $1:00h et $0:00h.$W Utilisation (en pourcentage)$W BBS : $0 %%$W Serveur : $0 %%$W Details serveur :$W DOS : $0 %%$W Qra-Locator : $0 %%$W Docs : $0 %%$W Connexions-stat : $0 %%$W Nomenclature : $0 %%$W Satellites : $0 %%$W $0 $1 $2 $3 $j $K = $4'$5"$W # # T_NOM (MODULE NOMENCLATURE) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # $WNOMENCLATURE (I,N,R,F,B,?) > $W $W(R)echerche$W(I)ndicatifs$W(N)om et adresse$W(F) Retour au serveur$W(B) Deconnexion$W$WNOMENCLATURE (I,N,R,F,B,?) > $WIndicatif: $0$W $WDerniere connexion le $j a $K.$W Nom, prenom : $1 $0$WAdresse : $2, $3$WLocator : $4$WTel. Perso : $5$WTel. Modem : $6$WHome-BBS : $7$W Nom : Numero, rue : Ville : Telephone, perso : Telephone, modem : Qra-locator : $WTotal $0 indicatifs$W *** Indicatif $0 inconnu.$W *** Erreur Qra-locator (format : deux lettres, deux chiffres, deux lettres).$W # # T_TRJ (MODULE SATELLITE) # ~~~~~~~~~~~~~~~~~~~~~~~~ # $WSATELLITES (C,P,T,F,B,?) > $W(M) Mise a jour$W $W(C) Description$W(P) Parametres orbitaux$W(T) Calcul de trajectographie$W(F) Retour au serveur$W(B) Deconnexion$W$WSATELLITES (C,P,T,F,B,?) > $WQRA-Locator : $0 Satellite $1$W --------------------------------------------------------------$W | Heure | Az. | El. | Dpl. | Dist. | Alti. | Lon | Lat | Ph. |$W | UTC | Deg | Deg | KHz | Km | Km | Deg | Deg | 256 |$W --------------- $j-$y ----- Orbite #$0 ----------------$W | $0:$1 | $2 | $3 | $4 | $5 | $6 | $7 | $8 | $9 |$W Date de debut de clacul (DD/MM/YY) (Return = defaut) : Heure de debut de calcul (HH:MM) (Return = defaut) : $WPatientez SVP...$W $WPas d'information sur ce satellite.$W # Derniere mise a jour $j-$y.$W Nom du satellite : Orbite de reference : Annee de reference : Jour de reference : Anomalie moyenne : Arg. de perigee : R.A.A.N. : Inclinaison : Excentricite : Mouvement moyen : Derivee du mvt moyen: Pas de calcul (mn) : Frequence emission : $WParametres orbitaux de $0$W Numero d'orbite : $0$W Annee : $0$W Jour : $0$W Anomalie moyenne : $0$W Arg. de perigee : $0$W R.A.A.N. : $0$W Inclinaison : $0$W Excentricite : $0$W Mouvement moyen : $0$W Derivee du mvt moyen: $0$W Pas de calcul : $0$W$W ($0) $1 (F) Fin$W # # T_QTH (MODULE QRA LOCATOR) # ~~~~~~~~~~~~~~~~~~~~~~~~~~ # $WQRA-LOCATOR (C,D,L,Q,F,B,?) > $W $W(Q) Qra -> Long/Lat$W(L) Long/Lat -> Qra$W(D) Dist. et Azimuth$W(C) Distances$W(F) Retour au serveur$W(B) Deconnexion$W$WQRA-LOCATOR (C,D,L,Q,F,B,?) > $WEntrez votre Qra Locator SVP (Q to Quit) :$W Coordonnees geographiques au centre du carre :$W Longitude : $0 degres $1' $2 : $3 grades $2$W Latitude : $0 degres $1' $2 : $3 grades $2$W $WUtilisez le format$WEn degres = 1:45:00 [direction].$WEn grades = 1.5 [direction]$W[direction] sera remplace by Nord, Sud, Est ou Ouest.$W $WLongitude (Est/Ouest) : $WLatitude (Nord/Sud) : $WQra Locator : $0$W $WQra Locator origine : Qra Locator destination : Azimuth : $0 degres $1' : $2 grades$W Distance : $0 Km$W $WVotre Qra Locator : $WQra Locator destination (F = Fin) : Nombre de calculs $0 - Total des distances : $1 Km$W Calcul termine.$W # # T_DOS (MODULE DOS) # ~~~~~~~~~~~~~~~~~~ # $W[%dKB] $u:$0> Repertoire $0 supprime.$W Pas de fichier.$W $0 $1 $2 $3 $4 $5 $6 $7$W Envoi du fichie $f interrompu.$W Le fichier $f de $0 octets a ete transfere ($1 octets/s).$W Envoyez le fichier $f (Fin = Ctrl-Z).$W $0 octets copies.$W $W$j $T FBBDOS V$E$W $WCommandes disponibles :$W Le fichier $f a ete supprime.$W $W$0 octets libres. # # T_INF (MODULE DOCUMENTATION) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # $WDOCS$0 (#,L,R,F,B,?) > $W(D) Description.$W $W(numero) Lire la doc (numero)$W(L) Liste$W(R) Retour au niveau precedent$W(F) Retour au serveur$W(B) Deconnexion$WDOCS$0 (#,L,F,R,B,?) > Cette entree n'existe pas.$W # # T_GATE (GATEWAY MODULE) # ~~~~~~~~~~~~~~~~~~~~~~~ Vous etes sur le canal $=, port $!. $g port(s) disponible(s).$WAcces au LINUX-FpacNode F6FBB-10 sur port NETWORK$WH = Aide. Q = Quitte.$W Entrez le numero de port (Q = Quitte) : Vous utilisez le canal $0 du port : $1.$W Desole, pas de canal disponible sur ce port.$W Cmd : Mode conversation. Esc ou >(return) pour revenir en mode commande.$W *** Erreur : Vous etes deja sur ce port!$W *** Erreur : Port invalide.$W *** Le gateway n'est pas disponible, $I.$W $O: Commande $0 invalide. (C,D,J,K,H,M,P,Q,?) >$W Envoi de $f...$W Capture du texte dans le fichier $f.$W Capture du texte terminee.$W # # T_YAP (MODULE YAPP) # ~~~~~~~~~~~~~~~~~~~ # Envoie le(s) fichier(s) $f avec le protocole $0.$W Pret a recevoir le fichier $f avec le protocole $0.$W Desole, $0 n'est pas autorise sur ce port.$W Description du fichier, max 40 caracteres : $0 $1 $2 $3 $4$W # # T_CNF (MODULE CONFERENCE) # ~~~~~~~~~~~~~~~~~~~~~~~~~ # Vous entrez dans la conference (Aide = ".?").$W Il est $H. Stations dans la conference :$W Indicatif : $0, canal $1.$W $H $0 entre dans la conference.$W Vous quittez la conference.$W $H $0 a quitte la conference.$W $W[$H - $0]$W Il n'y a personne dans la conference.$W $H $0 : Trop de repetitions.$W $H $0 : Occupe.$W $H $0 n'est pas dans la conference!$W # # **Fin du fichier** # (Ouf!) # # T_THE (MODULE THEMES) # ~~~~~~~~~~~~~~~~~~~~~~~~~ # Msg # Dim Pour Exped Sujet (Theme:%T)$W $M $n $G $P $1$W %T - %t bulls (B,F,H,L,R,Numero) : # # fbb-7.0.10/etc/lang/francais.inf0000644000175000017500000000141113613360505013230 00000000000000 BBS F6FBB-1 - $? - Roquettes (15 Km sud Toulouse) Port 1 : (20 voies) Liaison ethernet vers F6FBB-11 Port 2 : ( 1 voie ) Acces decametrique 300 Bds Port 3 : ( 1 voie ) Acces telephone 1200-28800 Bds Port 4 : ( 1 voie ) Acces ethernet local Micro : compatible PC 486 SX 33 Ram : 16 MB Disque : 400 MB SCSI Soft : F6FBB version $E NODAL F6FBB-10/F6FBB-11 Port 1 : Liaison 9600 Bds full duplex vers F6BEX-9 (430.575/439.975) Port 2 : Acces local VHF 1200 Bds simplex (145.275) Port 3 : Acces local UHF 9600 Bds simplex (432.650) Port 4 : Liaison 2400 Bds AFSK vers F5JTU-9 (430.425/439.825) Port 5 : Liaison ethernet vers F6FBB-1 Micro : compatible PC 486 DX2/66 Ram : 8MB Disque : Floppy 1.4MB Soft : FPAC 2.0 LINUX (compatible ROSE) fbb-7.0.10/etc/lang/francais.hlp0000644000175000017500000014433113613360505013250 00000000000000@@ -1 ? Vous n'avez qu'un jeu reduit des commandes: B : DECONNEXION. H : Cette AIDE minimale. KM : SUPRESSION de vos messages prives DEJA LUS. LM : LISTE de vos messages PRIVES. O : Acces aux OPTIONS. Q : DECONNEXION. RM : LECTURE de vos messages PRIVES. S : ENVOI de messages. T : APPEL du Sysop. ? : AIDE. @@ 0 ? *** Cette commande n'est pas disponible !! C : Connexions - statistiques. D : Documentation. Q : QRA Locator. N : Nomenclature. T : Trajectographie. F : Retour en mode messagerie. B : Deconnexion. @@ 0 C CONNEXIONS-STAT --------------- Statistiques sur l'utilisation et le fonctionnement de la BBS. - Occupation des rubriques. - Statistiques generales. - Liste des connections (Carnet de trafic de la BBS). - Histogramme horaire. - Histogramme journalier. - Liste des indicatifs. @@ 0 D DOCUMENTATIONS -------------- Vous trouverez dans cette rubrique les informations ou documentations fournies par differents OMs. Cette rubrique est ouverte a tous, et tous les articles,documentations, programmes que vous voudrez bien y mettre seront les bienvenus. La commande d'acces aux informations est uniquement numerique et represente un numero d'ordre dans chaque menu. @@ 0 N NOMENCLATURE ------------ Cette rubrique permet d'obtenir les nom, prenom, adresse, telephone, conditions de trafic etc... des OMs qui ont utilise cette BBS et qui ont bien voulu y laisser ces renseignements. Accepter de fournir ces renseignements peut vous rendre service a vous-meme autant qu'aux autres OMS! Le menu propose: - Introduction ou modification de vos nom et adresse. - Recherche de ces informations sur un OM. - Liste des indicatifs qui se sont deja connectes sur cette BBS. N'oubliez pas de mettre a jour vos propres informations. @@ 0 Q QRA LOCATOR ----------- Le QRA-Locator est une succession de 2 lettres, 2 chiffres et 2 lettres donnant la position geographique d'une station du Monde avec une precision de l'ordre d'une quinzaine de Km (Ex. de QRA Locator: JN03SP). Ce code compact est universellement employe par les Radio-amateurs, en parti- culier pendant les Contests. Cette rubrique permet de calculer un QRA-Locator, mais aussi d'obtenir l'azimuth entre 2 stations dont on connait les QRA-Locators (pour orientation des antennes), ainsi que la distance les separant (avec cumul de distances pour les contests!). Le menu propose: - Transformation de QRA-Locator en Longitude-Latitude. - Transformation de Longitude-Latitude en QRA-Locator. - Calcul de distance et azimut entre deux QRA-Locators. - Cumul de distances entre une station et plusieurs QRA-Locators. @@ 0 T TRAJECTOGRAPHIE SATELLITES -------------------------- Cette rubrique est consacree aux satellites radio-amateurs, meteo etc... Vous pouvez soit utiliser le programme de trajectographie du Serveur, soit recuperer les parametres orbitaux pour les introduire dans votre propre calcul de trajectographie. Les parametres orbitaux sont maintenus a jour automatiquement a partir des Bulletins AMSAT recus sur le reseau Packet. Le menu propose: - Calcul de trajectographie satellite. - Affichage des parametres orbitaux. - Caracteristiques de satellites amateurs. @@ 2 ? *** Cette commande n'est pas disponible !! Q : Transformation de QRA-Locator en Longitude-Latitude. L : Transformation de Longitude-Latitude en QRA-Locator. D : Calcul de distance et azimut entre deux QRA-Locators. C : Cumul de distances entre une station et plusieurs QRA-Locators. F : Retour au menu serveur. B : Deconnexion. @@ 2 Q Commande "Q": ------------- Transformation d'un QRA-Locator en Longitude et Latitude. La Longitude Ouest et la Latitude Nord sont donnees en degres minutes et en grades. @@ 2 L Commande "L": ------------- Transformation de Longitude et Latitude en QRA-Locator. La Longitude Ouest et la Latitude Nord peuvent etre fournies en degres centesimaux, degres minutes, ou grades. @@ 2 D Commande "D": ------------- Calcul de DISTANCE et azimut entre deux QRA-Locators. La distance est donnee en Km et l'azimut en degres. @@ 2 C Commande "C": ------------- CUMUL de calcul de distances. Apres avoir fourni le QRA-Locator qui servira d'origine pour les calculs, vous pourrez donner un QRA-Locator de destination. La distance du calcul pourra etre cumulee avec une seconde ou plusieurs autres stations, vous permettant ainsi de calculer le nombre total de Km. @@ 3 ? *** Cette commande n'est pas disponible !! O : Occupation des rubriques. G : Statistiques generales. L : Liste des connections. H : Histogramme horaire. J : Histogramme journalier. I : Liste des indicatifs. F : Retour au menu serveur. B : Deconnexion. @@ 3 O Commande "O": ------------- Pourcentage d'OCCUPATION des differentes rubriques du serveur a l'instant de votre demande. @@ 3 G Commande "G": ------------- GENERALITES sur le serveur: - Nombre de messages actifs. - Nombre de connexions. - Temps de connexions. - Heures de pointe. @@ 3 L Commande "L": ------------- LISTE des connexions (Carnet de trafic). Pour chaque connexion sont indiques le port, l'indicatif, la date et l'heure, ainsi que le temps de connexion. La liste est donnee par ordre chronologique inverse. *** prevoir cette en-tete en debut de tableau *** @@ 3 H Commande "H": ------------- Histogramme des connexions sur cette BBS en fonction des HEURES de debut de connexion. SYNTAXE: "H": histogramme des heures de connexions pour l'ensemble du trafic memorise par le Serveur. "H F1DCDC": histogramme des heures de connexions de F1DCDC. "H FC1*": histogramme des heures de connexions des OMs dont l'indicatif commence par "FC1" . "H FC*": histogramme des heures de connexions des OMs dont l'indicatif commence par "FC". @@ 3 J Commande "J": ------------- Histogramme des connexions sur cette BBS en fonction des JOURS de la semaine. SYNTAXE: "J": histogramme des jours de trafic pour l'ensemble des connexions memorisees par le Serveur. "J FC1CDC": histogramme des jours de connexions de FC1CDC. "J FC1*": histogramme des jours de connexions des OMs dont l'indicatif commence par "FC1" . "J FC*": histogramme des jours de connexions des OMs dont l'indicatif commence par "FC". "J O*": histogramme des jours de connexions des OMs dont l'indicatif commence par "O". @@ 3 I Commande "I": ------------- Liste des indicatifs qui se sont connectes au serveur. Cette liste est classee par ordre alphanumerique. SYNTAXE: "I": liste tous les indicatifs. "I FC1*": liste les indicatifs commencant par "FC1" . "I FC*": liste les indicatifs commencant par "FC" . "I O*": liste les indicatifs commencant par "O" . @@ 4 H|? DOCUMENTATION: -------------- Pour lire un des fichiers de la liste, tapez seulement son numero. Sysop : La description peut etre changee avec la commande D : D BBS.DOC Description @@ 4 F Commande F : ------------ Cette commande permet de revenir au menu du serveur. Si vous voulez quitter le mode SERVEUR et revenir en mode MESSAGERIE, tapez F de nouveau. @@ 4 B Commande B : ------------ Cette commande permet de vous deconnecter sans revenir en mode messagerie. @@ 4 D Commande D (Sysop uniquement) : ------------------------------- Le sysop peut utiliser cette commande pour mettre a jour la description d'un fichier. D Nom-Fichier Description @@ 4 R Commande R : ------------ La commande R vous permet de revenir au niveau precedent de la documentation. @@ 5 ? *** Cette commande n'est pas disponible !! N : Modification de vos nom et adresse. R : Recherche des informations sur un OM. I : Liste des indicatifs connectes. F : Retour au menu serveur. B : Deconnexion. @@ 5 N Commande "N": ------------- Introduction ou modification de vos NOMS,adresse et telephones. Si les renseignements du fichier Adresses sont errones ou s'ils ont change, vous pouvez les modifier par cette commande. Un espace ou un en reponse a une question n'en modifie pas le contenu. Si le contenu du fichier est correct, vous annulez la modification en repondant "N" a la demande de modification finale. Accepter de fournir ces renseignements peut vous rendre service a vous-meme autant qu'aux autres OMS! @@ 5 R Commande "R": ------------- Recherche des coordonnees d'un OM. Si l'OM est en fichier, vous pouvez avoir les renseignements le concernant. Vous pouvez chainer l'indicatif de l'OM recherche derriere la commande. SYNTAXE: "R F6FBB" @@ 5 I Commande "I": ------------- Liste des indicatifs qui se sont connectes au serveur. Cette liste est classee par ordre alphanumerique. SYNTAXE: "I": liste tous les indicatifs. "I FC1*": liste les indicatifs commencant par "FC1" . "I FC*": liste les indicatifs commencant par "FC" . "I O*": liste les indicatifs commencant par "O" . @@ 6 ? *** Cette commande n'est pas disponible !! T : Calcul de trajectographie satellite. P : Affichage des parametres orbitaux. C : Caracteristiques de satellites amateurs. F : Retour au menu serveur. B : Deconnexion. @@ 6 T Commande "T": ------------- Calcul de trajectographie satellites. Apres avoir choisi le satellite dont vous voulez la trajectographie, vous devez fournir la date et l'heure auxquels les calculs commenceront. Respectez la syntaxe qui vous est proposee. Votre position geographique reelle est prise en compte par votre QRA-Locator, s'il est en fichier, (commande Nomenclature) sinon le QRA-Locator du serveur sera utilise par defaut. Le pas de calcul peut etre variable suivant les satellites. Une ligne de parametres sera affichee par pas. Cette ligne de calcul correspond a une elevation minimale de -5 degres (soit 5 degres sous l'horizon. La mise a jour des parametres orbitaux est assuree automatiquement a partir des fichiers AMSAT diffuses sur le reseau Packet. @@ 6 P Commande "P": ------------- Affichage des parametres orbitaux du satellite selectionne. Ces parametres sont utilises pour les calculs de trajectograhie du Serveur (commande "T") mais sont a la disposition des OMs possedant leur propre programme de trajectographie. La mise a jour des parametres orbitaux est assuree automatiquement a partir des fichiers AMSAT diffuses sur le reseau Packet. @@ 6 C Commande "C": ------------- Caracteristiques et informations concernant le satellite selectionne. Nota: Compte-tenu de la difficulte de recuperer ces informations, les OMS ayant des renseignements permettant de completer ou mettre a jour ce fichier seront les bienvenus. Contactez le Sysop qui transmettra les infos par forward @FRA. @@ 9 AIDE|HELP Commande "AIDE" ou "HELP": -------------------------- La commande "AIDE" ou "HELP" donne la liste des commandes disponibles sous FBBDOS. @@ 9 CD Commande "CD": -------------- La commande "CD" permet de changer de repertoire. SYNTAXE: "CD \TEST "CD .." permet de revenir au repertoire precedent dans l'aborescence. @@ 9 COPY Commande "COPY": ---------------- La commande "COPY" permet de copier un fichier dans un autre fichier. Le fichier destination, s'il existe deja, doit vous appartenir. SYNTAXE: "COPY TOTO.TXT TEST.TXT" @@ 9 DEL Commande "DEL": --------------- La commande "DEL" permet de supprimer un fichier. Un fichier ne peut etre supprime que s'il vous appartient . @@ 9 DIR Commande "DIR": --------------- La commande "DIR" permet de visualiser le catalogue du repertoire ou vous vous trouvez ou de celui que vous avez specifie apres DIR. SYNTAXE: "DIR \TEST" @@ 9 EDIT Commande "EDIT": ---------------- La commande "EDIT" permet d'editer un fichier. Il doit vous appartenir s'il existe deja. Plusieurs commandes sont disponibles: ? : donne la liste des commandes de l'editeur. A : Ajoute une ligne apres la ligne courante. Le texte de la ligne suit la commande et doit se terminer par le caractere /. Le caractere / peut etre inclus dans une chaine de caracteres a condition d'etre precede par le caractere \. Le caractere \, lui doit etre double pour etre considere comme caractere valide. Le pointeur de ligne est sur la ligne inseree. B : Positionne le pointeur de ligne au debut du fichier. E : Positionne le pointeur de ligne a la fin du fichier. F : Recherche la premiere occurence d'une chaine de caracteres specifiee apres la commande a partir de la ligne courante. La chaine de caracteres doit etre terminee par le caractere /. Le caractere / peut etre inclus dans une chaine de caracteres s'il est precede du caractere \ (voir commande A). Le pointeur de ligne est sur la ligne ou la chaine a ete trouvee. I : Insere une ligne avant la ligne courante. Le texte de la ligne suit la commande et doit se terminer par le caractere /. Voir commande A pour inclure le caractere / dans la chaine de caracteres. Le pointeur de ligne est sur la ligne inseree. K : Supprime le nombre de lignes specifie avant la commande (3K) a partir de la ligne courante. Si le nombre n'est pas specifie, la valeur 1 est prise par defaut. L : Deplace le pointeur du nombre de ligne specifie avant la commande (5L). Ce nombre peut etre positif ou negatif. N : Valide ou devalide la numerotation des lignes. P : Affiche le nombre de lignes specifie avant la commande (8P) a partir de la ligne courante. R : Recherche la premiere occurence de la chaine de caracteres specifiee apres la commande et la remplace par la deuxieme chaine (RTOTO TATA). Les chaines de caracteres doivent etre terminees par le caractere /. Voir commande A pour inclure un caractere / dans la chaine. Le pointeur de ligne est sur la ligne modifiee. S : Sauvegarde le fichier que vous editez. Q : Quitte l'editeur mais n'effectue pas la sauvegarde. Pensez a faire un S auparavant! Exemples: "EDIT>B5L10P" met le pointeur au debut du fichier, avance de 5 lignes et affiche 10 lignes. "EDIT>B4L6K-2L1OP" met le pointeur au debut du fichier, avance de 4 lignes, supprime 6 lignes, recule de 2 lignes et affiche 10 lignes. "EDIT>BFBonjour/K-2L5P" met le pointeur en debut de fichier, recherche "Bonjour", supprime la ligne contenant "Bonjour" recule de 2 lignes et affiche 5 lignes. "EDIT>BFBonjour/IC'est une nouvelle ligne avec un \/ dedans/-1L3P" met le pointeur en debut de fichier, recherche "Bonjour", insere la nouvelle ligne, recule de 1 ligne et affiche 3 lignes. "EDIT>SQ" sauvegarde le fichier edite et quitte l'editeur. @@ 9 EXIT|QUIT|F|B Commandes "EXIT", "QUIT", "F", "B": ----------------------------------- Sortie du FBBDOS et retour aux commandes de la messagerie. @@ 9 GET Commande "GET": --------------- Permet de charger CHEZ VOUS un fichier ASCII (texte), ou de le visualiser sans pagination. SYNTAXE: "GET FICHIER.TXT" @@ 9 LIST Commande "LIST": --------------- La commande "LIST" permet de visualiser le catalogue du repertoire ou vous vous trouvez ou de celui que vous avez specifie apres LIST. La description est donnee pour chaque fichier. SYNTAXE: "LIST \TEST" @@ 9 MD|MKDIR Commande "MD" ou "MKDIR": ------------------------- Permet de creer un repertoire a partir du repertoire ou vous vous trouvez. SYNTAXE: "MD \TEST" @@ 9 NEW Commande "NEW": --------------- Donne la liste des fichiers nouveaux a partir du repertoire courant depuis la derniere utilisation de cette commande ou de la commande "YN". @@ 9 O La commande "O" (OPTIONS) permet de memoriser au niveau du serveur: - Le nombre de lignes de votre ecran pour beneficier d'une pagination auto- matique (c'est-a-dire d'un arret de l'affichage lorsque l'ecran est rempli). - La langue de votre choix en ce qui concerne l'aide et les commentaires de la BBS. - Employee sans attribut, la commande "O" donne l'etat de la programmation de ces 2 options. SYNTAXE: "O" COMMANDES DERIVEES (possedent leur propre aide): - "OP" valide ou devalide la pagination. - "OP [nbre de lignes] initialise la pagination a n lignes. - "OL" liste les langues disponibles. - "OL [#langue]" selectionne la langue numero #. @@ 9 OP La commande "OP" (OPTION PAGINATION) permet de memoriser au niveau du serveur la pagination. - La commande "OP [nb_lignes]" permet de memoriser dans la BBS le nombre de lignes de votre ecran pour beneficier d'une pagination automatique (c'est-a-dire d'un arret de l'affichage lorsque l'ecran est rempli). SYNTAXE: "OP [nb_lignes] - La commande "OP" (sans attribut) valide ou alternativement devalide la pagination (flip-flop). Le dernier etat avant deconnexion sera retrouve a la prochaine connexion sur la BBS. SYNTAXE: "OP" Rappel: employee sans attribut, la commande "O" donne l'etat de la program- mation des options. @@ 9 OL La commande "OL" (OPTION LANGUE) permet de programmer la langue de votre choix pour l'aide et les commentaires de la BBS. La BBS vous propose la liste des langues disponibles reperees par un numero. La langue choisie est memorisee par la BBS. SYNTAXE: "OL [#langue]" Rappel: employee sans attribut, la commande "O" donne l'etat de la program- mation des options. @@ 9 PUT Commande "PUT": --------------- Permet de charger dans la BBS un fichier ASCII (texte) que vous avez CHEZ VOUS. Si ce fichier existe deja dans le repertoire ou vous vous trouvez, celui-ci doit vous appartenir sinon le chargement vous sera refuse. SYNTAXE: "PUT TEST.TXT" @@ 9 RD|RMDIR Commande "RD" ou "RMDIR": ------------------------- Permet de supprimer un repertoire. Un repertoire ne peut etre supprime que s'il ne contient aucun fichier. @@ 9 TYPE Commande "TYPE": ---------------- Permet de visualiser le contenu d'un fichier ASCII avec pagination si vous avez cette option. @@ 9 VIEW Commande "VIEW": --------------- La commande "VIEW" permet de visualiser le contenu du ou des fichiers archive specifies (ZIP, ARC, etc...). SYNTAXE: "VIEW TEST.ZIP" @@ 9 XGET Commande "XGET": ---------------- Permet de charger un fichier binaire DE LA BBS VERS CHEZ VOUS en protocole XModem. Ce protocole est reserve aux transferts telephoniques. SYNTAXE: "XGET FICHIER.EXE" puis suivre les instructions. @@ 9 XPUT Commande "XPUT": ---------------- Permet de mettre un fichier binaire DEPUIS CHEZ VOUS DANS LE REPERTOIRE COURANT DU FBBDOS en protocole Xmodem. Ce protocole est reserve aux transferts telephoniques. SYNTAXE: "XPUT TEST.EXE" puis suivre les instructions. @@ 9 YGET Commande "YGET": ---------------- Permet de charger un fichier binaire DE LA BBS VERS CHEZ VOUS en protocole YAPP. Vous devez posseder vous-meme le protocole YAPP (TPK de FC1EBN p.ex) SYNTAXE: "YGET FICHIER.EXE" puis suivre les instructions. @@ 9 YPUT Commande "YPUT": ---------------- Permet de mettre un fichier binaire DEPUIS CHEZ VOUS DANS LE REPERTOIRE COURANT DU FBBDOS en protocole YAPP. Vous devez posseder vous-meme le protocole YAPP (TPK de FC1EBN p.ex) SYNTAXE: "YPUT TEST.EXE" puis suivre les instructions. @@ 14 ? Le "?" ou le "H" (HELP) permet de lire cet AIDE de BASE. Vous etes sur une BBS (Bulletin Board System) comprenant 2 parties: - une MESSAGERIE orientee vers l'echange de messages personnels ou generaux, - un SERVEUR oriente vers la documentation et des applications diverses. VOUS ETES ACTUELLEMENT SUR LA MESSAGERIE SAVOIR UTILISER LA MESSAGERIE: - Il existe une AIDE pour toutes les commandes. Elle est utilisable lorsque la ligne des commandes s'affiche a l'ecran avec un prompt en debut de ligne. SYNTAXE de L'AIDE : "?[commande]" EXEMPLES: - tapez "?S" pour obtenir l'AIDE sur l'ENVOI DE MESSAGES (commande S). - tapez "?SC" pour obtenir l'AIDE cette COMMANDE DERIVEE SC (SEND COPY) - Tapez "?H" pour obtenir la LISTE DES COMMANDES. - Tapez "?F" pour passer de la MESSAGERIE au SERVEUR (et vice-versa). COMMANDES IMPORTANTES: - La commande "A" (ABORT) permet d'interrompre l'une operation en cours. Tapez simplement A suivi d'un retour-chariot (). Employez-la aussi pour reprendre la main si vous etes dans l'embarras !! "!" donne le status du serveur. "=[INDICATIF]" permet de connecter une station presente sur une autre voie. ">[INDICATIF] [TEXTE]" envoie ce texte en break a une autre station presente. ATTENTION: Ces 3 commandes (dites cachees) n'apparaissent pas dans les lignes de commandes! (mais possedent leur propre aide). N'OUBLIEZ PAS DE TAPER OU APRES CHAQUE COMMANDE! @@ 14 A La commande "A" (ABORT) permet d'arreter en cours de lecture la reception de ce que vous aviez demande. SYNTAXE: Exceptionnellement, cette commande peut etre tapee a n'importe quel moment: "A" Le serveur vous repond par "Interruption!" et vous redonne le prompt. NOTA: Cette commande est immediate si vous etes en mode "pagination" (commande "OP"), mais peut etre retardee en cas de lecture de longs messages car il faut d'abord que les tampons memoires du serveur se vident. @@ 14 B La commande "B" (BYE) vous deconnecte de la BBS. SYNTAXE: Tapez "B" pour vous deconnecter proprement. - NOTA: Vous pouvez egalement vous deconnecter par la commande de deconnexion de votre TNC. @@ 14 C - La commande C (CONFERENCE) permet d'entrer dans la conference, et d'etablir un QSO a plusieurs. Toute station connectee a la BBS peut y entrer. SYNTAXE: "C" COMMANDES DERIVEES (possedent leur propre aide): - AVANT d'entrer en conference, "CW" liste l'indicatif des conferenciers. "!" liste les utilisateurs actuels de la BBS. - DANS la conference, les commandes disponibles sont differentes: (elles commencent toujours par un point en premiere colonne). ".H" vous donne ce fichier d'aide. ".W" donne la liste des conferenciers. ".C[port] INDICATIF" permet de connecter un autre utilisateur de la BBS. ".Q" permet de sortir de la conference. ***** faire une cde donnant la liste des connectes a la BBS*** @@ 14 CW - AVANT d'entrer en conference par la commande "C", la commande "CW" liste l'indicatif de tous les conferenciers. SYNTAXE: "CW" @@ 14 D La commande D (DOS) a 2 fonctions: 1) Employee seule, elle permet de passer sous FBBDOS (un DOS simplifie adapte a la BBS) aussi bien en mode Messagerie que Serveur. - SYNTAXE: "D" - COMMANDES DERIVEES disponibles sous FBBDOS: AIDE HELP ou ? : Affiche les commandes disponibles. DIR : Catalogue des fichiers du repertoire ou vous trouvez. EDIT : Editeur de texte. GET : Chargement VERS VOUS d'un fichier texte. PUT : Chargement VERS LA BBS d'un fichier texte. CD : Changement de repertoire. MD ou MKDIR : Creation d'un repertoire. COPY : Copie d'un fichier. DEL : Suppression d'un fichier. RD ou RMDIR : Suppression d'un repertoire. TYPE : Visualisation du contenu d'un fichier. YGET : Chargement VERS VOUS d'un programme sous protocole YAPP. YPUT : Chargement VERS LA BBS d'un programme sous protocole YAPP EXIT,QUIT,F ou B : Sortie du FBBDOS et retour dans le mode ou vous vous trouviez auparavant (Messagerie ou Serveur). 2) La commande "D [nomfichier]" permet de charger CHEZ VOUS un fichier se trouvant dans le repertoire du FBBDOS. SYNTAXE: "D [nomfichier.ext]" Nota: 1) La commande inverse (deposer un fichier de CHEZ VOUS DANS FBBDOS) est la commande "U". Voir aussi la commande "W". 2) Si vous utilisez un ordinateur avec un programme "Packet" adequat, vous pouvez recuperer ce fichier sur votre disque. @@ 14 F - La commande "F" (FLIP-FLOP) vous permet de passer du mode MESSAGERIE au mode SERVEUR et reciproquement. SYNTAXE: "F" Rappel: Le SERVEUR est une base de documentation et d'applications diverses. @@ 14 G -La commande "G" (GATEWAY) vous permet d'acceder a la passerelle et d'utiliser la BBS pour vous connecter a une station Packet quelconque sur une des frequences proposees par le Serveur. SYNTAXE: "G" COMMANDES DERIVEES DU GATEWAY (disponibles apres le choix de la frequence): "B" : Sortie de la passerelle (gateway). "K" : Passage en mode conversation. "C" : Connexion. "D" : Deconnexion. "H" : Aide. "J" : Liste des 20 dernieres stations entendues. Apres avoir selectionne un des ports autorises, une voie vous sera affectee si disponibilite. Cette voie prendra votre indicatif. Le passage en mode conversation se fait automatiquement a la connexion du correspondant et le retour en mode commande se fait a la deconnexion ou par le caractere Esc ou >. Le passage en mode conversation se fait par la commande K. La commande C doit etre suivie de l'indicatif du destinataire et eventuellement de la lettre V suivie d'une liste de repeteurs. SYNTAXE: "C [Destinataire V repet1 repet2 ...] @@ 14 H La commande "H" (HELP) liste les principales commandes de la MESSAGERIE. 1) Commandes directes (une seule lettre): ========================================= A : Abort : Interrompt l'envoi de donnees. B : Bye : Quitte et deconnecte la messagerie. C : Conference : Acces a la conference. D : DOS : Acces au FBBDOS. F : Flip-flop : Acces au mode serveur. G : Gateway : Acces aux autres frequences par 'gateway'. H : Help : Aide. I : Infos : Donne des informations sur le systeme. Q : Quitte : Quitte et deconnecte la messagerie. T : Talk : Appeller l'operateur. V : Version : Donne la version du logiciel de Serveur. W : What : Donne le repertoire des fichiers du FBBDOS. X : Expert : Changement de Mode entre Normal et Expert (et vice-versa). Y : YAPP : Transfert de fichiers binaires avec le protocole YAPP. ?Z: : Liste des regions francaises pour le forward hierarchise. ! : : Informations sur la BBS. 2) Commandes avec Qualifier: ============================ J : Jheard : Liste des dernieres stations connectees. K : Kill : Supression de messages. L : List : Liste des messages. N : Name : Modification du prenom. O : Option : Selectionne les options . R : Read : Lecture des messages. S : Send : Envoi de messages. V : Verbose : Lecture des messages avec en-tete. =[indicatif] : Connecte un autre utilisateur de la BBS. >[indicatif] [texte] : Envoie un "break" a un autre utilisateur de la BBS. Pour l'aide complete de chaque commande, tapez ?n (n = lettre(s) de commande). SYNTAXE: "?LM" donne l'aide detaillee de la commande "LM". @@ 14 I La commande "I" (INFORMATIONS) donne des informations sur cette BBS: - QTH de la BBS. - Description du materiel. - Reference du logiciel. - Caracteristiques des ports. - Langues disponibles. SYNTAXE: "I" @@ 14 J La commande "J" (JHEARD) donne la liste des indicatifs entendus ou connectes sur la BBS. La commande "J" doit toujours comporter 2 caracteres. SYNTAXE: - Tapez "JK" pour lister les 20 derniers indicatifs connectes. - Tapez "JA" pour lister les indicatifs connectes sur le port A. - Tapez "JB" pour lister les indicatifs connectes sur le port B. - Tapez "JC" pour lister les indicatifs connectes sur le port C, etc... - Tapez "J1" pour lister les indicatifs entendus sur le port A. - Tapez "J2" pour lister les indicatifs entendus sur le port B. - Tapez "J3" pour lister les indicatifs entendus sur le port C, etc... @@ 14 JK La commande "JK" donne la liste des 20 derniers indicatifs connectes sur la BBS. SYNTAXE: "JK" @@ 14 JA|JB|JC|JD|JE|JF|JG|JH Les commandes "JA" a "JH" donnent la liste les indicatifs CONNECTES sur les ports A a H de la BBS. SYNTAXE: "JA" @@ 14 J1|J2|J3|J4|J5|J6|J7|J8 Les commandes "J1" a "J8" donnent la liste des indicatifs ENTENDUS sur les ports A a H de la BBS. SYNTAXE: "J1" @@ 14 K La commande "K" (KILL) permet de supprimer les messages envoyes PAR VOUS ou POUR VOUS. SYNTAXE: "K [#msg]" supprime un message numero (#). COMMANDE DERIVEE (voir ?KM): "KM" supprime tous les messages pour vous que vous avez deja lus. Les messages que vous n'avez pas encore lus ne seront pas supprimes. NOTA: Vous ne pouvez pas supprimer de fichiers, seul le SysOp le peut. @@ 14 KM La commande "KM" (KILL MINE) supprime tous les messages POUR VOUS que vous avez deja lus. Les messages que vous n'avez pas encore lus ne seront pas supprimes. SYNTAXE: "KM" NOTA: Vous ne pouvez pas supprimer de fichiers, seul le SysOp le peut. @@ 14 L La commande "L" (LISTE) permet de lister de differentes facons les titres des messages. - Employee sans qualificatif, la commande "L" liste les titres des nouveaux messages depuis le dernier usage de cette commande. Son utilisation regu- liere permet de lire tous les titres des messages, sans oubli et sans avoir a retenir le dernier numero lu. SYNTAXE: "L" - La commande "L [#msg]-" liste les titres des messages a partir d'un numero [#msg]. La liste demarre du numero du message le plus recent et s'arrete au numero [#msg]. SYNTAXE: "L [#msg]-" Exemple: pour LISTER les titres des messages apres #11325, tapez "L 11325-". - La commande "L [#msg1]-[#msg2]" liste les titres des messages a partir d'un numero [#msg1]. Elle s'arrete au numero [#msg2]. SYNTAXE: "L [#msg1]-[msg2]" Exemple: pour LISTER les titres des messages de #11300 a #11350 tapez "L 11300-11350". COMMANDES DERIVEES (possedent leur propre aide): - LB : liste les bulletins. - LC [theme] : selection d'un theme. - LM : liste les messages POUR VOUS. - LN : liste les messages NOUVEAUX POUR VOUS. - LL 10 : liste les 10 derniers messages. - LR : Liste en sens inverse. - LS [texte] : recherche de "texte" dans les titres de messages. - L< [indicatif] : liste les messages DE [indicatif]. - L> [indicatif] : liste les messages POUR [indicatif]. - L@ [nomBBS] : liste les messages VIA cette BBS. @@ 14 LB La commande "LB" (LISTE BULLETIN) liste uniquement les bulletins. SYNTAXE: "LB" @@ 14 LC La commande "LC" employee seule affiche le theme selectionne. Suivie d'un theme, permet l'affichage des bulletins dont le theme (destinataire) repond aux criteres. Les jokers (* et ?) peuvent etre utilises. "LC *DX*" permet de selectionner uniquement les bulletins dont le theme contient "DX". "LC *" permet de valider la totalite des bulletins. @@ 14 LM La commande "LM" (LISTE MINE) liste les messages POUR VOUS. SYNTAXE: "LM" @@ 14 LN La commande "LN" (LISTE NEW) liste les messages NOUVEAUX POUR VOUS. SYNTAXE: "LN" @@ 14 LL La commande "LL [n]" liste les n derniers messages recus sur la messa- gerie (avec "n" = nombre de messages a lister). SYNTAXE: "LL [nombre]" @@ 14 LR La commande "LR" est identique a la commande L, mais les messages sont listes en sens inverse, le plus ancien en tete. - Employee sans qualificatif, la commande "LR" liste les titres des nouveaux messages depuis le dernier usage de cette commande, le plus ancien d'abord. Son utilisation reguliere permet de lire tous les titres des messages, sans oubli et sans avoir a retenir le dernier numero lu. SYNTAXE: "LR" - La commande "L [#msg]-" liste les titres des messages a partir d'un numero [#msg]. La liste demarre au numero [#msg] et s'arrete au numero du message le plus recent. SYNTAXE: "LR [#msg]-" Exemple: pour LISTER les titres des messages apres #11325, tapez "L 11325-". - La commande "LR [#msg1]-[#msg2]" liste les titres des messages a partir d'un numero [#msg1]. Elle s'arrete au numero [#msg2]. SYNTAXE: "LR [#msg1]-[msg2]" Exemple: pour LISTER les titres des messages de #11300 a #11350 tapez "LR 11300-11350". @@ 14 LS La commande "LS [texte]" recherche la chaine de caracteres "texte" dans les titres de messages et affiche les titres selectionnes. SYNTAXE: "LS [texte]" @@ 14 L< La commande "L< [indicatif]" liste les messages DE [indicatif]. SYNTAXE: "L< [indicatif]" @@ 14 L> La commande "L> [indicatif]" liste les messages POUR [indicatif]. SYNTAXE: "L> [indicatif]" @@ 14 L@ La commande "L@ [nomBBS]" liste les messages VIA cette BBS. Nota: [nomBBS] s'ecrit sans le SSID (Ex. F6FBB et non F6FBB-1). SYNTAXE: "L@ [nomBBS]" @@ 14 M La commande "M" (COPIE MESSAGE) permet de dupliquer un message vers un fichier de FBBDOS. - Employee sans qualificatif, la commande "M" duplique uniquement le contenu du message, sans les entetes d'indication de routage. Seul le texte envoye par l'expediteur sera duplique. SYNTAXE: "M [#msg] [nomFichier]" COMMANDES DERIVEES (possedent leur propre aide): - MH : duplique avec le format de la commande R. - MV : duplique avec le format de la commande V. @@ 14 MH La commande "MH" (COPIE MESSAGE + ENTETE) duplique un message dans un fichier FBBDOS en utilisant le format de la commande R. L'entete de message est recopie en debut de fichier, mais les indicateurs de routage ne sont pas dupliques. SYNTAXE: "MH [#msg] [nomFichier]" @@ 14 MV La commande "MV" (COPIE MESSAGE + ENTETE + ROUTAGE) duplique un message dans un fichier FBBDOS en utilisant le format de la commande V. L'entete de message est recopie en debut de fichier ainsi que les indicateurs de routage. SYNTAXE: "MV [#msg] [nomFichier]" @@ 14 N La commande "N" (preNom) vous permet d'entrer ou de modifier votre prenom. Il sera memorise par la BBS. Vous pouvez utiliser jusqu'a 12 caracteres. La BBS vous demandera de le re-entrer si necessaire. SYNTAXE: "N [Prenom]" @@ 14 NQ La commande "NQ" (QthLocator) vous permet d'entrer ou de modifier votre QthLocator. Il sera memorise par la BBS. Vous devez entrer le qth locator sous la forme habituelle, 2 lettres, 2 chiffres puis 2 lettres, sans espace. SYNTAXE: "NQ [QthLocator]" @@ 14 O La commande "O" (OPTIONS) permet de memoriser au niveau du serveur: - Le nombre de lignes de votre ecran pour beneficier d'une pagination auto- matique (c'est-a-dire d'un arret de l'affichage lorsque l'ecran est rempli). - La langue de votre choix en ce qui concerne l'aide et les commentaires de la BBS. - Employee sans attribut, la commande "O" donne l'etat de la programmation de ces 2 options. SYNTAXE: "O" COMMANDES DERIVEES (possedent leur propre aide): - "OP" valide ou devalide la pagination. - "OP [nbre de lignes] initialise la pagination a n lignes. - "OL" liste les langues disponibles. - "OL [#langue]" selectionne la langue numero #. @@ 14 OP La commande "OP" (OPTION PAGINATION) permet de memoriser au niveau du serveur la pagination. - La commande "OP [nb_lignes]" permet de memoriser dans la BBS le nombre de lignes de votre ecran pour beneficier d'une pagination automatique (c'est-a-dire d'un arret de l'affichage lorsque l'ecran est rempli). SYNTAXE: "OP [nb_lignes] - La commande "OP" (sans attribut) valide ou alternativement devalide la pagination (flip-flop). Le dernier etat avant deconnexion sera retrouve a la prochaine connexion sur la BBS. SYNTAXE: "OP" Rappel: employee sans attribut, la commande "O" donne l'etat de la program- mation des options. @@ 14 OL La commande "OL" (OPTION LANGUE) permet de programmer la langue de votre choix pour l'aide et les commentaires de la BBS. La BBS vous propose la liste des langues disponibles reperees par un numero. La langue choisie est memorisee par la BBS. SYNTAXE: "OL [#langue]" Rappel: employee sans attribut, la commande "O" donne l'etat de la program- mation des options. @@ 14 Q La commande "Q" (QUITTE) vous deconnecte de la BBS. SYNTAXE: Tapez "Q" pour vous deconnecter proprement. - NOTA: Vous pouvez egalement vous deconnecter par la commande de deconnexion de votre TNC. @@ 14 R La commande "R" (READ) permet de LIRE les MESSAGES en utilisant le numero qui leur sont affectes. L'entete du message est reduit aux renseignements principaux ( pour obtenir l'entete complet, utilisez la commande "V"). SYNTAXE: "R [#msg]" affiche le texte du message numero "#msg". Vous pouvez mettre jusqu'a 6 numeros par ligne. Exemple : pour LIRE les msgs #11313 et #11325, tapez "R 11313 11325". N'oubliez pas l'ESPACE!! COMMANDES DERIVEES (possedent leur propre aide): - "RM" lit tous les messages POUR VOUS. - "RN" lit tous les NOUVEAUX messages POUR VOUS. @@ 14 RM La commande "RM" (READ MINE) permet de LIRE les messages PERSONNELS POUR VOUS. (les messages s'afficheront les uns derriere les autres). SYNTAXE: "RM" @@ 14 RN La commande "RN" (READ NEW) permet de LIRE tous les NOUVEAUX messages POUR VOUS (les messages s'afficheront les uns derriere les autres). SYNTAXE: "RN" @@ 14 S La commande "S" (SEND) permet d'ENVOYER un MESSAGE (mais pas un fichier). SYNTAXE: "S [indicatif]" pour envoyer un message a "indicatif". "S VENTE" pour envoyer un message general qui pourra etre lu par tous. Le mot "VENTE" est choisi de maniere a bien representer le theme du message (eviter TOUS, ALL etc... qui n'apportent pas grand'chose). Ce mot aura au maximum 6 caracteres. "S [indicatif]@[nomBBS]" pour envoyer un message au destinataire "indicatif" via le reseau de transfert propre aux BBS. Le destinataire trouvera le message dans la BBS "nomBBS" (FORWARDING). "S VENTE@[nomBBS]" pour envoyer un message general qui pourra etre lu par tous. Nota: [nomBBS] s'ecrit sans le SSID (Ex. F6FBB et non F6FBB-1). "S VENTE@[diffusion]" pour envoyer un message general qui sera "forwarde" par le reseau de transfert propre aux BBS dans une zone geographique definie par le code "diffusion" (de 6 caracteres maxi). Exemple:"S ATARI@FRA" diffusera sur TOUTES les BBS de France (FRA) ce message concernant ATARI: a utiliser judicieusement et sans exces!!! En particulier, dans le cas d'un message vers l'etranger de type @EU (pour EUROPE), le rediger EN ANGLAIS UNIQUEMENT! Les codes de diffusion sont accessibles par la commande "Z". Remarque: - Si le destinataire correspond a un indicatif, le message sera classe "PERSONNEL" par la messagerie. - Si le destinataire correspond a un code tel que "ATARI" de l'exemple precedent, le message sera classe "BULLETIN" par la messagerie. COMMANDES DERIVEES (possedent leur propre aide): - "SP [indicatif]" envoie un message du type personnel. - "SP [indicatif]@[nomBBS]" envoie un message personnel sur "nomBBS". - "SB HELP" envoie un bulletin recherche d'aide (lisible par tout le monde). - "SB HELP@FRA" envoie un bulletin (lisible par tout le monde) et qui sera depose dans toutes les BBS de France. - "SR [#msg] [Titre]" envoie une reponse au message numero "#msg". - "SR" seul pour repondre au message que vous venez de lire. Le message sera automatiquement redirige vers l'expediteur sans que vous ayiez a taper son indicatif et sa BBS de rattachement (dite "locale"). - "SC [#msg] [indicatif]" permet de dupliquer un message numero "#msg" et de l'adresser au destinataire "indicatif". - "SC [#msg] [ATARI]@FRA" permet de dupliquer un message numero "#msg" et de le diffuser dans toutes les messageries de France. - "SC [#msg] [ATARI]@[nomBBS]" permet de dupliquer un message numero "#msg" et de le deposer dans la messagerie "nomBBS". Dans tous les cas: - le message doit se terminer par "Ctrl Z" ou "/EX" suivi d'un ou d'un . - le /EX doit se trouver en 1ere colonne. @@ 14 SP La commande "SP" (SEND PERSONNAL) permet d'ENVOYER un message qui sera obligatoirement du type PERSONNEL. SYNTAXE: "SP [indicatif]" pour envoyer un message personnel sur la BBS. "SP [indicatif]@[nomBBS]" pour envoyer un message personnel par "forwarding" sur la BBS citee. Nota: [nomBBS] s'ecrit sans le SSID (Ex. F6FBB et non F6FBB-1). @@ 14 SB La commande "SB" (SEND BULLETIN) permet d'ENVOYER un message qui sera obligatoirement du type BULLETIN (lisible par tous). SYNTAXE: - "SB HELP" envoie un bulletin recherche d'aide (lisible par tous les lecteurs de la BBS). - "SB HELP@FRA" envoie un bulletin (lisible par tout le monde) et qui sera depose dans toutes les BBS de France. Nota: [nomBBS] s'ecrit sans le SSID (Ex. F6FBB et non F6FBB-1). @@ 14 SR La commande "SR" (SEND REPONSE) permet de repondre a un message que vous venez de lire. Votre reponse sera automatiquement redirigee vers l'expediteur du message auquel vous repondez. Cette commande permet de retrouver le destina- taire et sa BBS de rattachement (dite aussi BBS locale) sans que vous ayiez a le retaper. Le titre du message original est conserve mais precede des lettres "RE:" (comme REPONSE). - Si vous voulez repondre au message que vous venez juste de lire, tapez simplement "SR" et la BBS vous demandera le texte du message a envoyer. Terminer comme a l'habitude par un CTRL-Z ou /EX. SYNTAXE: "SR" - Si vous voulez repondre a un message plus ancien dont vous vous souvenez du numero, tapez "SR [#msg]" et la BBS acheminera votre reponse au corres- pondant qui avait ecrit le message numero "#msg", que ce soit un message prive ou un bulletin general. SYNTAXE: "SR [#msg]" - Si vous voulez repondre a un message dont vous voulez remplacer le titre, tapez "SR [#msg] [titre]" et la BBS acheminera votre reponse au corres- pondant qui avait ecrit le message numero "#msg" avec le nouveau titre. La specification du numero de message est dans ce cas obligatoire. SYNTAXE: "SR [#msg] [titre]" @@ 14 SC La commande "SC" (SEND COPY) permet de dupliquer un message de la BBS pour l' envoyer a un autre destinataire. Le titre du message est conserve mais precede des mots "CP [destinataire_nouveau] :" pour indiquer que c'est une copie qui a ete faite par vous. SYNTAXE: - "SC [#msg] [indicatif]" copie un message numero "#msg" et l'adresse au destinataire "indicatif". - "SC [#msg] [ATARI]@FRA" copie un message numero "#msg" et le diffuse dans toutes les messageries de France. - "SC [#msg] [ATARI]@[nomBBS]" copie un message numero "#msg" et le depose dans la messagerie "nomBBS". Nota: [nomBBS] s'ecrit sans le SSID (Ex. F6FBB et non F6FBB-1). @@ 14 T La commande "T" (TALK) permet de se connecter a l'Operateur Systeme (SysOp) Il est prevenu par une sonnerie. - Attendez sa reponse avant de frapper votre question. Si le SysOp est disponible, il vous repondra dans la minute et vous pourrez converser. - Sinon, la messagerie vous dira qu'il ne repond pas et vous renverra le prompt et la ligne des commandes. SYNTAXE: "T" @@ 14 U La commande "U" transfere un fichier de CHEZ VOUS VERS la MESSAGERIE. Ce fichier sera alors ecrit dans le repertoire principal du FBBDOS. La commande "U" se frappe apres le prompt de la BBS. Il n'est pas necessaire de passer sous FBBDOS. SYNTAXE: "U [nomfichier.ext]" Nota: La commande inverse (transferer un fichier de FBBDOS VERS CHEZ VOUS est la commande "D". Voir aussi la commande "W". @@ 14 V La commande "V" a 2 fonctions distinctes: 1) elle donne le numero de VERSION de cette BBS, le nombre de messages actifs et le numero du message suivant. SYNTAXE: "V" La commande "V" permet aussi de LIRE les MESSAGES comme la commande "L", mais avec une entete complete comprenant: - La ligne de STATUS - La DATE - Le TITRE du message - Le CHEMIN complet effectue par ce message. SYNTAXE strictement identique aux commandes "R" mais en remplacant le "R" par un "V". Voici la liste des commandes disponibles. Reportez vous a l'aide de la commande "R" pour plus de details: - "V [#msg]" affiche le texte du message numero "#msg". - "VM" lit tous les messages POUR VOUS. - "VN" lit tous les NOUVEAUX messages POUR VOUS. @@ 14 W La commande "W" permet de lister les fichiers qui se trouvent sous FBBDOS sans etre sous FBBDOS. Elle est equivalente a la commande DIR du FBBDOS mais se limite au repertoire principal. SYNTAXE: "W @@ 14 X La commande "X" change alternativement (flip-flop) votre status entre "NORMAL" et "EXPERT". "NORMAL" donne les menus complets. "EXPERT" donne les informations minimales. SYNTAXE: "X" @@ 14 Y La commande "Y" permet de realiser des transferts binaires par le protocole YAPP. Vous devez vous-meme posseder ce programme sur votre ordinateur. La commande "Y" employee seule donne ce texte d'aide. COMMANDES DE TRANSFERT (elles possedent leur propre aide): - "YW" liste les fichiers binaires disponibles. - "YI" liste les fichiers binaires disponibles + leurs infos. - "YN" liste les nouveaux fichiers depuis votre derniere connexion. - "YU Fichier" demarre la procedure d'envoi d'un fichier de CHEZ VOUS VERS LA BBS. Vous ne pouvez pas remplacer ou modifier un fichier deja existant. Repondez aux questions que le programme de transfert vous demande. - "YD Fichier" demarre la procedure d'envoi d'un fichier de la BBS VERS CHEZ VOUS. Repondez aux questions que le programme de transfert vous demande. @@ 14 YW La commande "YW" liste la bibliotheque des fichiers binaires disponibles pouvant etre transferes DE LA BBS VERS VOUS. SYNTAXE: "YW" Cette commande peut etre suivie d'un masque de selection. Les masques sont d'une syntaxe identique a ceux de FBBDOS. Ex : *.ZIP TE*.* etc... SYNTAXE: "YW [masque]" @@ 14 YI La commande "YI" liste comme la commande "YW" la bibliotheque des fichiers binaires disponibles pouvant etre transferes DE LA BBS VERS VOUS mais en fournissant en plus des renseignements sur le contenu de ces fichiers. SYNTAXE: "YI" Cette commande peut etre suivie d'un masque de selection. Les masques sont d'une syntaxe identique a ceux de FBBDOS. Ex : *.ZIP TE*.* etc... SYNTAXE: "YI [masque]" @@ 14 YN La commande "YN" liste uniquement les nouveaux fichiers binaires integres dans la bibliotheque YAPP depuis votre derniere connexion a la BBS. SYNTAXE: "YN" Cette commande peut etre suivie d'un masque de selection. Les masques sont d'une syntaxe identique a ceux de FBBDOS. Ex : *.ZIP TE*.* etc... SYNTAXE: "YN [masque]" @@ 14 YU La commande "YU" demarre la procedure YAPP d'envoi d'un fichier de CHEZ VOUS VERS LA BBS. Vous ne pouvez pas remplacer ou modifier un fichier deja existant. Vous devez vous-meme posseder YAPP sur votre ordinateur. Repondez aux questions que le programme de transfert vous demande. SYNTAXE: "YU [nomfichier.ext]" @@ 14 YD La commande "YD" (YAPP DOWN) demarre la procedure YAPP d'envoi d'un fichier DE LA BBS VERS CHEZ VOUS. Vous devez vous-meme posseder YAPP sur votre ordinateur. Repondez aux questions que le programme de transfert vous demande. SYNTAXE: "YD [nomfichier.ext]" @@ 16 H La commande "G" (GATEWAY) vous permet d'acceder au GATEWAY et d'utiliser la BBS pour vous connecter a une station Packet quelconque sur une des frequences proposees par le Serveur. SYNTAXE: "G" COMMANDES DERIVEES DU GATEWAY (disponibles apres le choix de la frequence): "Q" : Sortie du gateway. "K" : Passage en mode conversation. "C" : Connexion. "D" : Deconnexion. "H" : Aide. "J" : Liste des 20 dernieres stations entendues. Apres avoir selectionne un des ports autorises, une voie vous sera affectee si disponibilite. Cette voie prendra votre indicatif. Le passage en mode conversation se fait automatiquement a la connexion du correspondant et le retour en mode commande se fait a la deconnexion ou par le caractere Esc ou >. Le passage en mode conversation se fait par la commande K. La commande C doit etre suivie de l'indicatif du destinataire et eventuellement de la lettre V suivie d'une liste de repeteurs. SYNTAXE: "C [Destinataire V repet1 repet2 ...] @@ 18 C - La commande C (CONFERENCE) permet d'entrer dans la conference, et d'etablir un QSO a plusieurs. Toute station connectee a la BBS peut y entrer. SYNTAXE: "C" COMMANDES DERIVEES (possedent leur propre aide): - AVANT d'entrer en conference, "CW" liste l'indicatif des conferenciers. "!" liste les utilisateurs actuels de la BBS. - DANS la conference, les commandes disponibles sont differentes: (elles commencent toujours par un point en premiere colonne). ".H" donne ce fichier d'aide. ".W" donne la liste des conferenciers. ".C[port] INDICATIF" permet de connecter un autre utilisateur de la BBS. ".Q" permet de sortir de la conference. fbb-7.0.10/etc/lang/francais.ent.sample0000644000175000017500000000023313613360505014523 00000000000000 ************************************************** Contenu du fichier /etc/ax25/fbb/lang/francais.ent ************************************************** fbb-7.0.10/etc/lang/english.txt0000644000175000017500000003021413613360505013141 00000000000000##################################### # English texts for FBB 7.00 and up # # by LA6CU - revised by Gus I0OJJ # ##################################### # As of Apr 24, 2011 #------------------- English OL: The mailbox will now use English language.$W Yes No SunMonTueWedThuFriSat JanFebMarAprMayJunJulAugSepOctNovDec North South East West $O Mailbox, QTH $c.$W $O BBS, $c.$WHello $I. $N active messages, last is $L, last listed is $Z. $W$WAssigned channels:$W$% $O BBS, QTH $?.$WHello $I, you are now on channel $=.$WHere are $N active messages, $L is last message and $W$Z is the last you have listed.$W$WAssigned channels:$W$%$W Please enter your name, like this : N (your first name).$W Please enter your QTH (not ZIP), like this : NQ (QTH).$W Please enter your HOME BBS, like this : NH (HomeBBS).$W Please enter your ZIP code, like this : NZ (ZIP code).$W $O BBS, $c.$WYou have only limited access on this port.$W Sorry, only BBSs allowed on this port.$W $WThis is your first contact with this BBS.$W $WYou have $0 new (unread) message(s).$W$W $WYou have $0 redundant message(s).$WPlease kill them with KM.$W$W You have been connected $: - Computer time : $.$WBye, $I, and welcome back.$W Multiconnect 'server' type F6FBB V$E - Assigned channels:$W$%$W$N active messages - Last message $L - Last listed $Z.$WThere are new messages for : $Q$WConnect time : $: - Computer time : $.$W ENTER = continue, A = Abort, N = Next, C = remove paging --> Do you want to change anything (Y/N) ? Thank you ...$W $WOutput aborted !!$W$W Create it (Y/N) ? Your choice (L=show the full list, F=End the session) : ENTER = continue, A = Abort, R/V # = Read message # -> *** Error : Your answer is incorrect.$W *** Error : [$0] is not a valid command.$W *** Error : You forgot a space after the command.$W *** Error : Only numeric values are allowed.$W *** Error : Text after callsign is missing.$W *** Sorry, there is no help available for $0.$W *** Error : The 'To' field is missing.$W *** Error : The callsign is missing.$W *** Error : Unknown filename.$W *** Error : The character $0 is not allowed here.$W *** Error : Message #%M does not exist.$W *** Error : Filename $f does not exist.$W *** Error : You cannot kill message #%M.$W *** Error : #%M does not exist.$W *** Error : Invalid port.$W *** Error : Use the CD command.$W *** Error : The field $0 is too long.$W *** Error : The address for $0 is incorrect.$W *** Sorry, you have already downloaded %dkb this period. *** Error : Not found !$W *** Error : The filename is missing.$W *** Error : The 'destination' filename is missing.$W *** Error : Unknown language.$W *** Error : It is impossible to modify the file $f.$W *** Error : The directory $0 is unknown, or not empty.$W *** Error : The directory is missing.$W *** Error : It is impossible to create the directory $0.$W *** Error : The 'path' is missing.$W *** Error : The 'path' is too long.$W *** Error : The 'path' does not exist, or you are not authorized to enter.$W *** Error : It is impossible to create the file $f.$W *** Timeout !!$W ($*) $O BBS>$W ($*) $O BBS (B,H,KM,LM,O,RM,S,T,?) >$W ($*) $O BBS (H for help) >$W There are no such messages (message choice: $l).$W There are no new messages for you.$W Enter the title for this message to %G : $W Enter the text for this message, end with Ctrl-Z or /EX on a blank line) : $W Message #%M has been killed.$W Software F6FBB V$E (%E) - $N active messages - Last message is #$L$W Please enter your first name : Thank you, $I.$W Callsign LastConnect #Cnct RPBSXLFEMUI Name Password PRIV dir.$W $V is not available, you may leave a message for him in the mailbox.$W Wait while I page $V.$W $V did not answer, you may leave a message for him in the mailbox.$W Hello, $I, $V responds:$W Hang on, $V would like to talk to you.$W $WYou are now in 'Expert mode'.$W$W $WYou are now in 'Normal mode'.$W$W You are now in 'Server mode'. Type F to return in BBS mode.$W The file $f has been appended.$W Message for %G has been cancelled (message has no title).$W OP: You will now have no paging.$W OP: You will now have $p lines per page.$W This user is now connected. Editing not allowed.$W $0 $1 $2 $3 $j $K = $4'$5 ON: 'Base number' is now $q. All message numbers will use this as a base.$W (B)id, (F)rom, (V)=@BBS, (T)o, T(I)tle, (S)tatus, T(Y)pe, (CR) finished >$W R,P,B,S,X,L,F,E,M,U,I. (On/Off).$WN name. W passwd. G language no. V priv dir. H HomeBBS. Z zip code. >$W $0 is an unknown callsign. Create it (Y/N) ? Delete $0 (Y/N) ? Available languages:$W ($0):$1 $W --- End of message#: %M from %P to %G ---$W$W Forward status of message #$0:$W From : %P$WTo : %G$0$WType/Status : $t$s$WDate/Time : $j-$a $K$WBID (MID) : $R$W $WMsg# TSLD Size To @Route From Date/Time Subject [LC-choice: $l]$W $M $t$s$r%r $n $G$0 $P $i $1$W Message # : %M$WSubject : $S$W$W(This message has been read %C times so far in this BBS).$W$W Bid (Mid) : $R$W$W Message # %M is sent @ Routing (from $0) to $v.$W F>$W >$W NO - Incorrect parameter.$W N - BID$W OK $W *** Done$W Size: %n bytes$W We have no forwarding route for %A. SYSOP will be advised.$W Your reply will be sent to %G @$v$W OR: Access to all personal messages in the BBS : $0$W OM: Show list of new messages at logon : $0$W Please enter your HomeBBS : Please enter your ZIP code : HomeBBS : $0 ZipCode : $1$W WP has no routing to %G. Press ENTER to abort and re-address.$W $W$0 messages are currently on 'hold'.$W (A)rchive, (K)ill, (L)ocal, (Q)uit, (R)ead, (V)erbose, (U)nhold, finished ? Message accepted and held for sysop revision prior to release.$W *** Busy - Please wait.$W *** Busy - Not possible to make contact right now.$W *** Sorry, $0 is not connected.$W $W$B*** Connected to $0 (End with Ctrl-Z).$W *** Disconnected.$W *** 'Break' from $0 ***$W *** End of 'break' ***$W 'Break' for message from $0.$W Stop request from $0. Code : $1$W Stop request accepted, no connections.$W Reset request accepted, performing initialization.$W ENTER=continue, A=Abort --> Interrupt request rejected.$W You are in BBS mode. Type 'F ' for server mode.$W $W($*) SERVER MENU (C,D,N,Q,T,F,B. ?=help) > $W $W(C) Connections Stat.$W(D) Docs.$W(Q) QTH Locator.$W(N) User data.$W(T) Satellites.$W(F) Return to BBS mode.$W(B) Disconnect.$W$WFor help, type ? (command).$W$WSERVER MENU (C,D,N,Q,T,F,B. ?=help) > $W($*) CONNECTIONS STAT. (G,H,I,J,L,O,F,B. ?=help) > $W $W(G) General$W(H) Use per hour$W(I) List callsigns$W(J) Use per day$W(L) Details$W(O) Percentages$W(F) Return to server menu$W(B) Disconnect$W$WFor detailed help, type ?(letter).$W$WCONNECTIONS STAT. (G,H,I,J,L,O,F,B. ?=help) > Use per day$W MON TUE WED THU FRI SAT SUN$W Use per hour$W 0 0 0 0 0 1 1 1 1 1 2 2 Hour$W 0 2 4 6 8 0 2 4 6 8 0 2$W $N active messages$W # $0 Connects since $j-$a$W Connects$W Average time per connect : $0min $1s$W Average conn. per day : $0$W Rush hours : At $1 and $0 o'clock.$W Usage (in percent)$W BBS : $0 % $W Server : $0 % $W Server details:$W DOS : $0 % $W QTH Locator : $0 % $W Docs : $0 % $W Connections stat : $0 % $W User data : $0 % $W Satellites : $0 % $W $0 $1 $2 $3 $j-$a $K = $4'$5"$W $W($*) USER DATA (I,N,R,F,B. ?=help) > $W $W(R) Read information$W(I) Show list of users$W(N) Change own datas$W(F) Return to SERVER menu.$W(B) Disconnect.$W$WFor detailed help, type ? (command).$W$WUSER DATA (I,N,R,F,B. ?=help) > $WCallsign : $0$W Last connect was $j-$a at $K.$W HomeBBS : $7$WName : $1 $0$WAddress : $2, $8 $3$WQTH Locator : $4. Phone, home: $5; Phone, work: $6$W Please enter your surname : House number and street name : City (without ZIP code !) : Telephone, home : Telephone, work : Please enter your QTH locator: $WTotal $0 callsigns$W *** Callsign $0 is unknown.$W *** Wrong QTH locator.$W $W$W($*) SATELLITES (C,P,T,F,B. ?=help) > $W(M) Update parameters$W $W(C) Descriptions$W(P) Show orbiting parameters$W(T) Calculate orbital data$W(F) Return to SERVER menu$W(B) Disconnect$W$WFor detailed help, type ? (command).$WAfter you have used command C, P or T, send L for list !$W$WSATELLITES (C,P,T,F,B. ?=help) > $WQTH Locator : $0 Satellite $1$W --------------------------------------------------------------$W | Time | Az. | El. | Dpl. | Dist. | Alti. | Lon | Lat | Ph. |$W | UTC | Deg | Deg | KHz | Km | Km | Deg | Deg | 256 |$W --------------- $j-$y ------ Orbit #$0 ----------------$W | $0:$1 | $2 | $3 | $4 | $5 | $6 | $7 | $8 | $9 |$W Enter start date for calculation (day/month/year): Enter start time for calculation (hour:min) : $WPlease wait...$W $WThere is no information available for this satellite.$W Updated on $j-$y.$W Satellite name : Reference orbit : Reference year : Reference day : Mean anomaly : Arg. of perigee : R.A.A.N. : Inclination : Eccentricity : Mean motion : Derived mean motion : Estimated step : Doppler frequency : $WOrbiting parameters for $0$W Orbit number : $0$W Epoch year : $0$W Epoch day : $0$W Mean anomaly : $0$W Arg. of perigee : $0$W R.A.A.N. : $0$W Inclination : $0$W Eccentricity : $0$W Mean motion : $0$W Derived mean motion : $0$W Estimated step : $0$W$W ($0) $1 (F) End$W $W($*) QTH LOCATOR (C,D,L,Q,F,B. ?=help) > $W $W(Q) QTH -> Long. Lat.$W(L) Long. Lat. -> QTH$W(D) Dist. and Azimuth$W(C) Distances$W(F) Return to server menu$W(B) Disconnect$W$WFor detailed help, type ? (command).$W$WQTH LOCATOR (C,D,L,Q,F,B. ?=help) > $WQTH Locator (F,Q=Quit) : Geographical coordinates in the centre of the square :$W Longitude : $0 degrees $1' $2 : $3 gr $2$W Latitude : $0 degrees $1' $2 : $3 gr $2$W $WUse format$WIn degrees : 1:45:00 (direction).$WIn gradians : 1.5 (direction)$W(direction) shall be replaced by North, South, East or West.$W $WLongitude (East/West) (F,Q=Quit) : $WLatitude (North/South) (F,Q=Quit) : $WQTH Locator (F,Q=Quit) : $0$W $WFrom QTH Locator (F,Q=Quit) : $WTo QTH Locator (F,Q=Quit) : Azimuth : $0 degr $1' : $2 gr$W Distance : $0 Km$W $WYour QTH Locator (F,Q=Quit) : $WTo QTH Locator (F,Q=Quit) : Calculation no $0 - Total distance : $1 Km$W Calculation finished.$W $W($*) [%d/%mkb] $u:$0> Directory $0 deleted.$W File does not exist.$W $0 $1 $2 $3 $4 $5 $6 $7$W Download of $f was aborted.$W File $f is saved ($0 bytes, $1 bytes/sec).$W Upload file $f (end with Ctrl-Z).$W $0 bytes copied.$W $W$d-$a $T FBBDOS V$E$W$WFormat :$W(1) = (1 connected station)$W[%d/%mkb] = [downloaded %dkb until now/max allowed %mkb] in this period$WC:\> = drive and path (like in MSDOS)$W $WAvailable FBBDOS commands :$W File $f has been deleted.$W $0 bytes free.$W $W$* connected station(s)$WDOCUMENTATION$0 (Number,L,R,B,F. ?=Help) > $W(D) = For sysop: Description.$W $W(L) = List$W(number) = Read doc number$W(R) = Return to previous level$W(F) = Return to Server menu $W(H H) = More help$W(B) = Disconnect$W$W($*) DOCS$0 (#,L,R,B,F. ?=Help) > Does not exist.$W You are now on channel $=, port $!. $g available ports.$WH = Help. Q = Quit.$W Port number (Q = Quit) : You are now using channel $0 on that port. Frequency: $1.$W No available channels on that port.$W Cmd : Convers mode. Esc or > (return) for command mode.$W *** Error : You are already on this port !$W *** Error : Invalid port number.$W *** Gateway is not available.$W $O: INVALID COMMAND $0. (C,D,J,K,H,M,P,F,CQ,Q.?)$W Sending $f...$W Text capture opened in $f.$W Text capture closed.$W Ready to send $f with $0 protocol.$W Ready to receive $f with $0 protocol.$W Sorry, $0 is not allowed on this port.$W Describe the file, max 40 characters : $0 $1 $2 $3 $4$W You are now in the conference mode (Help = ".H").$W $H. Stations in the conference :$W Callsign : $0, channel $1.$W $H. $0 enters the conference.$W You leave the conference.$W $H. $0 leaves the conference.$W [$H - $0]$W Nobody else in the conference.$W $H. $0 : Retry count exceeded.$W $H. $0 is busy.$W $H. $0 is not in the conference !$W Msg# Dim To From Title (Theme:%T)$W $M%r $n $G $P $1$W %T - %t bulletins (B,F,H,L,R/V #) : fbb-7.0.10/etc/lang/english.ent.sample0000644000175000017500000000026313613360505014371 00000000000000 ********************************************************** This is the content of /etc/ax25/fbb/lang/english.ent file ********************************************************** fbb-7.0.10/etc/lang/english.inf0000644000175000017500000000134713613360505013103 00000000000000 BBS F6FBB-1 - $? - Roquettes (15 Km south Toulouse) : Port 1 : (16 channels) 9600 Bds full duplex link to F6FBB-9 Port 2 : ( 1 channel ) HF access 300 Bds AFSK Port 3 : ( 1 channel ) telephone access 1200-14400 Bds Port 4 : ( 1 channel ) HF access 1200 Bds PSK Micro : PC clone 386 DX 40 cache 128K Ram : 16 MB Disk : 212 MB SCSI Soft : F6FBB release $E Front-end NODE F6FBB-9 : Port 1 : 9600 Bds full duplex link to FE6BEX-9 (430.575/439.975) Port 2 : Users' access 1200 Bds AFSK (145.275) Port 3 : 9600 Bds full duplex link to F6FBB-1 (RS 232) Port 4 : 1200 Bds AFSK link to F6CDD-1 (432.675) Micro : PC clone 386 SX 20 Ram : 2 MB Disk : 360 KB floppy Soft : FPAC 1.1 (ROSE compatible) USERS : $% fbb-7.0.10/etc/bbs.sys0000644000175000017500000000066213613360505011340 00000000000000# BBS forward partner list # Fichier d'affectation de BBS # Do not remove any line # Ne pas supprimer de ligne ! # 01 AMSAT 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80  fbb-7.0.10/etc/cron.sys0000644000175000017500000000034313613360505011527 00000000000000TALK NO YAPP 1 YES YAPP 3 YES IF D 1-5 IF H 6-20 BIP NO ELSE BIP NO ENDIF IF H 17-20 TALK YES ELSE TALK NO ENDIF ELSE IF H 8-20 BIP NO ELSE BIP NO ENDIF IF H 8-20 TALK YES ELSE TALK NO ENDIF ENDIF fbb-7.0.10/etc/amsat.fwd.in0000644000175000017500000000021213613360505012235 00000000000000A AMSAT # P @ # c @localstatedir@/ax25/fbb/sat/amsat.txt # B SAT F SAT F AMSAT F KEP F KEPS F KEPLER G AMSAT # -------- fbb-7.0.10/etc/swapp.sys0000644000175000017500000000017213613360505011720 00000000000000# # #< AUTO7P >FD1NUF # @ EUR EU @ SATGAT >F6FBB > F8IDR @F6FBB > F8BK @F6FBB @ F1RVP @F5KATfbb-7.0.10/etc/themes.sys0000644000175000017500000000147613613360505012063 00000000000000POUBELLE COMPUTER IBM APPLE MAC AMIGA C64 OS2 MSDOS TRUCS SOFTWA UNIX LINUX COMMERCE ACHAT* VENTE* ECH* RECHER SATELLITE AMSAT SAT* UO22 KO23 UOSAT PACSAT DOVE KEP* SPACE RESEAU FPAC* FLEX* RMNC THENET DX *DX* VHF UHF HF SHF QSL* EME CONTES PROPAG DIPLOM SUN IMAGES JPG JPEG GIF IMAG* *FAX* SSTV TECHNIQUE 9600 MODEM TECHNI TRX YAESU ICOM KENWOO ALINCO PYE KENW ATV ATV SATTV GAMES JEUX GAMES SCOUTS SCOUT* DIGEST *DIG BBS FBB RLI REBBS MSYS TCPIP CLUS TPK TPK ASSOCATION REF URC ARRL DARC RASEC EDUCATION EDUC ECOLE SCHOOL fbb-7.0.10/etc/redist.sys0000644000175000017500000000104513613360505012060 00000000000000# # Configuration of the REDIST server # # Route for the local BBS (SP LOCBBS) LOCBBS=F6FBB # Name of the BBS coverage LOCBBS_DESC=F6FBB BBS # #Route(s) for local bulletins (SP LOCAL) LOCAL=F6FBB,F6CDD # Coverage of the local BBS LOCAL_DESC=Toulouse # # Route(s) for regional bulletins (SP REGION) REGION=FMLR # Name of the region REGION_DESC=South-West of France # # Route(s) for national bulletins (SP NATION) NATION=FRA # Name of the country NATION_DESC=France # # Default destination DEFAULT_TO=INFO # # Send a mail to the sysop MAIL_SYSOP=YES #fbb-7.0.10/include/0000755000175000017500000000000013747536100010762 500000000000000fbb-7.0.10/include/Makefile.in0000644000175000017500000002675313747457130012771 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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 = \ crc.h\ fbb_dec.h\ fbb_orb.h\ fbb_var.h\ fmtheaders.h\ global.h\ modem.h\ serv.h\ xfbbX.h\ fbb_conf.h\ fbb_drv.h\ fbb_serv.h\ fbb.xbm\ fortify.h\ md5.h\ pbsv.h\ ufortify.h\ terminal.h\ xfbb.h\ yapp.h 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 include/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu include/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 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: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am 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 tags-am uninstall uninstall-am .PRECIOUS: Makefile # 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: fbb-7.0.10/include/fbb.xbm0000644000175000017500000000301713613360505012140 00000000000000#define fbb_width 48 #define fbb_height 48 static char fbb_bits[] = { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0xff,0xff, 0xe3,0xff,0x7f,0xf8,0xff,0xff,0xe3,0xff,0x7f,0xf8,0xff,0xff,0xe3,0xff,0x7f, 0xe0,0x0f,0xe0,0x03,0x00,0x70,0xe0,0x0f,0x80,0x03,0x00,0x70,0xe0,0x0f,0x80, 0x03,0x00,0x70,0xe0,0x0f,0x00,0x03,0x00,0x70,0xe0,0x0f,0x00,0x00,0x00,0x70, 0xe0,0x0f,0x00,0x00,0x00,0x70,0xe0,0x0f,0xfe,0x3f,0x00,0x70,0xe0,0x0f,0xfc, 0xff,0x00,0x70,0xe0,0x0f,0xfc,0xff,0x00,0x70,0xe0,0x0f,0xf0,0xf8,0x01,0x70, 0xe0,0x0f,0xf0,0xe0,0x01,0x70,0xe0,0x0f,0xf0,0xe0,0x01,0x70,0xe0,0x0f,0xf0, 0xe0,0x01,0x70,0xe0,0x0f,0xf0,0xe0,0x01,0x00,0xe0,0x0f,0xf0,0xe0,0x01,0x00, 0xe0,0x0f,0xf2,0xe0,0x01,0x00,0xe0,0x8f,0xf3,0xe0,0xf9,0x0f,0xe0,0x8f,0xf3, 0xe0,0xf9,0x0f,0xe0,0xff,0xf3,0xe0,0xf1,0x1f,0xe0,0xff,0xf3,0xf8,0x71,0x1e, 0xe0,0xff,0xf3,0xf8,0x71,0x1e,0xe0,0x8f,0xf3,0xff,0x71,0x1c,0xe0,0x0f,0xf2, 0xff,0x70,0x1c,0xe0,0x0f,0xf2,0xff,0x70,0x1c,0xe0,0x0f,0xf0,0xe0,0x71,0x1c, 0xe0,0x0f,0xf0,0xc0,0x77,0x1e,0xe0,0x0f,0xf0,0xc0,0x77,0x1e,0xe0,0x0f,0xf0, 0xc0,0xf7,0x0f,0xe0,0x0f,0xf0,0xc0,0xf7,0x1f,0xe0,0x0f,0xf0,0xc0,0xf7,0x1f, 0xe0,0x0f,0xf0,0xc0,0x77,0x7c,0xe0,0x0f,0xf0,0xc0,0x77,0x70,0xe0,0x0f,0xf0, 0xc0,0x77,0x70,0xe0,0x0f,0xf0,0xc0,0x77,0x70,0xe0,0x0f,0xf0,0xc0,0x77,0x70, 0xe0,0x0f,0xf0,0xc0,0x77,0x70,0xe0,0x0f,0xf0,0xc0,0x77,0x70,0xe0,0x0f,0xf0, 0xe0,0x77,0x7c,0xe0,0x0f,0xf0,0xe0,0x77,0x7c,0xf8,0x3f,0xfc,0xff,0xf1,0x1f, 0xfc,0x7f,0xfe,0xff,0xf8,0x0f,0xfc,0x7f,0xfe,0xff,0xf8,0x0f,0x00,0x00,0x00, 0x00,0x00,0x00}; fbb-7.0.10/include/yapp.h0000644000175000017500000000336013613360505012022 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #define UK 0 #define RR 1 #define RF 2 #define SI 3 #define HD 4 #define DT 5 #define EF 6 #define ET 7 #define NR 8 #define CN 9 #define CA 10 #define RI 11 #define TX 12 #define TM 13 #define AF 14 #define AT 15 #define SN 16 /* Envoie la suite des datas */ #define NUL 0 #define SOH 1 #define STX 2 #define ETX 3 #define EOT 4 #define ENQ 5 #define ACK 6 #define DLE 16 #define NAK 21 #define CAN 24 #define SA 99 /* start */ #define S 0 #define S1 1 #define SH 2 #define SD 3 #define SE 4 #define ST 5 #define R 6 #define RH 7 #define RD 8 #define AB 9 /* abort */ #define CW 10 #define C 11 #define DP 12 /* Etats transitoires */ #define E1 13 #define E2 14 #define E3 15 #define E4 16 #define E5 17 #define E6 18 #define RP 19 /* Reprise de l'envoi */ fbb-7.0.10/include/fortify.h0000644000175000017500000001034513613360505012534 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #ifndef __FORTIFY_H__ #define __FORTIFY_H__ /* * FILE: * fortify.h * * DESCRIPTION: * Header file for fortify.c - A fortified shell for malloc, realloc, * calloc & free * * WRITTEN: * spb 29/4/94 * * VERSION: * 1.0 29/4/94 */ #include #ifdef __cplusplus extern "C" { #endif typedef void (*OutputFuncPtr) (char *); void *Fortify_malloc (size_t size, char *file, unsigned long line); void *Fortify_realloc (void *ptr, size_t new_size, char *file, unsigned long line); void *Fortify_calloc (size_t num, size_t size, char *file, unsigned long line); void Fortify_free (void *uptr, char *file, unsigned long line); char *Fortify_strdup (char *str, char *file, unsigned long line); int Fortify_OutputAllMemory (char *file, unsigned long line); int Fortify_CheckAllMemory (char *file, unsigned long line); int Fortify_CheckPointer (void *uptr, char *file, unsigned long line); int Fortify_Disable (char *file, unsigned long line); int Fortify_SetMallocFailRate (int Percent); int Fortify_EnterScope (char *file, unsigned long line); int Fortify_LeaveScope (char *file, unsigned long line); int Fortify_DumpAllMemory (int scope, char *file, unsigned long line); void *Fortify_m_alloue (size_t size, char *file, unsigned long line); void Fortify_m_libere (void *uptr, unsigned int taille, char *file, unsigned long line); typedef void (*Fortify_OutputFuncPtr) (const char *); Fortify_OutputFuncPtr Fortify_SetOutputFunc (Fortify_OutputFuncPtr Output); #ifdef __cplusplus } #endif #ifndef __FORTIFY_C__ /* Only define the macros if we're NOT in fortify.c */ #ifdef FORTIFY /* Add file and line information to the fortify calls */ #define malloc(size) Fortify_malloc(size, __FILE__, __LINE__) #define realloc(ptr,new_size) Fortify_realloc(ptr, new_size, __FILE__, __LINE__) #define calloc(num,size) Fortify_calloc(num, size, __FILE__, __LINE__) #define free(ptr) Fortify_free(ptr, __FILE__, __LINE__) #define strdup(str) Fortify_strdup(str, __FILE__, __LINE__) #define m_alloue(num) Fortify_m_alloue(num, __FILE__, __LINE__) #define m_libere(ptr, num) Fortify_m_libere(ptr, num, __FILE__, __LINE__) #define Fortify_OutputAllMemory() Fortify_OutputAllMemory(__FILE__, __LINE__) #define Fortify_CheckAllMemory() Fortify_CheckAllMemory(__FILE__, __LINE__) #define Fortify_CheckPointer(ptr) Fortify_CheckPointer(ptr, __FILE__, __LINE__) #define Fortify_Disable() Fortify_Disable(__FILE__, __LINE__) #define Fortify_EnterScope() Fortify_EnterScope(__FILE__, __LINE__) #define Fortify_LeaveScope() Fortify_LeaveScope(__FILE__, __LINE__) #define Fortify_DumpAllMemory(s) Fortify_DumpAllMemory(s,__FILE__, __LINE__) #else /* FORTIFY Define the special fortify functions away to nothing */ #define Fortify_OutputAllMemory() 0 #define Fortify_CheckAllMemory() 0 #define Fortify_CheckPointer(ptr) 1 #define Fortify_Disable() 1 #define Fortify_SetOutputFunc() 0 #define Fortify_SetMallocFailRate(p) 0 #define Fortify_EnterScope() 0 #define Fortify_LeaveScope() 0 #define Fortify_DumpAllMemory(s) 0 #endif /* FORTIFY */ #endif /* __FORTIFY_C__ */ #endif /* __FORTIFY_H__ */ fbb-7.0.10/include/fbb_var.h0000644000175000017500000003526413613360505012462 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #ifdef __linux__ #define far #endif #ifdef __FBBDOS__ extern int _wscroll; extern int directvideo; extern int errno; extern long g_timer; #endif /* Variables globales */ #ifndef PUBLIC #define PUBLIC extern #endif #ifndef MAIN extern tp_ems t_ems[NB_EMS]; #endif /*-- Variables globales ----------------------------------------------*/ #ifdef __linux__ PUBLIC int t_tell; /* decompteur : appel du sysop */ PUBLIC int aff_use; /* Affichage de la memoire disponible */ PUBLIC int time_bcl; /* Temps entre deux broadcast */ PUBLIC int tempo; /* decompteur : environ 18 par seconde */ PUBLIC int all_packets; /* monitoring of all packets */ #endif #ifdef __WINDOWS__ PUBLIC int t_tell; /* decompteur : appel du sysop */ PUBLIC int aff_use; /* Affichage de la memoire disponible */ PUBLIC int time_bcl; /* Temps entre deux broadcast */ PUBLIC int tempo; /* decompteur : environ 18 par seconde */ PUBLIC int win_debug; /* Affichage debug valide */ #endif #ifdef __FBBDOS__ PUBLIC void (*XMSPtr) (void); /* Pointeur sur Extended Memory Manager (XMM) */ PUBLIC unsigned XMSErr; /* Code d'erreur de la derniŠre op‚ration */ PUBLIC XMSRegs Xr; PUBLIC fen *fen_dos; /* Sauvegarde fenetre DOS */ extern int far desqview; /* presence de desqview */ extern int far ton_bip; /* bip de connexion */ extern int far t_tell; /* decompteur : appel du sysop */ extern int far kam_timer; /* Temporisation du KAM */ extern int far tempo; /* decompteur : environ 18 par seconde */ extern int far time_bcl; /* Temps entre deux broadcast */ extern int far attcar; /* Tempo d'attente d'un caractere */ extern int far t_scroll; /* tempo du scroll */ extern int far aff_use; /* Affichage de la memoire disponible */ #endif PUBLIC int editor_request; /* Ask for editor */ PUBLIC int moto; /* endian mode INTEL (R) /MOTOROLA (R) */ PUBLIC unsigned tid; /* Task identifier */ PUBLIC int pactor_scan[NBPORT]; /* Scanning of pactor */ PUBLIC int watchport; /* Port for watchdog */ PUBLIC int accept_connection; /* Accepting connections */ PUBLIC int is_idle; /* No processing is done */ PUBLIC int daemon_mode; /* Indique un mode sans IHM (Linux) */ PUBLIC int EditorOff; /* Etat de l'editeur */ PUBLIC int reply; /* Reponse a un message */ PUBLIC int fast_fwd; /* Cache forward */ PUBLIC int MAXTACHE; /* Time_out de tache */ PUBLIC unsigned prot_fwd; /* Masque des protocoles de fwd */ PUBLIC unsigned w_mask; /* Masque des messages warning */ PUBLIC int debug_on; /* Flag de debuggage */ PUBLIC FILE *debug_fptr; /* Fichier */ PUBLIC char *debug_ptr; /* Pointeur de debuggage */ PUBLIC long sys_disk; /* Free KB of main disk */ PUBLIC long tmp_disk; /* Free KB of temp (BINMAIL) disk */ PUBLIC char mute_unproto; /* Suppression des sujets prives */ PUBLIC char priv_unproto; /* Autorisation unproto (P locaux) */ PUBLIC char ack_unproto; /* Autorisation unproto (ACK) */ PUBLIC char via_unproto; /* Autorisation unproto (Messages transit) */ PUBLIC unsigned std_header; /* Type de header utilise */ PUBLIC unsigned BufSeg; /* Segment reel de la memoire partagee TSR */ PUBLIC unsigned BufSel; /* Select protege de la memoire partagee TSR */ PUBLIC char *BufReel; /* pointeur du segment partage reel/protege */ PUBLIC int miniserv; /* Acces aux rubriques */ PUBLIC int deflang; /* Langue par defaut */ PUBLIC int multi_prive; /* Multi-forwarding des prives */ PUBLIC int mail_ch; /* Canal de l'import/export */ PUBLIC int def_time_bcl; /* Temps minimum entre deux listes */ PUBLIC long nb_unproto; /* Nb de messages en arriere en liste UI */ PUBLIC int dde_wp_serv; /* demande de traitement du serveur WP */ PUBLIC int nb_ovr; /* Nombre de pages de la gestion d'overlay */ PUBLIC int stop_min; /* Minute de la demande d'arret */ PUBLIC int max_yapp; /* Maximum de transfert autorise en YAPP */ PUBLIC int max_mod; /* Maximum de transfert autorise en MODEM */ PUBLIC int num_semaine; /* Numero de la semaine durant la session */ PUBLIC unsigned in_exms; /* Donnees chargees en EMS-XMS */ PUBLIC char admin[8]; /* Indicatif de l'administrateur */ PUBLIC Msysop *mess_sysop; /* Indicatifs des messages sysop */ PUBLIC int FOND_VOIE, INIT, CONS, DEF, INDIC, VOIE; PUBLIC int SEND, RECV, UI, HEADER, STA, TOUR; PUBLIC int MWARNING;; /* Voie des messages warning */ PUBLIC unsigned long mem_alloue; /* Taille de la memoire allouee */ PUBLIC unsigned long tot_mem; /* Taille du bloc disponible */ PUBLIC unsigned BLK_TO; /* Time out blankscreen */ PUBLIC unsigned blank; /* Compteur blankscreen */ PUBLIC int video_off; /* Validation ecran */ PUBLIC int test_fichiers; /* Demande le test des fichiers systeme */ PUBLIC int console; /* Presence de la console */ PUBLIC int canaff; /* Canal a d'afficher */ PUBLIC int winlig; /* Nombre de lignes de la fenetre */ PUBLIC int editor; /* Console en mode editeur */ PUBLIC int ems_aut; /* Autorise l'utilisation d'EMS */ PUBLIC int internal_int; /* Interruption interne du drsi */ PUBLIC int tf_int; /* Interruption interne du tfpcx */ PUBLIC int bpq_deconnect; /* Mode de deconnexion du BPQ */ PUBLIC int test_message; /* Procedure de test message */ PUBLIC int NBVOIES; /* Nombre de voies allouees */ PUBLIC int balbul; /* Indicatifs bulletins dans la balise */ PUBLIC unsigned def_mask; /* Masque par defaut a la 1ere connexion */ PUBLIC int niveau; /* Niveau de test dans forward */ PUBLIC int comlog; /* Log complet */ PUBLIC int msg_cons; /* Nb de messages nouveaux pour la console */ PUBLIC int hold_cons; /* Nb de messages retenus pour la console */ PUBLIC int ch_fen; /* Modification de la position des fenetres */ PUBLIC int nb_hold; /* Nombre de messages "held" */ PUBLIC int direct; /* Type d'acces a l'ecran */ PUBLIC int backscroll; /* Ecran en backscroll */ PUBLIC int doubl; /* Nb de fenetres possibles actives */ PUBLIC int cnf_prec; /* Voie du dernier qui a parle */ PUBLIC int type_sortie; /* Fin du programme (0 = Arret 1 = reboot) */ PUBLIC int save_fic; /* Demande de fin de programme */ PUBLIC int ptype; /* Type de paquet recu en protocole Yapp */ PUBLIC int nb_trait; /* Nb de caracteres a traiter */ PUBLIC int aut_ui; /* Autorise la lecture des ui */ PUBLIC int maxbbid; /* Nombre de BIDs en fichier */ PUBLIC int d_blanc; /* Dernier blanc rencontre dans la ligne */ PUBLIC int DEBUG; /* TRUE = pas d'entrees sorties vers TNC2 */ PUBLIC int fbb_fwd; /* Flag autorisation forward type FBB */ PUBLIC int bin_fwd; /* Flag autorisation forward binaire */ PUBLIC int print; /* TRUE = imprimante valide */ PUBLIC int maxlang; /* Nombre de langues disponibles */ PUBLIC int NBLANG; /* Nombre de langues statiques */ PUBLIC int lastaff; /* Derniere voie affichee */ PUBLIC int vlang; /* Numero buffer utilisee sur la voie en traitement */ PUBLIC int nlang; /* Langue utilisee sur la voie en traitement */ PUBLIC int time_n; /* Time_out pour user normal */ PUBLIC int time_b; /* Time_out pour forward */ PUBLIC int nb_error; /* Nbre d'erreurs TNC */ PUBLIC int hour_time; /* Indicateur de l'heure */ PUBLIC int new_om; /* premiere connexion */ PUBLIC int temp_sec; /* Cadence de la seconde (19 tempo) */ PUBLIC int v_tell; /* voie connectee avec le sysop. - 0 : libre */ PUBLIC int son; /* duree de la tonalite d'appel */ PUBLIC int operationnel; /* Phase d'initialisations */ PUBLIC int snd_io; /* TRUE = en entree-sortie */ PUBLIC int port; /* Numero du port RS232 en traitement */ PUBLIC short bip; /* Vrai si bip de connexion */ PUBLIC short ok_tell; /* autorisation de l'appel */ PUBLIC short ok_aff; /* affichage de l'indicatif */ PUBLIC short separe; /* position de la separation des fenetres */ PUBLIC short doub_fen; /* mode de visualisation des fenetres */ PUBLIC short gate; /* Autorisation d'utilisation du gateway */ PUBLIC short just; /* Justification de la console */ PUBLIC short sed; /* Usage du fullscreen editor */ PUBLIC short aff_inexport; /* Affichage du canal import/export */ PUBLIC short aff_popsmtp; /* Affichage du port POP/SMTP */ PUBLIC ushort p_forward; /* pointeur de mise a jour du forward */ PUBLIC int voiecur; /* voie courante */ PUBLIC int af_voie[NBLIG]; /* position de la ligne d'affichage */ PUBLIC int v_aff; /* Numero de la voie a afficher */ PUBLIC int let_prec; /* Etat d'affichage du status */ PUBLIC int arret; /* etat du serveur */ PUBLIC int stat_fwd; /* status de forwarding */ PUBLIC int trait_time; /* temps de traitement */ PUBLIC int t_balise[NBPORT]; /* temporisation balise */ PUBLIC int cmd_fct; /* touche de fonction demandee */ PUBLIC int inexport; /* Import-export de fichiers */ PUBLIC int EGA; /* Type de carte video utilise */ PUBLIC int h_screen; /* Hauteur de l'ecran */ PUBLIC int h_maint; /* Heure de maintenance */ PUBLIC int stype; /* Type d'ecran demande */ PUBLIC int max_indic; /* Nombre d'indicatifs dans la balise */ PUBLIC unsigned rinfo; /* nb. enr. INF.DAT */ PUBLIC long nb_jour_val; /* nb de jours pour bulletin valide */ PUBLIC long nomess; /* no du dernier message */ PUBLIC long nbmess; /* nb de messages en instance */ PUBLIC long t_appel; /* date de mise a jour de OPTIONS.SYS */ PUBLIC long t_bbs; /* date de mise a jour de BBS.SYS */ PUBLIC long t_rej; /* date de mise a jour de REJET.SYS */ PUBLIC long t_swap; /* date de mise a jour de SWAPP.SYS */ PUBLIC long t_thm; /* date de mise a jour de THEMES.SYS */ PUBLIC long *time_include; /* date de mise a jour de FORWARD.SYS */ PUBLIC int include_size; /* Longueur de la table FORWARD.SYS */ PUBLIC unsigned d_droits; /* droits de tous */ PUBLIC unsigned ds_droits; /* droits sysop */ PUBLIC unsigned dss_droits; /* droits sysop + cmde SYS */ PUBLIC long timeprec; /* Test des temps */ PUBLIC long stemps[NBRUB]; /* Temps d'occupation par rubrique */ PUBLIC char wp_line[258]; /* Ligne d'envoi des messages White Pages */ PUBLIC char msg_header[257]; /* Header du message */ PUBLIC char *indd; /* index du tableau data */ PUBLIC char mycall[10]; /* indicatif du serveur */ PUBLIC char mypath[40]; /* path du serveur */ PUBLIC int myssid; /* SSID du serveur */ PUBLIC char txtfwd[52]; /* texte entete forwarding */ PUBLIC char qra_locator[9]; /* Qra locator du serveur */ PUBLIC char *varx[10]; /* Variables de calcul */ PUBLIC char DATADIR[80]; /* Path des fichiers donnees du serveur */ PUBLIC char CONFDIR[80]; /* Path des fichiers conf du serveur */ PUBLIC char MESSDIR[80]; /* Path des fichiers message du serveur */ PUBLIC char MBINDIR[82]; /* Path des fichiers message binaires du serveur */ PUBLIC char PATH[NB_PATH][80]; /* Path des utilisateurs DOS */ PUBLIC char YAPPDIR[82]; /* Path des utilisateurs YAPP */ PUBLIC char DOCSDIR[82]; /* Path des Fichiers DOC */ PUBLIC char PGDIR[82]; /* Path des Programmes PG */ PUBLIC char FILTDIR[82]; /* Path des Programmes filtre */ PUBLIC char SERVDIR[82]; /* Path des Programmes serveur */ PUBLIC char TOOLDIR[82]; /* Path des Outils FWD, CRON, etc... */ PUBLIC char MAILIN[82]; /* Fichier courrier entrant */ PUBLIC char LOCK_IN[82]; /* Fichier de verrou du courrier entrant */ PUBLIC char BBS_UP[80]; /* Script BBS_UP */ PUBLIC char BBS_DW[80]; /* Script BBS_DW */ PUBLIC char my_call[7]; /* Indicatif du Sysop */ PUBLIC char my_name[80]; /* Prenom du Sysop */ PUBLIC char my_city[20]; /* Ville domicile */ PUBLIC char my_zip[10]; /* Zip du serveur */ PUBLIC char data[DATABUF + 1]; /* buffer de donnees recues */ PUBLIC char io_fich[257]; /* Nom du fichier import-export */ PUBLIC char pop_host[41]; /* Hostname for POP session */ PUBLIC char *nomlang; /* Nom des fichiers langue */ PUBLIC tlang **langue; PUBLIC char Oui; /* Caractere 'O' */ PUBLIC char Non; /* Caractere 'N' */ PUBLIC indicat cons_call; /* Indicatif de la console */ PUBLIC unsigned fwd_size; /* Taille du buffer forward */ PUBLIC char *fwd_file; /* Pointeur du buffer forward */ PUBLIC char *fwd_scan; /* Pointeur courant du buffer forward */ PUBLIC unsigned rej_size; /* Taille du buffer rejet */ PUBLIC char *rej_file; /* Pointeur du buffer rejet */ PUBLIC char *rej_scan; /* Pointeur courant du buffer rejet */ PUBLIC unsigned swap_size; /* Taille du buffer swap */ PUBLIC char *swap_file; /* Pointeur du buffer swap */ PUBLIC char *swap_scan; /* Pointeur courant du buffer swap */ PUBLIC bloc_indic *racine; /* debut de la liste d'indicatifs */ PUBLIC bloc_mess *tete_dir; /* tete de la liste de directory */ PUBLIC iliste t_iliste; /* tete de la liste des indicatifs de messages */ PUBLIC iliste *p_iliste; /* pointeur sur la liste des indic_messages */ PUBLIC pglist *tete_pg; /* Tete de la liste des pg */ PUBLIC serlist *tete_serv; /* Tete de la liste des serveurs */ PUBLIC lfwd *tete_fwd; /* tete de la liste forward */ PUBLIC ind_noeud def_cur; /* Noeud null */ PUBLIC int com_error; PUBLIC int old_com_error; PUBLIC defport *p_port; /* parametres des ports */ PUBLIC defcom *p_com; /* parametres des COMs */ PUBLIC int time_att[MAXVOIES + 1]; /* Time out des voies */ PUBLIC int time_yapp[MAXVOIES + 1]; /* Time out YAPP */ PUBLIC Hroute *throute; /* Tete de la liste des maj */ PUBLIC Broute *tbroute; /* Tete de la liste des blocs */ PUBLIC int h_ok; /* Validation HRoutes */ PUBLIC int info_ok; /* Demande obligatoire d'infos */ PUBLIC FScreen winbuf; PUBLIC FScreen conbuf; PUBLIC FScreen monbuf; PUBLIC Svoie *svoie[TOTVOIES]; /* Structures des voies */ PUBLIC Svoie *pvoie; /* Pointeur de la voie courante */ PUBLIC bullist *ptmes; /* Pointeur du message courant */ PUBLIC FILE *log_ptr; /* File ptr du log */ PUBLIC cbuf buf_kb; /* buffer clavier */ PUBLIC cbuf buf_md; /* buffer modem */ PUBLIC char *bid_ptr; /* pointeur du tableau BIDs */ PUBLIC char *bbs_ptr; /* pointeur du tableau BBSs */ PUBLIC FILE *file_prn; /* Fichier d'impression */ fbb-7.0.10/include/fbb_drv.h0000644000175000017500000000713413613360505012460 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * Declaration des fonctions drivers */ #define STA_DRV 0 #define SND_DRV 1 #define RCV_DRV 2 #define OPN_DRV 3 #define CLS_DRV 4 #define TYP_DRV 5 /* * Drivers WA8DED */ int sta_ded (int, int, int, void *); int snd_ded (int, int, int, char *, int, Beacon *); int rcv_ded (int *, int *, int *, char *, int *, ui_header *); int opn_ded (int, int); int cls_ded (int); /* * Drivers PK232 */ int sta_aea (int, int, int, void *); int snd_aea (int, int, int, char *, int, Beacon *); int rcv_aea (int *, int *, int *, char *, int *, ui_header *); /* * Drivers BPQ */ int sta_bpq (int, int, int, void *); int snd_bpq (int, int, int, char *, int, Beacon *); int rcv_bpq (int *, int *, int *, char *, int *, ui_header *); /* * Drivers KAM */ int sta_kam (int, int, int, void *); int snd_kam (int, int, int, char *, int, Beacon *); int rcv_kam (int *, int *, int *, char *, int *, ui_header *); /* * Drivers MODEM */ int sta_mod (int, int, int, void *); int snd_mod (int, int, int, char *, int, Beacon *); /* * Drivers TCP */ #if defined(__WINDOWS__) int sta_tcp (int, int, int, void *); int snd_tcp (int, int, int, char *, int, Beacon *); int rcv_tcp (int *, int *, int *, char *, int *, ui_header *); #elif defined(__linux__) int sta_tcp (int, int, int, void *); int snd_tcp (int, int, int, char *, int, Beacon *); int rcv_tcp (int *, int *, int *, char *, int *, ui_header *); int opn_tcp (int, int); int cls_tcp (int); #endif /* * Drivers SOCKET */ #ifdef __linux__ int sta_sck (int, int, int, void *); int snd_sck (int, int, int, char *, int, Beacon *); int rcv_sck (int *, int *, int *, char *, int *, ui_header *); int opn_sck (int, int); int cls_sck (int); #endif /* * Drivers AGW */ #ifdef __WINDOWS__ int sta_agw (int, int, int, void *); int snd_agw (int, int, int, char *, int, Beacon *); int rcv_agw (int *, int *, int *, char *, int *, ui_header *); int opn_agw (int, int); int cls_agw (int); #endif /* * Drivers HostMode PTC-II */ int sta_hst (int, int, int, void *); int snd_hst (int, int, int, char *, int, Beacon *); int rcv_hst (int *, int *, int *, char *, int *, ui_header *); int opn_hst (int, int); int cls_hst (int); /* * Drivers Flexnet */ #if defined(__WINDOWS__) || defined(__FBBDOS__) int sta_flx (int, int, int, void *); int snd_flx (int, int, int, char *, int, Beacon *); int rcv_flx (int *, int *, int *, char *, int *, ui_header *); int opn_flx (int, int); int cls_flx (int); #endif /* * Drivers POP */ #if defined(__linux__) int sta_pop (int, int, int, void *); int snd_pop (int, int, int, char *, int, Beacon *); int rcv_pop (int *, int *, int *, char *, int *, ui_header *); int opn_pop (int, int); int cls_pop (int); #endif fbb-7.0.10/include/fbb_conf.h0000644000175000017500000000220513613360505012604 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ int read_fbb_conf(char *pathname); char *find_fbb_conf(char *key, int next); char *def_fbb_conf(char *key); char *get_fbb_all(int next); char *get_fbb_def(int next); void free_fbb_conf(void); fbb-7.0.10/include/Makefile.am0000644000175000017500000000035313613360505012733 00000000000000EXTRA_DIST = \ crc.h\ fbb_dec.h\ fbb_orb.h\ fbb_var.h\ fmtheaders.h\ global.h\ modem.h\ serv.h\ xfbbX.h\ fbb_conf.h\ fbb_drv.h\ fbb_serv.h\ fbb.xbm\ fortify.h\ md5.h\ pbsv.h\ ufortify.h\ terminal.h\ xfbb.h\ yapp.h fbb-7.0.10/include/md5.h0000644000175000017500000000440613613360505011540 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* MD5.H - header file for MD5C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include /* MD5 context. */ typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ uchar buffer[64]; /* input buffer */ } MD5_CTX; void MD5Init PROTO_LIST ((MD5_CTX *)); void MD5Update PROTO_LIST ((MD5_CTX *, uchar *, unsigned int)); void MD5Final PROTO_LIST ((uchar [16], MD5_CTX *)); fbb-7.0.10/include/modem.h0000644000175000017500000000432613613360505012155 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* Extensions au driver WINDOWS comm.drv */ #define SETECHO 12 #define CLRECHO 13 #define SETSTAR 14 #define INQUE 16384 #define OUTQUE 16384 #define INT14 0x14 /* Emission */ #define XS_INIT 0 #define XS_SEND 1 #define XS_WAIT 2 #define XS_END 3 #define XS_QUEUE 10 #define XS_EXTERN 11 /* Reception */ #define XR_INIT 4 #define XR_LABL 5 #define XR_RECV 6 #define XR_END 7 #define XR_EXTERN 12 /* Communes */ #define XM_ABORT 8 /* Zmodem */ #define ZS_FILE 9 /* Constantes */ #define NUL 0 #define SOH 1 #define EOT 4 #define ACK 6 #define NAK 21 #define CAN 24 /* Macros */ #define xmodem_off(voie) xmodem_mode(0x00, voie) #define xmodem_tx_on(voie) xmodem_mode(0x01, voie) #define xmodem_rx_on(voie) xmodem_mode(0x02, voie) #define xmodem_fin(voie) xmodem_mode(0x04, voie) #define xmodem_tx_1k(voie) xmodem_mode(0x05, voie) #define ymodem_tx_on(voie, type) xmodem_mode((type) ? 0x07 : 0x06, voie) /* Constantes ZModem */ #define ZRQINIT 0 #define ZRINIT 1 #define ZSINIT 2 #define ZACK 3 #define ZFILE 4 #define ZSKIP 5 #define ZNAK 6 #define ZABORT 7 #define ZFIN 8 #define ZRPOS 9 #define ZDATA 10 #define ZEOF 11 #define ZFERR 12 #define ZCRC 13 #define ZCHALL 14 #define ZCOMPL 15 #define ZCAN 16 #define ZFREEC 17 #define ZCOMM 18 #define ZSTDERR 19 fbb-7.0.10/include/fbb_dec.h0000644000175000017500000013434713660542546012440 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #ifdef __cplusplus extern "C" { #endif #ifdef __linux__ extern char *back2slash (char *); extern char *get_nextparam(void); extern char *getcurdir (int drive, char *str); extern char *GetUserInfo(char *call, int *nLen); extern char *GetMsgInfo(char *numero, int *nLen); extern char *itoa (int, char *, int); extern char *ltoa (long, char *, int); extern char *MessPath (void); extern char *slash2back (char *); extern char *ultoa (unsigned long, char *, int); extern char *StartForward(int numbbs); extern char *StopForward(int numbbs); extern char *long_filename(char *path, char *filename); extern int call_dll (char *cmd, int mode, char *buffer, int len, char *data); extern int call_nbdos (char **cmd, int nb_cmd, int mode, char *log, char *dir, char *data); extern int check_passwd (char *call, char *pass); extern int default_tty(int com); extern int DelUserInfo(char *call); extern int end_xfbb_edit (void); extern int fnsplit (char *name, char *drive, char *rep, char *base, char *ext); extern int fbb_ax25_config_load_ports (void); extern int fbb_list (int); extern int fbb_nr_config_load_ports (void); extern int fbb_rs_config_load_ports (void); extern int fbb_statfs (char *filename, struct statfs *buf); extern int findfirst (char *rech, struct ffblk *blk, int mask); extern int findnext (struct ffblk *blk); extern int filter (char *ligne, char *buffer, int len, char *data, char *xdir); extern int getdisk (void); extern int GetFileNameDialog (char *); extern int getftime (int fd, struct ftime *ft); extern int GetMsgInfos (bullist * plig, long numero); extern int GetUserInfos (char *callsign, info * frec); extern int initcom_linux (int com); extern int init_pfh (void); extern int is_cdir (int chr); extern int is_cmd (int voie); extern int linux_port (int port, int canal); extern int nbcan_linux (void); extern int NewUserInfo(char *call); extern int play (char *name); extern int PutMsgInfo(char *number, char *buf, int nLen); extern int PutUserInfo(char *call, char *buf, int nLen); extern int random_nb (int num); extern int SetMsgInfo (bullist * plig, long numero); extern int SetUserInfos (char *callsign, info * frec); extern int xfbb_edit (void); extern long filelength (int fd); extern unsigned long free_disk (int disk); extern void add_pfh(bullist *pbul); extern void AddMessageList (char *number); extern void AddPendingLine (char *call, int priv, int bull, int kb); extern void AddUserLang (char *lang); extern void AddUserList (char *callsign); extern void CloseFbbWindow (int numero); extern void CmdCHO(int port, int val); extern void CmdScan(int port, int val); extern void CompressPosition (int mode, int val, long numero); extern void console_inbuf (char *, int len); extern void deb_io (void); extern void disconnect_channel (int channel, int immediate); extern void DisplayResync (int port, int nb); extern void dump_core(void); extern void exec_cmd (cmdlist * cptr); extern void fbb_quit (unsigned retour); extern void FbbMem (int); extern void FbbRequestMessageList (void); extern void FbbRequestUserList (void); extern void FbbStatus (char *callsign, char *texte); extern void fin_io (void); extern void format_ffblk (struct ffblk *blk, struct dirent *dir); extern void InfoMessage (int, char *, char *); extern void InitText (char *); extern void justifie (uchar *); extern void kill_rzsz (int voie); extern void maj_menu_options (void); extern void orb_options(void); extern void orb_info(int val, char *str); extern void orb_pactor_status(int port, int p_status); extern void orb_con_list (int channel, char *ligne); extern void orb_con_nb (int nb); extern void orb_disc (void); extern void orb_nb_msg (int priv, int hold, int nbmess); extern void orb_status (long lmem, long gmem, long disk1, long disk2); extern void orb_write (int channel, char *data, int len, int color, int header); extern void pbsv (void); extern void randomize (void); extern void RequestPendingForward(char *datafile); extern void RequestMsgsList(char *datafile); extern void RequestUsersList(char *datafile); extern void reset_msgs (void); extern void set_info_channel(int channel); extern void set_win_colors (void); extern void ShowError (char *titre, char *info, int lig); extern void SpoolLine (int voie, int attr, char *data, int lg); extern void sysop_call (char *texte); extern void sysop_end (void); extern void user_status (int voie); extern void win_msg_cons (int priv, int hold); extern void win_status (char *txt); extern void WinDebug (char *fmt,...); extern void window_connect (int numero); extern void window_disconnect (int numero); extern void window_init (void); extern void window_write (int numero, char *data, int len, int color, int header); extern void WinMessage (int temps, char *text); extern void WinMSleep (unsigned milliseconds); extern void WinSleep (unsigned seconds); #endif #ifdef __WINDOWS__ /* Declarations de prototypes specifiques Windows */ extern void WinDebug (char *fmt,...); extern char *win_memo (int); extern char *xmodem_str (int voie, char *s); extern char *yapp_str (int voie, char *s); extern char *abin_str (int voie, char *s); extern char *ffwd_str (int voie, char *s); extern char *xfwd_str (int voie, char *s); extern int call_dll (char *cmd, int mode, char *buffer, int len, char *data); extern int call_nbdos (char **cmd, int nb_cmd, int mode, char *log, char *dir, char *data); extern int editor_on (void); extern int fbb_exec (char *commande); extern int fbb_list (void); extern int filter (char *ligne, char *buffer, int len, char *data); extern int GetCommStatus (int nCid); extern int get_win_lig (int numero); extern int in_comm (int port, char *buf, int nb); extern int initcom_windows (int, int, int, int); extern int out_comm (int port, char *buf, int nb); extern int tcp_busy (int voie); extern int wcprintf (char *format,...); extern int win_edit (void); extern int win_inittnc (HWND hWnd); extern int WindowService (void); extern int wputch (char carac); extern DWORD dos2rgb (int couleur); extern void AddList (int canal, char *callsign); extern void AddListFwd (int mode, char *bbs); extern void AddMessageList (char *number); extern void AddPendingLine (char *call, int priv, int bull, int kb); extern void AddUserList (char *callsign); extern void AddUserLang (char *langue); extern void closecom_windows (int); extern void CloseFbbWindow (int numero); extern void CompressPosition (int mode, int val, long numero); extern void console_inbuf (char *, int len); extern void CreateTtyWindow (HWND, HINSTANCE, int, char *, int); extern void CreateConsWindow (HWND, HINSTANCE, char *, int); extern void CreateCommWindow (HWND, HINSTANCE, int); extern void ded_init_tnc (int); extern void disconnect_channel (int channel, int immediate); extern void DisplayResync (int port, int nb); extern void end_win_edit (void); extern void EndResync (void); extern void fbb_quit (unsigned retour); extern void FbbMem (void); extern void FbbStatus (char *callsign, char *texte); extern void free_socket (int port); extern void InfoMessage (int temps, char *text, char *message); extern void init_socket (int port); extern void InitText (char *text); extern void m_libere (void *ptr, unsigned int taille); extern void maj_menu_options (void); extern void n_cpy (int longueur, char *dest, char *orig); extern void read_tnc (void); extern void ded_resynchro (int); extern void select_con (int voie); extern void send_tnc_windows (int, int); extern void SendEchoCmd (char *buf, int lg); extern void set_option (int); extern void set_win_colors (void); extern void ShowComm (void); extern void ShowError (char *titre, char *text, int val); extern void ShowMessage (unsigned int type, char *text); extern void SpoolLine (int voie, int attr, char *data, int lg); extern void strn_cpy (int longueur, char *dest, char *orig); extern void sysop_call (char *texte); extern void sysop_end (void); extern void user_status (int voie); extern void win_cree_bid (HWND); extern void win_init_bbs (HWND); extern void win_init_admin (HWND hWnd); extern void win_copyright (HWND hWnd); extern void win_cree_bid (HWND hWnd); extern void win_execute (char *buffer); extern void win_initialisations (HWND hWndParent, HINSTANCE hInstance, int cmdShow); extern void win_initexte (HWND hWnd); extern void win_initport (HWND hWnd); extern void win_msg_cons (int priv, int hold); extern void win_status (char *txt); extern void win_time_out (int temps); extern void WinDebug (char *fmt,...); extern void window_connect (int numero); extern void window_disconnect (int numero); extern void window_init (void); extern void window_write (int numero, char *data, int len, int color, int header); extern void WinMessage (int temps, char *text); extern void WinMSleep (unsigned milliseconds); extern void WinSleep (unsigned seconds); extern void WriteConsBuf (char *, int, COLORREF); extern void WriteLine (int, char *, int); #endif #ifdef __FBBDOS__ extern int call_dll (char *cmd, int mode, char *buffer, int len, char *data); extern void close_win (fen *); extern void dump_core (void); extern void end_dll (void); extern void fen_libere (fen *); extern void gettext_info (struct text_info *); extern void gettxt (int, int, int, int, void *); extern void puttext_info (struct text_info *); extern void puttxt (fen *); extern void wr_scr (FScreen *, Ligne *, int); extern Ligne *sel_scr (FScreen *, int); #endif extern atfwd *attend_fwd (int, uchar, uchar, uchar, int); extern bloc_indic *new_bloc_info (void); /* System timer management */ extern FbbTimer *add_timer (int, int, void *, void *); extern int del_timer (FbbTimer *); extern bloc_mess *last_dir (void); extern bloc_mess *new_bloc_mess (void); extern bloc_mess *prec_dir (bloc_mess *); extern bullist *ch_record (bullist *, long, char); extern char extind (char *, char *); extern char *abin_str (int voie, char *s); extern char *alt_variable (char); extern char *bbs_via (char *); extern char *ch_slash (char *); extern char *ch_slash (char *); extern char *check_dates (time_t date); extern char *comp_bid (char *); extern char *copy_name (int, char *); extern char *cr_to_lf (char *); extern char *cur_theme (int); extern char *date (void); extern char *date_mbl (long); extern char *datheure_mbl (long); extern char *dir_date (int); extern char *c_disque (char *); extern char *d_disque (char *); extern char *d_sauve (char *); extern char *d_yapp (char *); extern char *epure (char *, int); extern char *expand (char *); extern char *extend_bbs (char *); extern char *fbb_fgets (char *, int, FILE *); extern char *ffwd_str (int voie, char *s); extern char *first_group (void); extern char *get_group_info(char *nom, char *buffer); extern char *heure_mbl (long); extern char *hold_name (long, char *); extern char *idnt_fwd (void); extern char *k_var (void); extern char *lf_to_cr (char *); extern char *lfile (char *); extern char *ligne (FILE *); extern char *local_path (char *); extern char *make_header (bullist *, char *); extern char *mess_name (char *, long, char *); extern char *mk_passwd (char *chaine); extern char *mot (char *); extern char *new_bloc (int); extern char *next_group (void); extern char *nom_yapp (void); extern char *os (void); extern char *pop_date(long date); extern char *sel_bloc (int, int); extern char *snbgen (void); extern char *snbpers (void); extern char *snd_passwd (char *); extern char *stat_voie (int); extern char *strdate (long); extern char *strdt (long); extern char *strflags (info * frec); extern char *strheure (long); extern char *strjour (long); extern char *strmois (long); extern char *sup_ln (char *); extern char *task_name (int); extern char *temp_name (int, char *); extern char *titre_rubrique (int); extern char *tot_path (char *, char *); extern char *typ_exms (void); extern char *variable (char); extern char *var_txt (char *); extern char *var_crlf (char *); extern char *version (void); extern char *vir_path (char *); extern char *who (char *); extern char *xfwd_name (int voie, char *tempname); extern char *xfwd_str (int voie, char *s); extern char *xmodem_str (int voie, char *s); extern char *xuidl(long numero, char *callsign); extern char *yapp_str (int voie, char *s); #ifdef __FBBDOS__ extern fen *create_win (int, int, int, int); extern fen *fen_alloue (unsigned int); extern fen *open_win (int, int, int, int, int, char *); #endif extern FILE *cree_mess (long); extern FILE *fappend (char *, char *); extern FILE *fbb_fopen (char *, char *); extern FILE *fsopen (char *, char *); extern FILE *ouvre_dirmes (void); extern FILE *ouvre_menu_info (void); extern FILE *ouvre_mess (unsigned, long, char); extern FILE *ouvre_nomenc (void); extern FILE *ouvre_sat (void); extern FILE *ouvre_stats (void); extern float t_compute (void); extern ind_noeud *insnoeud (char *, unsigned *); extern ind_noeud *cher_noeud (char *); extern indicat *get_indic (char *); extern int accept_cnx (void); extern int ack_suiv (int); extern int actif (int); extern int addr_check (char *); extern int aff_etat (int); extern int affich_cond (info *); extern int affiche_annonce (void); extern int affiche_forward (int); extern int affiche_liste_fwd (int); extern int affiche_message (void); extern int affiche_texte_annonce (void); extern int affiche_texte_message (void); extern int affnbgen (void); extern int affnbmess (void); extern int affnbpers (void); extern int affniv (int); extern int aff_ack (int); extern int aff_bbs (char *, char *); extern int aff_nbsta (void); extern int aff_tell (int, char *); extern int aff_yapp (int); extern int already_forw (char *, int); extern int appel_pg (char *); extern int appel_rev_fwd (int); extern int appel_serveur (serlist *, bullist *); extern int attcurs (void); extern int attend_ack (int *); extern int attend_caractere (int); extern int attprompt (int, int); extern int attrib (int); extern int attrib_r (int); extern int attrib_b (int); extern int att_ligne (void); extern int att_prompt (void); extern int aut_bbs (char *); extern int aut_dir (char *, char *); extern int aut_ecr (char *, int); extern int bin_message (rd_list *); extern int bourse_echange (void); extern int bpq_appli_nb (void); extern int bpq_port (int port, int canal); extern int bpq_recv (int, char *); extern int bpq_send (int, char *, int); extern int bpq_test (char *); extern int break_annonce (void); extern int busy (char *); extern int bye (void); extern int car_tnc (int); extern int car_tx (int); extern int ch_language (int, ind_noeud *, info *); extern int chainer_annonce (void); extern int chainer_message (void); extern int check_dupes (int voie, int nb, char *exped, int tst_priv); extern int cherche_enrg_mess (char *, char *); extern int cherche_route (bullist *); extern int chercher_voie (char *); extern int ch_voie (int, int); extern int clr_bas_ecran (void); extern int clr_ind (void); extern int cls (void); extern int cls_drv (int port); extern int cmd_drv (int, int, char *); extern int commande_fwd (void); extern int commande_console (int); extern int comp_passwd (char *call, char *chaine, time_t pass_time); extern int compress_mess (bullist *); extern int con_voie (int, char *); extern int conference (void); extern int connect_console (void); extern int connect_fwd (int, Forward *); extern int connect_tell (void); extern int connect_tnc (void); extern int connect_station (int, int, char *); extern int consulte_bulletins (void); extern int consulte_rubrique (void); extern int copie (char *); extern int copie_message (long); extern int copy_mess (long, char *, char); extern int cree_annonce (void); extern int cree_fichier (char *); extern int cree_instance (void); extern int current_task (void); extern int date_valide (long, long); extern int dec_fwd (char *); extern int dec_voie (int); extern int defaut (void); extern int deja_recu (bullist *, int, int *); extern int demande_ack (int); extern int depile_prompt (void); extern int desel_voie (int); extern int desti_tous (char *); extern int dir_new (void); extern int dir_suite (char *); extern int dir_yapp (char *); extern int doc (void); extern int dpt_ind (char *); extern int droit_ok (bullist *, int); extern int droits (unsigned int); extern int droits_2 (unsigned int); extern int drsi_port (int, int); extern int hst_port (int, int); extern int port_free (int); extern int ecrit_fichier (FILE *, char *); extern int empile_prompt (int); extern int entete_annonce (void); extern int entete_liste (void); extern int entete_nouv_ann (void); extern int entete_tableau_rub (void); extern int env_buf (int, char *, int); extern int envoi (void); extern int envoi_annonce (void); extern int envoi_bulletins (void); extern int envoi_fwd (int); extern int envoi_nouv_ann (void); extern int envoyer_annonce (void); extern int envoyer_message (void); extern int error_fwd (int); extern int err_break (void); extern int err_new_fwd (int, int); extern int err_ouvert (char *); extern int err_rep (void); extern int export_message (char *); extern int fbb_access(char *filename, int mode); extern int fbb_close (int); extern int fbb_fclose (FILE *); extern int fbb_fcloseall (void); extern int fbb_fflush (FILE *); extern int fbb_fgetc (FILE *); extern int fbb_findfirst (char *chemin, struct ffblk *ffblk, int attribut); extern int fbb_findnext (struct ffblk *ffblk); extern int fbb_fprintf (FILE *, char *,...); extern int fbb_fputc (int, FILE *); extern int fbb_fputs (char *, FILE *); extern int fbb_fread (void *, size_t, size_t, FILE *); extern int fbb_free (void *, unsigned int); extern int fbb_fscanf (FILE *, char *,...); extern int fbb_fwrite (void *, size_t, size_t, FILE *); extern int fbb_read (int, void *, unsigned); extern int fbb_unlink (char *); extern int fbb_write (int, void *, unsigned); extern int fbb_stat (char *filename, struct stat *buf); extern int fbb_rmdir (char *filename); #ifdef __linux__ extern int fbb_mkdir (char *filename, int mode); #else extern int fbb_mkdir (char *filename); #endif #ifndef FBB_IO extern int fbb_open (char *, int,...); #endif extern int fct_arret (int); extern int find (char *); extern int fin_annonce (int); extern int fin_envoi_fwd (int); extern int fin_message (int); extern int fin_trans (void); extern int find_next (struct ffblk *); extern int forward_auth (int); extern int fwd (void); extern int fwd_get (char *); extern int fwd_log (void); extern int fwd_mask (char *); extern int get_data (int); extern int get_inbuf (int); extern int get_link (int); extern int get_message (void); extern int get_mess_fwd (char, char *, int, int); extern int gmt_heure (long); extern int heure (long); extern int hiecmp (char *, char *); extern int high_memory_type (void); extern int hold (bullist *); extern int hold_kill (int); extern int hold_temp (int, char *, char *, int); extern int hupdate (void); extern int inbuf_ok (int); extern int incindd (void); extern int incondit1 (void); extern int incondit2 (void); extern int incondit3 (void); extern int incondit4 (void); extern int incondit5 (void); extern int incondit6 (void); extern int incondit7 (void); extern int incondit8 (void); extern int incondit9 (void); extern int indcmp (char *, char *); extern int ind_console (int, char *); extern int informations (void); extern int ini_bpq (int); extern int init_admin (void); extern int init_departements (void); extern int init_dpt (void); extern int init_liste_fwd (int); extern int init_liste_instance (void); extern int init_liste_rubrique (void); extern int init_pile (void); extern int init_pointeur (void); extern int init_pointeurs (void); extern int init_prompt (void); extern int init_white_pages (void); extern int initannonce (void); extern int inittnc (void); extern int initcom (void); extern int initcom_combios (int); extern int ins_liste_bbs (int, char *); extern int ins_liste_fwd (int, long, char, char *); extern int inslibr (unsigned); extern int insmess (unsigned, unsigned, long); extern int is_bid (char *); extern int is_bpq_monit (void); extern int is_dir (char *); extern int is_drsi (int); extern int is_espace (char *); extern int is_held (char *); extern int is_pactor (void); extern int is_room (void); extern int is_route (char *); extern int is_serv (char *); extern int is_wpupdate (char *); extern int iskey (void); extern int jour (long); extern int nojour (long); extern int kam_commande (int, char *); extern int kb_vide (void); extern int key (void); extern int keypressed (void); extern int lecture_annonce (void); extern int liberer_pile (void); extern int libere_buffer (struct typ_cbuf *); extern int libere_liste_fwd (int); extern int libere_liste_instance (void); extern int libere_liste_rubrique (void); extern int libere_prompt (void); extern int lig_bufi (int); extern int list_lc (void); extern int liste_bid (void); extern int liste_bulletins (void); extern int liste_dpt (void); extern int liste_message (void); extern int liste_rapide (int); extern int listind (void); extern int list_bul (int); extern int lit_ack (int); extern int lit_com_fwd (void); extern int lit_fenetre (int, char *); extern int lit_kbd (void); extern int lit_message (int, char *, char *); extern int lit_nb_dpt (void); extern int lit_port_modem (int); extern int lit_qra (void); extern int lit_relais (int, int, int); extern int lit_txt_pk (int, int); extern int littexte (void); extern int litvoie (int); extern int login (char *); extern int mail_out (char *); extern int main (int, char **); extern int maint_fwd (void); extern int maj_rubrique (void); extern int maj_with_wp (int); extern int mbl_bloc_list (void); extern int mbl_dump (void); extern int mbl_edit (void); extern int mbl_hold (void); extern int mbl_jheard (void); extern int mbl_kill (void); extern int mbl_list (void); extern int mbl_mess_read (void); extern int mbl_name (void); extern int mbl_options (void); extern int mbl_print (void); extern int mbl_read (int); extern int mbl_send (void); extern int md_busy (char *, int); extern int md_send (int, char *); extern int md_speed (int, int); extern int menu_rubriques (int); extern int menu_wp_search (void); extern int menu_yapp (void); extern int messagerie (void); extern int message_fichier (int, char *, long); extern int mess_conn (void); extern int mess_decc (void); extern int mess_fic (void); extern int mess_fin_annonce (void); extern int mess_suiv (int); extern int min_ok (int); extern int mini_edit (void); extern int minute (long); extern int modem_vide (int); extern int modif_condit (void); extern int msg_find (char *); extern int n_bbs (char *); extern int nb_ems_pages (void); extern int nbcan_bpq (void); extern int nbcan_drsi (void); extern int nbcan_hst (void); extern int nbgate (void); extern int nbl_page (int); extern int nbport (void); extern int nbull_theme (int); extern int no_canal (int); extern int no_port (int); extern int no_voie (int, int); extern int not_in_fb_mess (long, int); extern int not_in_xfwd_mess (long numero, int voie); extern int nouveau (int); extern int nouvelles_annonces (void); extern int num_bbs (char *); extern int num_voie (char *); extern int aff_ok(int); extern int opn_drv (int, int); extern int out_help (char *); extern int outfich (char *); extern int outfichs (char *); extern int ouvre (void); extern int p_cmd (void); extern int page (FILE *); extern int page_connect (char, FILE *); extern int page_doc (void); extern int page_dpt (void); extern int page_screen (int); extern int parcours_arbre (int, int); extern int part_file (char *, char *); extern int pile_vide (void); extern int pk_sonde (int, int, char *, int *); extern int pos_voie (int); extern int premier_enrg (char *); extern int print_fwd(int, uchar, uchar, uchar, int); extern int ptctrx (int, char *); extern int putxy (int, int, int); extern int put_annonce (void); extern int put_message (void); extern int put_ui (uchar *, int, int); extern int question (int); /* Quit routine added by N1URO for cross-platform command set compatability with URONode, FlexNet, Xnet, and others. */ extern int quit (void); extern int quick_look (void); extern int rcv_drv (int *, int *, int *, char *, int *, ui_header *); extern int rcv_titre (void); extern int rcv_tnc (int); extern int reacheminement (void); extern int read_bid (unsigned, char *); extern int read_dir (unsigned, bullist *); extern int read_exms_string (int, char *); extern int read_only (void); extern int read_mess (int); extern int read_rej (unsigned record, Rej_rec * rej); extern int read_voie (unsigned voie, Svoie * pvoie); extern int read_wp (unsigned, Wp *); extern int rec_tnc (int); extern int recherche_message (void); extern int recoit (int, int *, char *); extern int recoit_pk (int, char *, int *); extern int redist (char *); extern int ref_ok (void); extern int rejet (bullist *); extern int rename_temp (int, char *); extern int req_cfg (char *); extern int retenu (bullist *); extern int review (void); extern int routage (long); extern int route_wp_hier (bullist *); extern int route_wp_home (bullist *); extern int rui_drv (int, char *, int *, ui_header *); extern int saisie_ref (void); extern int sauvef (int); extern int sauve_bloc (void); extern int sauve_fichiers (int); extern int scan_com_fwd (void); extern int search_bid (char *); extern int selection_rubrique (void); extern int selection_sat (void); extern int sel_option (char *, int *); extern int send_annonce (void); extern int send_bloc (int); extern int send_buf (int); extern int send_dos (int, char *, char *); extern int send_message (void); extern int send_pac (void); extern int senddata (unsigned int); extern int sendtexte (void); extern int snd_drv (int, int, char *, int, Beacon *); extern int snd_mess (int, int); extern int sortie_defaut (int); extern int sta_drv (int, int, void *); extern int step_initialisations (int); extern int status_message (void); extern int strmatch (char *, char *); extern int sui_drv (int, char *, Beacon *); extern int supp_annonce (void); extern int supp_ann_autorisee (void); extern int supp_autorisee (void); extern int supp_nomess (long, int); extern int swapp_bbs (bullist *); extern int switch_voie (int); extern int test_curseur (void); extern int test_date (char *); extern int test_desti (void); extern int test_forward (int); extern int test_heure (char *); extern int test_linked (void); extern int test_temp (int); extern int teste_espace (void); extern int teste_flag (int, ind_noeud *, int); extern int teste_rep (char *); extern int texte (int); extern int themes (void); extern int tnccar (int); extern int tncchr (int); extern int tnc_send (int, int, char *); extern int tncin (int); extern int tncprog (int, char *); extern int tps_cnx (void); extern int traite_console (void); extern int trait_ver (int, int, int); extern int tstqra (char *); extern int tst_fwd (char *, int, long, int, int *, int, int); extern int tst_passwd (char *); extern int tst_point (char *); extern int typadmin (int); extern int type_admin (int); extern int user_ok (void); extern int val_fwd (char *, int *, int); extern int validation (void); extern int via_bbs (char *); extern int vidbuf (int, int); extern int vide (int, int); extern int virt_canal (int); extern int voie_forward (int); extern int what_port (int); extern int where_exms_bid (char *); extern int wp_server (void); extern int wp_service (char *); extern int wr_nobul (long); extern int write_bid (unsigned, char *); extern int write_exms_string (int, char *); extern int write_fich (char *, char *, int); extern int write_dir (unsigned, bullist *); extern int write_mess (unsigned, long); extern int write_mess_temp (unsigned, int); extern int write_rej (unsigned record, Rej_rec * rej); extern int write_voie (unsigned voie, Svoie * pvoie); extern int write_temp (char *, int); extern int write_temp_bin (int, int); extern int write_wp (unsigned, Wp *); extern lcall call2l (char *); extern long basic_lzhuf (int mode, char *in_f, char *ou_f); extern long btime (void); extern long cherche_aide (void); extern long cherche_nomess (long); extern long copy_fic (int, int, char *); extern long date_to_pc (int d3, int n3, int y3, int h3, int m3, int s3); extern long date_to_time (char *); extern long date_to_second (struct tm *); extern long decompress (long); extern long fbb_filelength (int); extern long file_size (char *); extern unsigned long free_disk (int); extern long hour_to_time (char *); extern long lit_chiffre (int); extern long lzhuf (desc_huf *); extern long maj_date (int, char *); extern long msg_fwd_suiv (int, uchar, uchar, uchar, int); extern long next_num (void); extern long rd_nobul (void); extern long saisie_num (void); extern long supp_header (FILE *, int); extern long tell_exms_string (int); extern mess_noeud *findmess (long); extern short chdpt (char *); extern struct typ_cbuf *alloue_buffer (void); extern struct typ_lfwd *cree_bloc_fwd (struct typ_lfwd *ptr); extern unsigned chercoord (char *); extern unsigned insarbre (bullist *); extern unsigned length_dir (void); extern unsigned search_wp_record (lcall, int, unsigned); extern unsigned xms_free (void); extern uchar *ansi_to_ibm(uchar *buffer, int len); extern uchar *ibm_to_ansi(uchar *buffer, int len); unsigned short xendien (unsigned short); unsigned long xendienl (unsigned long); extern void accueil_modem (void); extern void add_heard (int, indicat *); extern void add_wp_trace (int val); extern void aff_bas (int, int, char *, int); extern void aff_chaine (int, int, int, char *); extern void aff_date (void); extern void aff_event (int, int); extern void aff_ind_console (void); extern void aff_forward (void); extern void aff_freq (void); extern void aff_header (int); extern void aff_msg_cons (void); extern void aff_rep (int); extern void aff_stations (void); extern void aff_traite (int voie, int val); extern void affich_logo (int); extern void affich_pg (int); extern void affich_serveurs (int); extern void affiche_user (info *, int); extern void aide_commandes (void); extern void alloue_screen (int); extern void analyse_idnt (char *); extern void analyse_header (int, char *); extern void appel_fwd (Forward *, int); extern int appel_serveur (serlist *, bullist *); extern void bipper (void); extern void bin_transfer (void); extern void blank_screen (void); extern void break_ok (void); extern void break_stop (void); extern void boot_prg (void); extern void broadcast_list (void); extern void cancel (char *); extern void carac_satel (void); extern void ch_bbs (int, char[NBBBS][7]); extern void ch_bit (ind_noeud *, info *, unsigned, char); extern void ch_call (void); extern void ch_info (void); extern void ch_niv1 (int); extern void ch_niv2 (int); extern void ch_niv3 (int); extern void change_dir (void); extern void change_droits (int); extern void change_scr (void); extern void check_bin (bullist *, char *); extern void chg_mess (unsigned, long); extern void choix (void); extern void clear_fwd (long); extern void clear_histo (void); extern void clear_inbuf (int); extern void clear_insert (void); extern void clear_outbuf (int); extern void close_print (void); extern void clear_queue (int voie); extern void closecom (void); extern void clr_bit_fwd (char *, int); extern void cmd_err (char *); extern void cmd_export (void); extern void cmd_import (void); extern void commande_dec (void); extern void commande_dos (char *); extern void commande_tell (void); extern void commande_tnc (void); extern void commande_visu (void); extern void compress_display (int, long, long); extern void connect_fen (void); extern void connect_log (int, char *); extern void connect_modem (int); extern void connexion (int); extern void console_off (void); extern void console_on (void); extern void copyright (void); extern void cr (void); extern void cr_cond (void); extern void create_mess (void); extern void cree_bid (void); extern void cree_dir (int); extern void cree_info (void); extern void cree_routes (void); extern void cree_sat (void); extern void cree_stat (void); extern void cron (long); extern void ctrl_z (void); extern void curoff (void); extern void curon (void); extern void curseur (void); extern void cursor (int); extern void dde_huf (int, bullist *, int); extern void dde_synchro (char *, long, int); extern void dde_warning (int); extern void dde_wp (void); extern void deb_compute (void); extern void deb_io (void); extern void debug (char *); extern void debug_mode (void); extern void debug_wp (char *); extern void dec (int, int); extern void deconnect_modem (int); extern void deconnexion (int, int); extern void del_copy (int); extern void del_file (void); extern void del_part (int, char *); extern void del_temp (int); extern void delete_bid (char *); extern void delete_exms_bid (int); extern void deroute_clavier (void); extern void deroute_erreur (void); extern void deroute_ticker (void); extern void deroute_tracker (void); extern void deroute_next_task (void); extern void deroute_vecteurs (void); extern void dir (void); extern void display_dsz_perf (int voie); extern void display_perf (int); extern void display_screen (void); extern void doc_path (void); extern void documentations (void); extern void double_fen (void); extern void dos (void); extern void droits_serv (void); extern void du (void); extern void dump_exms (void); extern void dump_screen (void); extern void duplex_tnc (void); extern void dv_beginc (void); extern void dv_endc (void); extern void dv_pause (void); extern void dv_test (void); extern void e_edit (int); extern void ecran_dos (void); extern void ega_close (void); extern void ega_open (void); extern void edit (void); extern void ems_ovr (int); extern void en_navant_toute (void); extern void end_admin (void); extern void end_arbre (void); extern void end_bbs (void); extern void end_beacon (void); extern void end_compute (void); extern void end_exms (void); extern void end_fwd (void); extern void end_hold (void); extern void end_lzhuf (void); extern void end_messages (void); extern void end_mini_edit (void); extern void end_modem (void); extern void end_parts (void); extern void end_ports (void); extern void end_pg (void); extern void end_swap (void); extern void end_textes (void); extern void end_themes (void); extern void end_voies (void); extern void end_watchdog (void); extern void end_wp (void); extern void entete_envoi_fwd (int); extern void entete_fwd (int); extern void entete_message (void); extern void entete_mess_fwd (bullist *, char *); extern void entete_saisie (void); extern void env_com_pk (int, int, char *); extern void env_com_tnc (int, int, char *); extern void env_date (void); extern void env_message (void); extern void envoi_commande (int, int, char *); extern void envoie (int, char, char *); extern void err_alloc (unsigned); extern void err_init (int); extern void exec_pg (void); extern void exms_overlay (void); extern void exped_wp (char *, char *); extern void fbb_clrscr (void); extern void fbb_error (unsigned, char *, unsigned); extern void fbb_except (unsigned, char *, unsigned); extern void fbb_log (int, char, char *); extern void fbb_printfiles (FILE *); extern void fbb_textattr (int); extern void fbb_warning (unsigned, char *, unsigned); extern void fen_bas (void); extern void fen_haut (int); extern void ferme (FILE *, int); extern void ferme_dir (void); extern void ferme_log (void); extern void fin_backscroll (void); extern void fin_io (void); extern void fin_tnc (void); extern void finentete (void); extern void flush_wp_cache (void); extern void force_deconnexion (int, int); extern void free_mem (void); extern void free_use (void); extern void fwd_cpy (recfwd *, bullist *); extern void fwd_encours (void); extern void fwd_value (char *, char *, char *); extern void get_zrpos (int); extern void header_wp (long, char *, char *, char *); extern void help (char *); extern void house_keeping (void); extern void hroute_wp (char *); extern void import_message (char *); extern void in_buf (int, char *, int); extern void indic_modem (void); extern void ini_champs (int); extern void ini_rec (Wpr *); extern void init_bbs (void); extern void init_bpq_streams (int); extern void init_buf_fwd (void); extern void init_buf_rej (void); extern void init_buf_swap (void); extern void init_debug (unsigned int); extern void init_etat (void); extern void init_exms (void); extern void init_exms_bid (FILE *); extern void init_fb_mess (int); extern void init_hold (void); extern void init_info (info *, indicat *); extern void init_kb (void); extern void init_keyboard (void); extern void init_langue (int); extern void init_modem (int); extern void init_part (void); extern void init_print (void); extern void init_rec_fwd (int); extern void init_recliste (int); extern void init_screen (char *, int, int); extern void init_semaine (void); extern void init_serveur (char *, int); extern void init_space (char *, int, int); extern void init_task (void); extern void init_timout (int); extern void init_voie (int); extern void init_watchdog(int val); extern void init_wp (void); extern void init_wp_cache (void); extern void initialisations (void); extern void initport (void); extern void initexte (void); extern void inputs (int, int, char *); extern void ins_fwd (bullist *); extern void ins_iliste (bullist *); extern void inscoord (unsigned, info *, ind_noeud *); extern void int14real (RSEGS *); extern void int86real (int, RSEGS *); extern void interruption (int); extern void io (void); extern void j_list (int, char); extern void k_tasks (void); extern void kernel (void); extern void kill_message (char *); extern void libere (int); extern void libere_bid (void); extern void libere_bid_exms (void); extern void libere_edit (int); extern void libere_xems (void); extern void libere_label (int); extern void libere_route (int); extern void libere_serveurs (void); extern void libere_tlist (int); extern void libere_tnc (typ_pfwd **); extern void libere_tread (int); extern void libere_ymodem (int, int); extern void libere_zones_allouees (int); extern void limite_commande (void); extern void list (void); extern void list_held (void); extern void list_messages (int, unsigned, int); extern void list_new (char *); extern void list_read (int); extern void liste_cnx (void); extern void liste_indic (void); extern void liste_label (void); extern void lit_appel (void); extern void lit_sat (satel *); extern void load_dirmes (void); extern void load_themes (void); extern void lonlat (char *, double *, double *); extern void m_libere (void *, unsigned int); extern void mail_in (void); extern void maintenance (void); extern void maj_fen (void); extern void maj_fwd (void); extern void maj_niv (int, int, int); extern void maj_options (void); extern void maj_rec (long, bullist *); extern void majinfo (int, int); extern void majfich (int); extern void make_bid (void); extern void make_dir (void); extern void mark_fwd (int voie, char mode); extern void mark_reverse_bid (bullist *, int, int *); extern void marque_obuf (void); extern void MD5String (uchar *dest, uchar *source); extern void mbl_disbul (void); extern void mbl_emul (void); extern void mbl_info (void); extern void mbl_passwd (void); extern void mbl_stat (void); extern void mbl_tell (void); extern void md_defaut (int); extern void md_echo (int); extern void md_inbuf (int, char *, int); extern void md_no_echo (int); extern void md_reset (int); extern void mess_liste (int); extern void menu_principal (void); extern void menu_sat (void); extern void menu_trajec (void); extern void mess_warning (char *, char *, char *); extern void mod_part (char *, long, char *); extern void modem (void); extern void modem_no_echo (int); extern void modem_start (int); extern void modem_stop (int); extern void modif_bloc (void); extern void modif_satel (void); extern void monitor (int, char *, int); extern void music (int); extern void my_exception (void); extern void n_cpy (int, char *, char *); extern void new_fwd (void); extern void new_label (void); extern void nomenclature (void); extern void old_part (char *, char *); extern void options (void); extern void outs (char *, int); extern void out (char *, int); extern void out_txt (void); extern void outsln (char *, int); extern void outln (char *, int); extern void ouvre_dir (void); extern void ouvre_ecran (void); extern void ouvre_log (void); extern void p_debug (int, char *); extern void paclen_change (int, int, char *); extern void param_satel (void); extern void param_tnc (int, typ_pfwd **, char *); extern void part_recu (bullist *, int, int *); extern void passwd_change (void); extern void passwd_modem (void); extern void pk_commande (int, char *); extern void pk_ui (int, char *); extern void port_log (int, int, char, char *); extern void premier_niveau (void); extern void print_part (void); extern void print_stack (unsigned int, FILE *); extern void print_tasks (void); extern void prog_modem (void); extern void prog_more (int); extern void prog_rev_tnc (int); extern void program_fwd (int, int, typ_pfwd **, int); extern void program_tnc (int, char *); extern void programm_indic (int); extern void prompt (int, int); extern void prompt_dos (void); extern void put_mess_fwd (char); extern void put_nr (uchar *, int, int); extern void put_rose (uchar *, int, int); extern void q_mark (void); extern void qraloc (void); extern void rcv_rev_fwd (void); extern void re_init_modem (int); extern void read_heard (void); extern void receive_file (void); extern void remet_clavier (void); extern void remet_erreur (void); extern void remet_ticker (void); extern void remet_tracker (void); extern void remet_next_task (void); extern void remet_bloc (int); extern void remet_vecteurs (void); extern void remove_dir (void); extern void retour_appel (void); extern void retour_dir (char); extern void set_bs (int voie, int val); extern void retour_dos (void); extern void retour_mbl (void); extern void retour_menu (int); extern void retour_niveau (void); extern void rewind_fwd (void); extern void saisie_infos (void); extern void scan_fwd (int val); extern void seek_exms_string (int, long); extern void selcanal (int); extern void selvoie (int); extern void send_balise (int); extern void send_bin_message (void); extern void send_binary_mess (void); extern void send_copy (void); extern void send_file (int); extern void send_list(int); extern void send_reply (void); extern void send_tnc (int, int); extern void send_wp_mess (void); extern void sendeot (uchar); extern void set_binary (int, int); extern void set_bit_fwd (char *, int); extern void set_busy (void); extern void set_call (char *, char *, char, int); extern void set_link (int, int); extern void sleep_ (unsigned int); extern void sortie (void); extern void sortie_prg (void); extern void start_tasks (void); extern void stat_conn (void); extern void stat_yapp (void); extern void statistiques (void); extern void status (int); extern void stop_scan_fwd (void); extern void stop_main_task (void); extern void strn_cpy (int, char *, char *); extern void sup_fwd (long, int, uchar); extern void supp_env_binaire (int); extern void supp_fich (FILE *, long); extern void supp_mess (long); extern void swap_langue (int, int); extern void swap_port (char *); extern void t_label (void); extern void test_buf_fwd (void); extern void test_disque (void); extern void test_kb (void); extern void test_pactor(int); extern void tester_masque (void); extern void text_conf (int); extern void text_cpy (char *, char *); extern void tnc_commande (int, char *, int); extern void tnc_s (int, int, char *); extern void tncout (int, int); extern void tncstr (int, char *, int); extern void tor_disc (int); extern void tor_stop (int); extern void tor_start (int); extern void trait (int, char *); extern void trait_hor (int); extern void traite_commande (int, char *, int); extern void traite_data (int, char *, int); extern void traite_voie (int); extern void trajec (void); extern void trajecto (void); extern void tst_ack (bullist *); extern void tst_appel (void); extern void tst_exms_bid (bullist *, int, int *); extern void tst_serveur (bullist *); extern void tst_sysop (char *, long); extern void tst_warning (bullist *); extern void user_time_out (void); extern void valide_themes (unsigned, int, bullist *); extern void valmess (bullist *); extern void var_cpy (int, char *); extern void w_bid (void); extern void w_label (char *, char *); extern void watchdog(void); extern void while_space (void); extern void win_message (int, char *); extern void winputs (int, int, char *); extern void user_wp (info *); extern void wp_message (Wpr *); extern void wp_read_mess (bullist *); extern void wp_search (void); extern void wp_upd (Wpr *, int); extern void wr_dir (char *, char *); extern void wreq_cfg (FILE * fptr); extern void write_capture (char *, int len); extern void write_error (char *); extern void write_heard (void); extern void xmodem (void); extern void xmodem_mode (int, int); extern void xfwd (void); extern void yapp (void); extern void yapp_message (int); extern void zero_tic (void); extern void XMSCall (void); extern void *m_alloue (unsigned int); extern Wps *wp_find (char *, int); #ifdef __cplusplus } /* extern "C" */ #endif fbb-7.0.10/include/fbb_serv.h0000644000175000017500000011335013613360505012642 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * SERV.H */ #ifndef _fbb_serv #define _fbb_serv /* Define THIRTYTWOBITDATA if you are bringing in data from 32-bit versions. This creates datafiles that match the origin documentation for FBB. They are not compatible with files created with 64-bit versions. */ /*#define THIRTYTWOBITDATA 1 */ #ifdef THIRTYTWOBITDATA #define fbb_long int #else #define fbb_long long #endif /* #define FORTIFY */ #ifdef __linux__ #include #include #include #include #include #include /* Bug dans libc ????? <================== */ #define __NO_CTYPE #define FAR #define __a2__ __attribute__ ((packed, aligned(2))) #else #define __a2__ #endif /* Numero du canal pactor HST */ #define PACTOR_CH 31 /* Minimum place disque (KB) */ #define MIN_DISK 1000 /* #define FBB_DEBUG 1 */ #define NO_EMS_CHN /* Genere une exception .... */ /* #define dump_core() {char *coreptr = NULL ; *coreptr = 0x55 ; } */ /* Index des couleurs */ #define W_SNDT 0 /* Envoie data */ #define W_RCVT 1 /* Recoit data */ #define W_CHNI 2 /* Canal Information */ #define W_MONH 3 /* Monitoring header */ #define W_MOND 4 /* Monitoring data */ #define W_CNST 5 /* Console text */ #define W_BACK 6 /* Background */ #define W_STAT 7 /* Fenetre de status */ #define W_DEFL 8 /* Couleur Fenetre haute */ #define W_VOIE 9 /* Couleur voie */ #define W_NCOL 10 /* Nombre de couleurs definies */ #define ENCODE 0 #define DECODE 1 #define NO_REPORT_MODE 0 #define REPORT_MODE 1 /* Programmation du port */ #define XON 1 #define CTS 2 #define DSR 4 /* Constantes specifiques aux I/O */ #define COMMAND 11 #define DATA 12 #define UNPROTO 13 #define DISPLAY 14 #define TOR 15 #define STATS 16 #define NBBUF 17 #define NBCHR 18 /* Protocoles de forwarding */ #define FWD_MBL 1 #define FWD_FBB 2 #define FWD_BIN 4 #define FWD_BIN1 8 #define FWD_XPRO 16 /* Constantes de status des TNC */ #define INVCMD 0xff #define NOCMD 0 #define TNCSTAT 1 #define PACLEN 2 #define CMDE 3 #define SETFLG 4 #define SNDCMD 5 #define ECHOCMD 6 #define PORTCMD 7 #define ERRCMD 8 #define BINCMD 9 #define BSCMD 10 #define SUSPCMD 11 #define SETBUSY 12 /* Nb d'unites virtuelles ds FBBDOS */ #define NB_PATH 8 #define NEWIDNT #define LINT_ARGS #define uchar char #define lcall unsigned long #define ISGRAPH(c) (!iscntrl(c) && !isspace(c)) #define ISPRINT(c) (!iscntrl(c)) #define PRIVATE(type) ((type == 'P') || (type == 'A') || (type == 'T')) #if defined(__FBBDOS__) || defined(__WINDOWS__) #include #include #include #include #include #include #include #include #endif #include #include #include #include #include #include #include #include #include #define ERR_OPEN 0 #define ERR_CREATE 1 #define ERR_CLOSE 2 #define ERR_SYNCHRO 3 #define ERR_MEMORY 4 #define ERR_CANAL 5 #define ERR_NIVEAU 6 #define ERR_WRITE 7 #define ERR_SYNTAX 8 #define ERR_TNC 9 #define ERR_PTR 10 #define ERR_EXMS 11 #define ERR_DIV0 12 #define ERR_EXCEPTION 13 #ifndef FBB_IO #define USR_CALL 0 #define BBS_CALL 1 #define read fbb_read #define write fbb_write #define open fbb_open #define close fbb_close #define unlink fbb_unlink #define fread fbb_fread #define fwrite fbb_fwrite #define fopen fbb_fopen #define fclose fbb_fclose #define fgetc fbb_fgetc #define fputc fbb_fputc #define fgets fbb_fgets #define fputs fbb_fputs #define mkdir fbb_mkdir #define rmdir fbb_rmdir #define statfs(file, buf) fbb_statfs(file, buf) #define stat(file, buf) fbb_stat(file, buf) #define access(file, mode) fbb_access(file, mode) #define findfirst fbb_findfirst #define findnext fbb_findnext #define filelength fbb_filelength #define textattr fbb_textattr #define clrscr fbb_clrscr #endif /* FBB_IO */ #define RCV_BUFFER_SIZE 1600 #define NO_MS 0 #define EMS 1 #define XMS 2 #define ECART 1000L /* Chiffre minimum pour extension Nø message */ #define M_LIG 4 /* Separation fenetre haut / bas */ #define MAXMEM 5000 /* Buffer plein */ #define BIDLEN 12 /* Taille du BID */ #define BIDCOMP 9 /* Taille du BID compresse */ #define MAX_FB 5 /* Nb de lignes ds fwd FBB */ #define MAX_BCL 3 /* Nb de lignes ds broadcast */ #define MAX_ERR 20 /* Nombre max d'erreurs autorisees */ #define I_COM1 0x04 /* COM1 = IRQ4 */ #define I_COM2 0x03 /* COM2 = IRQ3 */ #define F_EXC 0x0001 #define F_LOC 0x0002 #define F_EXP 0x0004 #define F_SYS 0x0008 #define F_BBS 0x0010 #define F_PAG 0x0020 #define F_GST 0x0040 #define F_MOD 0x0080 #define F_PRV 0x0100 #define F_UNP 0x0200 #define F_NEW 0x0400 #define F_PMS 0x0800 /* #define F_PWD 0x1000 */ #define F_FOR 0x00100 #define F_FBB 0x00200 #define F_HIE 0x00400 #define F_BID 0x00800 #define F_NFW 0x01000 #define F_MID 0x02000 #define F_BIN 0x04000 #define F_ACQ 0x08000 #define W_DISK 0x0001 #define W_FILE 0x0002 #define W_SERVER 0x0004 #define W_PINGPONG 0x0008 #define W_NO_ROUTE 0x0010 #define W_NO_NTS 0x0020 #define W_MESSAGE 0x0040 #define W_ERROR 0x0080 #define W_REJECT 0x0100 #define W_HOLD 0x0200 #define TYP_DED 0 #define TYP_PK 1 #define TYP_MOD 2 #define TYP_KAM 3 #define TYP_BPQ 4 #define TYP_TCP 5 #define TYP_SCK 6 #define TYP_AGW 7 #define TYP_ETH 8 #define TYP_HST 9 #define TYP_FLX 10 #define TYP_POP 11 #define NB_TYP 12 #define W_PPG 0x01 /* Ping-Pong */ #define W_ROU 0x02 /* Unknown route */ #define W_NTS 0x04 /* Unknown nts */ #define W_ASC 0x08 /* Ascii file not found */ #define W_BIN 0x10 /* Binary file not found */ #define FWD_PRIV 0x01 /* Forward only privates */ #define FWD_SMALL 0x02 /* Forward smallest first */ #define FWD_DUPES 0x04 /* Forward allowing dupes */ #define EXC(flag) (flag & F_EXC) #define LOC(flag) (flag & F_LOC) #define EXP(flag) (flag & F_EXP) #define SYS(flag) (flag & F_SYS) #define BBS(flag) (flag & F_BBS) #define PAG(flag) (flag & F_PAG) #define GST(flag) (flag & F_GST) #define MOD(flag) (flag & F_MOD) #define PRV(flag) (flag & F_PRV) #define UNP(flag) (flag & F_UNP) #define NEW(flag) (flag & F_NEW) #define PMS(flag) (flag & F_PMS) #define FBB(flag) (flag & F_FBB) #define FOR(flag) (flag & F_FOR) #define HIE(flag) (flag & F_HIE) #define BID(flag) (flag & F_BID) #define NFW(flag) (flag & F_NFW) #define MID(flag) (flag & F_MID) #define BIN(flag) (flag & F_BIN) #define ACQ(flag) (flag & F_ACQ) #define PWD(flag) (flag & F_PWD) #define P_GUEST(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x01) || (svoie[voie]->localmode & 0x01)) : 0) #define P_BBS(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x02) || (svoie[voie]->localmode & 0x02)) : 0) #define P_YAPP(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x04) || (svoie[voie]->localmode & 0x04)) : 0) #define P_MODM(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x08) || (svoie[voie]->localmode & 0x08)) : 0) #define P_GATE(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x10) || (svoie[voie]->localmode & 0x10)) : 0) #define P_LIST(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x20) || (svoie[voie]->localmode & 0x20)) : 0) #define P_READ(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x40) || (svoie[voie]->localmode & 0x40)) : 0) #define P_TOR(voie) ((voie > 0) ? ((p_port[no_port(voie)].moport & 0x80) || (svoie[voie]->localmode & 0x80)) : 0) #define P_DIRECT 0 #define P_MODEM 3 #define P_COMBIOS 1 #define P_BPQ 2 #define P_MODEM 3 #define P_DRSI 4 #define P_TFPC 5 #define P_WINDOWS 6 #define P_ETHER 7 #define P_TFWIN 8 #define P_LINUX 9 #define BIOS(port) (p_com[(int)p_port[port].ccom].combios) #define COMBIOS(port) (p_com[(int)p_port[port].ccom].combios == P_COMBIOS) #define BPQ(port) (p_com[(int)p_port[port].ccom].combios == P_BPQ) #define DRSI(port) ((p_com[(int)p_port[port].ccom].combios == P_DRSI) || (p_com[(int)p_port[port].ccom].combios == P_TFWIN)) #define TFPC(port) (p_com[(int)p_port[port].ccom].combios == P_TFPC) #define WINDOWS(port) ((p_com[(int)p_port[port].ccom].combios == P_WINDOWS) #define ETHER(port) (p_com[(int)p_port[port].ccom].combios == P_ETHER) #define LINUX(port) (p_com[(int)p_port[port].ccom].combios == P_LINUX) #define AGW(port) ((p_com[(int)p_port[port].ccom].combios == P_WINDOWS) && (p_port[port].typort == TYP_AGW)) #define S_LINUX(port) ((LINUX(port)) && (p_port[port].typort == TYP_SCK)) #define HST(port) (p_port[port].typort == TYP_HST) #define FLX(port) (p_port[port].typort == TYP_FLX) #define POP(port) (p_port[port].typort == TYP_POP) /* Pactor */ #define IS_PACTOR(p) ((p_port[p].typort == TYP_HST) && (p_port[p].ccanal == 0)) #define ISS(p) ((p_com[(int)p_port[p].ccom].pactor_st & 0x08) ? 1 : 0) #define BUSY(p) ((p_com[(int)p_port[p].ccom].pactor_st == 247) ? 1 : 0) #define ONLINE(p) (((p_com[(int)p_port[p].ccom].pactor_st & 0x07) != 0x07) ? 1 : 0) #define PACTOR_ONLINE 1 #define PACTOR_SCAN 2 #define PACTOR_ISS 4 #define EMS_BLOC 16384 /* File number de l'EMS */ #define DIRMES 0 #define WBID 1 #define HROUTE 2 #define FORWARD 3 #define REJET 4 #define WPG 5 #define SCREEN 6 #define NB_EMS 7 /* Nombre de flags EMS */ #define EMS_NUL 0x0000 #define EMS_MSG 0x0001 #define EMS_BID 0x0002 #define EMS_HRT 0x0004 #define EMS_FWD 0x0008 #define EMS_REJ 0x0010 #define EMS_WPG 0x0040 #define EMS_SCR 0x0020 #define EMS_MSG_OK() (in_exms & EMS_MSG) #define EMS_BID_OK() (in_exms & EMS_BID) #define EMS_HRT_OK() (in_exms & EMS_HRT) #define EMS_FWD_OK() (in_exms & EMS_FWD) #define EMS_REJ_OK() (in_exms & EMS_REJ) #define EMS_SCR_OK() (in_exms & EMS_SCR) #define EMS_WPG_OK() (in_exms & EMS_WPG) #define EMS_OVR_OK() (in_exms & EMS_OVR) #define EMS_CHN_OK() (in_exms & EMS_CHN) /* Structure d'int en mode reel a travers DPMI Fonction int86real() */ typedef struct { unsigned long DI; unsigned long SI; unsigned long BP; unsigned long rs; unsigned long BX; unsigned long DX; unsigned long CX; unsigned long AX; unsigned int FL; unsigned int ES; unsigned int DS; unsigned int FS; unsigned int GS; unsigned int IP; unsigned int CS; unsigned int SP; unsigned int SS; } RSEGS; typedef struct { char ctype[4]; unsigned flag; } tp_ems; typedef struct /* Informations pour appel XMS */ { unsigned AX, /* Seuls les registres AX, BX, DX et */ BX, /* SI sont requis selon la fonction */ DX, /* appel‚e, il faut donc une autre */ SI, /* adresse de segment */ DS; } XMSRegs; #define TRUE 1 #define FALSE 0 #define DEGRAD 57.2957795 #define LG_LANG 10 /* Taille du nom fichier langue */ #define MAXLIGNES 20 #define MAXTRAIT 180 /* Temps maximal de traitement (# 3 mn) */ #define MAXTASK 3 /* Temps maximum dans une tache longue */ #define N_MENU 0 #define N_MESS 1 #define N_QRA 2 #define N_STAT 3 #define N_INFO 4 #define N_NOMC 5 #define N_TRAJ 6 #define N_ECH 7 #define N_RBIN 8 #define N_DOS 9 #define N_GATE 10 #define N_MOD 11 #define N_BIN 12 #define N_XFWD 13 #define N_MBL 14 #define N_FORW 15 #define N_TELL 16 #define N_YAPP 17 #define N_CONF 18 #define N_MINI_EDIT 19 #define N_THEMES 20 #define NBRUB 21 /* Nb de niv1 maximum */ #define OUI 3 /* Offset du 'OUI' */ #define NON 4 /* Offset du 'NON' */ #define JOUR 5 /* Offset du jour */ #define MOIS 6 /* Offset du mois */ #define T_DEB 1 #define T_MES (T_DEB+10) /* Offset des textes dans le fichier */ #define T_QST (T_MES+14) /* Questions et messages standards */ #define T_ERR (T_QST+7) /* Messages d'erreur */ #define T_MBL (T_ERR+32) /* Rubrique emulation MBL */ #define T_TRT (T_MBL+60) /* Traitement des donnees */ #define T_MEN (T_TRT+14) /* Rubrique menu serveur */ #define T_STA (T_MEN+3) /* Rubrique statistiques */ #define T_NOM (T_STA+24) /* Rubrique Nomenclature */ #define T_TRJ (T_NOM+15) /* Rubrique Trajectographie */ #define T_QRA (T_TRJ+41) /* Rubrique Qra-Locator */ #define T_DOS (T_QRA+19) /* Rubrique FBBDOS */ #define T_INF (T_DOS+12) /* Rubrique Informations */ #define T_GAT (T_INF+4) /* Gateway */ #define T_YAP (T_GAT+13) /* Yapp transfert */ #define T_CNF (T_YAP+5) /* Conference */ #define T_THE (T_CNF+11) /* Themes */ #define NBTEXT (T_THE+2) /* Nombre de lignes de texte */ #define TNCVOIES 9 #define NBLIG 10 #define CONSOLE 0 /* #define MAXVOIES 50 / Nb de voies maximum */ #define MAXVOIES 96 /* Nb de voies maximum */ #define INEXPORT 1 /* Voie reservee a l'import/export */ #define MMONITOR (MAXVOIES) /* Affiche le monitoring */ #define ALLCHAN (MAXVOIES+1) /* Affiche tous les canaux */ #define TOTVOIES (MAXVOIES+3) /* Nb de voies total */ #define NBCOM 20 /* Nb de COMs maximum en interne */ #define NBPORT (16+1) /* Nb de ports maximum (+ console) */ #define SECONDE 19 /* Nb de ticks par seconde */ #define MAXSTAT 5000L /* echantillonnage pour les stats */ #define max_ack 4 #define PASS 0x1E #define STREAMSW 0x1D #define SENDPAC 0x1F #define TEXTE 0xFF #define CTRLZ 0x1A /* Droits sysop */ #define CONSMES 1 /* Consultation de tous les messages */ #define SUPMES 2 /* Suppression de tous les messages */ #define CMDSYS 4 /* Acces a la commande SYS */ #define COSYSOP 8 /* Fonctions cosysop : edit, forward */ #define MODLABEL 16 /* Edition des labels DOS, YAP, DOC */ #define SUPFIC 32 /* Suppression de fichiers FBBDOS, YAPP */ #define ACCGATE 64 /* Acces a tous les gateways, sauf modem */ #define EXEDOS 128 /* Execute des programmes DOS */ #define ACCESDOS 256 /* Acces a tout le repertoire du disque */ #define CMDRESET 512 /* Acces aux commandes '/R' et '/A' */ #define DOS (YELLOW + (BLACK << 4)) typedef struct FbbTimerStruct { void *userdata; void FAR (*fct) (int, void *); int port; time_t temps; struct FbbTimerStruct *next; } FbbTimer; /* #define AIDE 1 */ #define ABREG 0 #define NBMEN 10 /* nb. de rubriques par menu infos */ typedef struct THroute { char route[42]; struct THroute *suiv; } Hroute; typedef struct TWp { /* char callsign[7]; char home[7]; */ lcall callsign; lcall home; } Wp; typedef struct { int port; char from[12]; char to[12]; char via[100]; char ctl[12]; char txt[12]; int pid; int ui; } ui_header; #define MAX_BROUTE 2000 typedef struct TBloc_route { char b_route[MAX_BROUTE]; struct TBloc_route *suiv; } Broute; typedef struct { int numlang; char *plang[NBTEXT]; } tlang; typedef struct tport { char port; char canal; } sport; /* Structure de EMS/XMS */ typedef struct { long size; /* Taille du fichier memoire */ long pos; /* Position du pointeur dans le fichier */ unsigned nb_records; /* Nombre de records */ int nb; /* Nb de caracteres restants dans la page */ unsigned max_bloc; /* Nb de blocs maximum */ unsigned tot_bloc; /* Nb de blocs alloues */ unsigned num_bloc; /* Numero du bloc courant */ char *ptr; /* Pointeur de caractere */ char **alloc; /* Blocs alloues */ } Desc; /* Structure de REJET/HOLD */ typedef struct { char mode; char type; char exped[7]; char via[7]; char desti[7]; char bid[13]; int size; } Rej_rec; /* Structures fichiers WP */ typedef struct { /* 108 bytes */ long last; short local; char source; char callsign[7]; char homebbs[41]; char zip[9]; char name[13]; char qth[31]; } Wpr; typedef struct { /* 194 bytes */ char callsign[7]; char name[13]; uchar free; uchar changed; ushort seen; fbb_long last_modif __a2__; fbb_long last_seen __a2__; char first_homebbs[41]; char secnd_homebbs[41]; char first_zip[9]; char secnd_zip[9]; char first_qth[31]; char secnd_qth[31]; } Wps; /* * Structures et blocs de messages */ typedef struct { long nmess; unsigned noenr; unsigned no_indic; } mess_noeud; #define T_BLOC_MESS 100 typedef struct st_bloc_mess { mess_noeud st_mess[T_BLOC_MESS]; struct st_bloc_mess *suiv; } bloc_mess; typedef struct typ_serlist { int num_serv; char nom_serveur[7]; char com_serveur[80]; char nom_pg[80]; struct typ_serlist *suiv; } serlist; typedef struct typ_pglist { char nom_pg[10]; struct typ_pglist *suiv; } pglist; /* * Structures et blocs d'indicatifs */ typedef struct { char indic[7]; /* char lettre; */ uchar val; short nbmess; short nbnew; unsigned coord; } ind_noeud; #define T_BLOC_INFO 50 typedef struct st_bloc_indic { ind_noeud st_ind[T_BLOC_INFO]; struct st_bloc_indic *suiv; } bloc_indic; typedef struct typstat { char indcnx[6]; uchar port; uchar voie; fbb_long datcnx __a2__; short tpscnx; } statis; typedef struct typMsysop { char call[22]; struct typMsysop *next; } Msysop; typedef struct typindic { char call[7]; char num; } indicat; typedef struct typenrg { char indic[7]; char exped[7]; long date; long suite; char texte[81]; } enrg; typedef struct { indicat indic; /* 8 Callsign */ indicat relai[8]; /* 64 Digis path */ fbb_long lastmes __a2__; /* 4 Last L number */ fbb_long nbcon __a2__; /* 4 Number of connexions */ fbb_long hcon __a2__; /* 4 Last connexion date */ fbb_long lastyap __a2__; /* 4 Last YN date */ ushort flags; /* 2 Flags */ ushort on_base; /* 2 ON Base number */ uchar nbl; /* 1 Lines paging */ uchar lang; /* 1 Language */ fbb_long newbanner __a2__; /* 4 Last Banner date */ ushort download; /* 2 download size (KB) = 100 */ char free[20]; /* 20 Reserved */ char theme; /* 1 Current topic */ char nom[18]; /* 18 1st Name */ char prenom[13]; /* 13 Christian name */ char adres[61]; /* 61 Address */ char ville[31]; /* 31 City */ char teld[13]; /* 13 home phone */ char telp[13]; /* 13 modem phone */ char home[41]; /* 41 home BBS */ char qra[7]; /* 7 Qth Locator */ char priv[13]; /* 13 PRIV directory */ char filtre[7]; /* 7 LC choice filter */ char pass[13]; /* 13 Password */ char zip[9]; /* 9 Zipcode */ } info; /* Total : 360 bytes */ typedef struct { char mode; char fbid[13]; fbb_long numero __a2__; } bidfwd; typedef struct CmdList { char cmd[10]; char *action; struct CmdList *next; } cmdlist; typedef struct { indicat indic; long first __a2__; long last __a2__; ushort nb; } Heard; typedef struct typlist { bloc_mess *ptemp; unsigned offset; int l; long last; long debut; long fin; long avant; long apres; char type; char status; char route; char exp[7]; char dest[7]; char bbs[7]; char find[20]; } tlist; #define NBBBS 80 #define NBMASK NBBBS/8 typedef struct { /* Longueur = 194 octets */ char type; char status; fbb_long numero __a2__; fbb_long taille __a2__; fbb_long date __a2__; char bbsf[7]; char bbsv[41]; char exped[7]; char desti[7]; char bid[13]; char titre[61]; char bin; char free[5]; fbb_long grpnum __a2__; ushort nblu; fbb_long theme __a2__; fbb_long datesd __a2__; fbb_long datech __a2__; char fbbs[NBMASK]; char forw[NBMASK]; } bullist; typedef struct { int nbpriv, nbbul, nbkb; } atfwd; typedef struct { char type; char bin; uchar kb; char free; long nomess; long date; char fbbs[NBMASK]; char bbsv[6]; } recfwd; #define NBFWD 100 typedef struct typ_lfwd { recfwd fwd[NBFWD]; struct typ_lfwd *suite; } lfwd; typedef struct typrd_list { long nmess; int verb; bullist *pmess; struct typrd_list *suite; } rd_list; typedef struct typ_satel { char dd[18]; short y3; double d3 __a2__; short n3, h3, m3, s3; double i0 __a2__; double o0 __a2__; double e0 __a2__; double w0 __a2__; double m0 __a2__; double a0 __a2__; double n0 __a2__; double q3 __a2__; fbb_long k0 __a2__; double f1 __a2__; double v1 __a2__; short pas; fbb_long maj __a2__; fbb_long cat __a2__; /* Catalog Number - anciennement vide */ short libre[4]; } satel; typedef struct typ_date_t { double jour; int mois, annee; int heure, mn, sec; } date_t; #define DIM_IBUF 90 typedef struct typ_buflig { struct typ_buflig *suite; /* pointeur du buffer suivant */ int lgbuf; /* longueur du buffer */ char *buffer; /* buffer de caracteres */ } lbuf; typedef struct { int nblig; /* nb de lignes en buffer */ int nbcar; /* nb de caracteres en buffer */ int nocar; /* nb de caracteres deja lus dans la ligne */ char *ptr; /* pointeur du dernier caractere */ lbuf *tete; /* pointeur du premier buffer */ lbuf *curr; /* pointeur du buffer courrant */ } ibuf; #define TAILBUF 300 #define DIMBUF 300 #define DATABUF 300 typedef struct typ_cbuf { int ptr_r; /* Pointeur caracteres recus */ int ptr_l; /* Pointeur caracteres lus */ int ptr_a; /* Pointeur des caracteres affiches */ int nblig; /* nb de lignes dans le buffer */ int nbcar; /* nb de caracteres dans buffer */ int buf_vide; /* Buffer de reception vide */ int flush; /* Demande d'envoi du buffer */ char buf[DIMBUF]; /* Buffer de reception */ } cbuf; #define NB_MARQUES 10 typedef struct typ_obuf { int nb_car; int no_car; int marque[NB_MARQUES]; struct typ_obuf *suiv; char buffer[TAILBUF]; } obuf; typedef struct typ_iliste { char indic[8]; struct typ_iliste *suiv; } iliste; typedef struct { char ind[7]; unsigned pos; } tri; typedef struct typ_Forward { char reverse; /* Demande de reverse */ unsigned fwdpos; /* Index dans le fichier de forward */ unsigned lastpos; /* Index precedent dans le fichier de forward */ int fwdlig; /* Numero de ligne dans le fichier de forward */ int cptif; /* Nombre des imbrications de IF */ int forward; /* Indicateur de forward en cours et voie de forward */ int no_con; /* Numero de la connexion forward */ int no_bbs; /* No de BBS en cours de forward */ int fin_fwd; /* Fin de forward sur le canal */ char con_lig[8][80]; /* Liste des commandes de connexion */ char mesnode[4][3][20]; /* Identificateurs de connexion */ char txt_con[40]; /* Texte envoye a la connexion */ char fwdbbs[8]; /* Nom de la BBS a forwarder */ struct typ_Forward *suite; /* Voie forward suivante */ } Forward; typedef struct beacon { indicat desti; indicat digi[8]; int nb_digi; struct beacon *next; } Beacon; typedef struct list_freq { int val; double freq; char cmde[41]; struct list_freq *next; } ListFreq; #define NBHEARD 20 typedef struct port_data { char canal; char compteur; char buf[257]; int len; int cmd; struct port_data *next; } PortData; typedef struct { int pk_t; /* Taille du paquet */ int min_fwd; /* Minute de forward du port */ int per_fwd; /* Periode de forward du port */ int maxbloc; /* Taille maximum du bloc forward */ int mem; /* Taille de memoire dispo dans le TNC */ int beacon_paclen; /* Paclen de la balise du port */ int synchro; /* Mode resync */ int fd; /* Descripteur du port */ int type; /* Type de connexion AX25/NR/ROSE */ int wait[MAXVOIES]; /* Packets a lire */ long cur; /* Nb d'octets envoyes sur le port */ int nbc; /* Vitesse du port */ char stop; /* Delai d'interruption du port */ char polling; /* Polling en cours */ char idem; /* Ne change pas de canal */ char frame; /* Nombre de frames */ char ccom; /* Numero du COM (0 a 7) */ char ccanal; /* Numero du canal dans le COM (1 a 4) */ char cur_can; /* Numero du canal en cours de polling */ char last_cmde; /* Derniere commande envoyee */ char pr_voie; /* No de la 1ere voie du port */ char nb_voies; /* Nombre de voies affectees dans le port */ char tt_can; /* Dernier canal TNC du port (DRSI/BPQ) */ char pvalid; /* validation du port */ char typort; /* Type de TNC sur le port 0=DED 1=PK232 */ char moport; /* mode d'acces du port */ char transmit; /* Port en emission (TOR) */ char echo; /* Echo sur le port (Modem) */ char portbuf[300]; /* Buffer des caracteres en cours de reception */ int portind; /* Index dans le buffer */ FbbTimer *t_delay; /* Id du timer delay */ FbbTimer *t_wait; /* Id du timer wait (Pactor) */ FbbTimer *t_busy; /* If du timer busy (Pactor) */ FbbTimer *t_iss; /* If du timer iss (Pactor) */ PortData *cmd; /* Commandes/Datas a envoyer au TNC */ PortData *last; /* Derniere Commandes/Datas envoyee au TNC */ Forward *listfwd; /* liste des voies forward du port */ char freq[10]; /* frequence du port */ char name[20]; /* Name of the logical port LINUX */ char fwd[NBMASK]; /* Liste des BBS forwardees sur le port */ Heard heard[NBHEARD]; /* Jheard */ ListFreq *lfreq; /* Tete de la liste des frequences */ } defport; typedef struct { int cbase; /* Adresse de base du COM */ int combios; /* Type d'interface logiciel */ int port; /* Numero du port telnet */ long baud; /* Vitesse du port */ #ifdef __WIN32__ HANDLE comfd; /* Ident du com port (Windows) */ #else int comfd; /* Ident du com port (Windows) */ #endif int irq; /* IRQ du port (Windows) */ int delai; /* Delai avant resync */ int ovr; /* Nb d'overruns */ char mult_sel; /* Selection courante du mux */ char options; /* Options : Deuxieme set de vitesses */ char multi[8]; /* Gestion du multiplexeur */ char compteur; /* compteur pour PTC */ char name[20]; /* Name of the device LINUX */ char pactor_st; /* Status of the pactor channel */ /* int rxptr_8 ; * Pointeur caracteres recus */ /* int rxptr_h ; * Pointeur caracteres lus */ /* int txptr_8 ; * Pointeur caracteres envoyes */ /* int txptr_h ; * Pointeur caracteres ecris */ /* char rxbuf_vide ; * Buffer de reception vide */ /* char txbuf_vide ; * Buffer d'emission vide */ /* char rxbuf[DIMBUF] ; * Buffer de reception */ /* char txbuf[DIMBUF] ; * Buffer d'emission */ } defcom; #ifdef __FBBDOS__ typedef struct { char *ptr; struct text_info sav_mod; unsigned int taille; unsigned char cg; unsigned char lh; unsigned char cd; unsigned char lb; } fen; #endif typedef struct param_fwd { char chaine[80]; int type; struct param_fwd *suiv; } typ_pfwd; typedef struct ymodem_list { struct ymodem_list *next; char filename[256]; long size_trans; long time_trans; int ok; } Ylist; typedef struct { uchar voie; uchar attr; char buf[160]; } Ligne; typedef struct { int first; /* 1ere ligne du buffer allouee a l'ecran */ int totlig; /* nb de lignes du buffer */ int curlig; /* Ligne de l'affichage */ int deblig; /* Ligne debut du buffer circulaire */ int carpos; /* Pointeur du caractere courant dans la ligne */ int scrlig; /* Pointeur de la ligne scrollee */ int voie; /* Voie du buffer de ligne */ int color; /* Couleur de la ligne courrante */ char cur_buf[160]; /* Buffer de la ligne en cours */ Ligne *ligne; } FScreen; typedef struct typ_edit_ch { int record; struct typ_edit_ch *suite; } edit_ch; typedef struct { int ligne; int carac; int max; int numero; int new_t; edit_ch *liste; } typedit; #define LABEL_FIC 80 #define LABEL_NOM 40 #define LABEL_OWN 8 typedef struct typYl { int record; long date_creation; char nomfic[LABEL_FIC]; struct typYl *suiv; } Ylabel; /* typedef struct { char nomfic[LABEL_FIC] ; char label[LABEL_NOM] ; long date_creation; long free; } Rlabel ; */ typedef struct { char nomfic[LABEL_FIC]; char label[LABEL_NOM]; char owner[LABEL_OWN]; fbb_long index; fbb_long date_creation; char free[24]; } Rlabel; /* 160 bytes */ typedef struct dde_huf_struct { int voie; int mode; bullist *bull; char header[160]; struct dde_huf_struct *next; } desc_huf; #define MAX_X 25 typedef struct { int nb_bid; int ls_bid; int r_bid; int ok_chck; unsigned chck; long numero[MAX_X]; char bid[MAX_X][13]; char ok_bid[MAX_X]; } XInfo; #define NBROUTE 10 typedef struct rt { char call[NBROUTE][7]; struct rt *suite; } Route; #ifdef __WINDOWS__ typedef struct { HWND hWnd; HINSTANCE hInst; /* hInstance of application */ int valid; /* int xChar, yChar, yCharnl; character size */ int xClient, yClient; /* client window size */ int nVscrollMax, nHscrollMax; /* scroll ranges */ int nVscrollPos, nHscrollPos; /* current scroll positions */ int numlines, numcolumns; /* number of lines/column in buffer */ int nVscrollInc, nHscrollInc; /* scroll increments */ int nPageMaxLines; /* max lines on screen */ int xPos, yPos; int val; HANDLE hbuff; LPSTR lpbuff; /* HFONT hnewsfont; * handle of new fixed font */ } WINF; typedef struct scrollkeys { WORD wVirtkey; int iMessage; WORD wRequest; } SCROLLKEYS; #endif typedef struct { int connect; /* voie connectee */ int ack; /* Ack de la voie */ int ret; /* Retry de la voie */ int stat; /* Etat du TNC */ int mem; /* Taille buffer dispo */ indicat callsign; /* Indicatif de la voie */ indicat indicatif; /* Indicatif de l'OM connecte */ indicat relais[8]; /* Indicatif des relais */ } stat_ch; #define NB_P_ROUTE 8 #define NB_DEL 50 typedef struct { sport affport; /* affectation des voies */ stat_ch sta; /* Etat de la voie */ char ch_status; /* Demande d'affichage du status */ int sid; /* Un SID a ete recu */ int aut_linked; /* Commande "Linked to" autorisee */ int nb_prompt; /* Nombre de prompts a attendre */ int private_dir; /* Acces au repertoire prive */ int aut_nc; /* Autorisation du (N)ext et (C)ontinue */ int rev_mode; /* Reverse Forward en mode MBL */ int data_mode; /* Forward des data */ int maj_ok; /* Autorise la mise a jour carnet de trafic */ int fbb; /* Autorise l'utilisation du protocole FBB */ int paclen; /* Longueur du paquet */ int mess_recu; /* Message entierement recu */ int stop; /* Arret de pagination */ int memoc; /* Memoire occupee par les buffers */ int conf; /* Indication de conference */ int xferok; /* Resultat du transfert */ int binary; /* Mode de fonctionnement des entrees */ int nb_err; /* nbre d'erreurs de la voie */ int dde_int; /* Demande d'interruption */ int lignes; /* Nbre de lignes dans la page en cours */ int niv1; /* Niveau 1 de procedures */ int niv2; /* Niveau 2 de procedures */ int niv3; /* Niveau 3 de procedures */ int sniv1; /* Sauve niveau 1 de procedures */ int sniv2; /* Sauve niveau 2 de procedures */ int sniv3; /* Sauve niveau 3 de procedures */ unsigned long mode; /* Aide : TRUE */ unsigned droits; /* Droits d'acces du sysop */ unsigned short checksum; /* Checksum transfert */ unsigned prot_fwd; /* Protocoles de forward supportes */ int timout; /* Temps de time-out de la voie */ int deconnect; /* Demande de deconnexion */ int cross_connect; /* Indicateur de cross_connexion */ int send_count; /* Time out yapp */ int type_yapp; /* Type de YAPP utilise (1 = Checksum) */ int dde_marche; /* Demande de mise en marche */ int mbl; /* Mode de fonctionnement */ int kiss; /* Mode kiss : get-away */ int groupe; /* current group */ long cur_bull; /* current bulletin */ int ch_mon; /* Mode monitoring du gateway */ int temp1; int temp2; int temp3; int ind_mess; /* Indice du tableau de messages */ int t_tr; /* Indique un traitement en cours */ int seq; /* Interruption traitements longs */ int sr_mem; /* gestion de la memoire de sortie */ int log; /* autorisation de log */ unsigned no_indic; /* Numero de l'indicatif dans la liste */ unsigned warning; /* Demande de warnings */ date_t tdeb; double t_trajec; double r4; double r6; uchar msg_held; /* Messages de la voie a passer en HOLD */ uchar pack; /* Packets en cours d'emission */ uchar mbl_ext; /* Extension du forward MBL (LATER/REJECT) */ /* uchar xfwd ; Protocole XFWD identifie */ uchar ret; /* Return character seen */ uchar read_only; /* Mode d'acces read-only */ uchar vdisk; /* Numero du disque virtuel de FbbDos */ uchar reverse; /* Sens de balayage de la liste des messages */ uchar entete; /* Position dans la reception d'un message */ uchar header; /* Lignes R: recues */ uchar bbsfwd; /* numero de la bbs forwardee */ uchar maxfwd; /* taille max des messages forwardes */ uchar oldfwd; /* delai max des messages forwardes */ uchar typfwd; /* Type de messages forwardes (0 = tous) */ uchar nb_choix; /* Nombre de choix du link courant */ uchar cur_choix; /* Choix surlequel se fait le link */ uchar nb_egal; /* Nombre de messages '=' en instance */ /* uchar nb_dupes ; Nombre de messages dupliques dans bloc */ uchar m_ack; /* Demande un message d'ack */ uchar clock; /* Mise a l'heure PMS */ uchar rev_param; /* Mise a jour des parametres en reverse */ uchar cmd_new; /* Commande "new" running */ int maxbuf; /* uchar wp ; * Demande de mise a jour des "White Pages" */ double w; /* Sauvegarde longitude */ double l; /* Sauvegarde latitude */ double cumul_dist; /* Cumul de distances */ long debut; /* Heure de debut de connexion */ long tstat; /* Temps d'occupation des rubrique */ long stemps[NBRUB]; /* Temps d'occupation par rubrique */ long tmach; /* Temps machine cumule par voie */ long messdate; /* Date de creation du message */ int typlist; /* type de liste (avec / sans BID) */ int localmode; /* Mode de fonctionnement local a la voie */ long ask; /* Demande de traitement apres huffman */ long nmess; /* No du message en cours de forward */ long tailm; /* Taille du message en cours */ long size_trans; /* Taille du transfert */ long time_trans; /* Temps de transfert */ long l_mess; /* Dernier message liste par L */ long l_hold; /* Dernier message liste par RE */ long l_yapp; /* Derniere consultation du YN */ long mess_num; /* Numero original du message */ long mess_egal[NB_DEL]; /* Numero des messages reportes */ long pass_time; /* Time pour calculer le passwd MD2 */ char ch_temp[MAXPATH]; /* Stockage temporaire */ char label[MAXPATH]; /* Label du fichier en cours de reception */ char dos_path[41]; /* Path actuel du DOS */ char mess_home[41]; /* Home BBS du message */ char passwd[5]; /* Password */ char sr_fic[MAXPATH]; /* nom du fichier en cours d'emission */ char mess_bid[13]; /* nom du fichier en cours d'emission */ Ylabel *llabel; /* Liste des label YAPP */ rd_list *t_read; /* tete de la liste des messages a lire */ rd_list *t_list; /* liste des messages a lister */ tlist recliste; /* Sauvegarde contexte trait. long */ Forward *curfwd; /* Bloc courant de forward */ long noenr_menu; obuf *outptr; /* pointeur du buffer de sortie */ ibuf inbuf; /* structures de buffers reception */ char appendf[MAXPATH]; /* nom du fichier append */ char chck; /* Checksum transfert binaire */ bullist entmes; /* pointeur de la structure message */ bullist fb_mess[MAX_FB]; /* Messages en attente de forward */ char ok_mess[MAX_FB]; /* Messages en attente de com/decompression */ ind_noeud *emis; /* noeud de travail */ ind_noeud *ncur; /* noeud de la pers. connectee */ info finf; /* struct enr. fichier info */ obuf *msgtete; /* tete de message en cours d'ecriture */ long enrcur; /* enrg. du msg. en cours */ struct ffblk dirblk; /* structures DTA des directories */ typedit tete_edit; /* structure de l'editeur */ Route *r_tete; /* Tete des routes en reception message */ Route *r_curr; /* Curr des routes en reception message */ int r_pos; /* position dans le tableau */ char p_route[NB_P_ROUTE][7]; /* routes prioritaires */ Ylist *ytete; /* Tete de la liste de fichiers en batch */ typ_pfwd *ctnc; /* Init du TNC apres la connection */ void *ptemp; /* Poiteur pour applis temporaires */ unsigned psiz; /* Taille de l'alloc temporaire */ XInfo *Xfwd; /* Structure pour XForwarding */ #ifdef __linux__ int to_rzsz[2]; /* Pipe pour la communication avec RZ/SZ */ int to_xfbb[2]; /* Pipe pour la communication avec RZ/SZ */ int rzsz_pid; #endif #ifdef __WINDOWS__ WINF Winh; /* Informations fenetre */ #ifdef __WIN32__ HANDLE task; /* Tache en cours */ #else HTASK task; /* Tache en cours */ #endif #endif } Svoie; /* #if !defined(MAIN) */ #include "fbb_var.h" #include "fbb_dec.h" /* #endif */ #if FBB_DEBUG void debut_fonction (char *, int, char *); void fin_fonction (void); void print_fonction (FILE *); void print_history (FILE *); #define df(str,lg) debut_fonction(str, lg, MK_FP(_SS, _BP)) #define ff() fin_fonction() #else #define df(str,lg) #define ff() #endif #include #endif /* _fbb_serv */ fbb-7.0.10/include/serv.h0000644000175000017500000000574513613360505012041 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * Fichier des variables locales */ #ifndef _XFBB_SERV_H #define _XFBB_SERV_H #define ENGLISH #include #include #include #define _timezone timezone #define xprintf printf #define cprintf printf #define stricmp strcasecmp #define strcmpi strcasecmp #define strnicmp strncasecmp #define strncmpi strncasecmp #define _read read #define _write write #define wsprintf sprintf #define tell(fd) lseek((fd), 0L, SEEK_CUR) #define MAXPATH 512 #define O_BINARY 0 #define O_TEXT 0100000 /* ne doit pas gener ds fcntl.h */ struct ftime { unsigned ft_tsec : 5; /* Two second interval */ unsigned ft_min : 6; /* Minutes */ unsigned ft_hour : 5; /* Hours */ unsigned ft_day : 5; /* Days */ unsigned ft_month : 4; /* Months */ unsigned ft_year : 7; /* Year */ }; #define FA_NORMAL 0x00 /* Normal file, no attributes */ #define FA_RDONLY 0x01 /* Read only attribute */ #define FA_HIDDEN 0x02 /* Hidden file */ #define FA_SYSTEM 0x04 /* System file */ #define FA_LABEL 0x08 /* Volume label */ #define FA_DIREC 0x10 /* Directory */ #define FA_ARCH 0x20 /* Archive */ #define FA_LINK 0x80 /* Lien */ #define FBB_NAMELENGTH 128 #define FBB_MASKLENGTH 64 #define FBB_BASELENGTH 256 struct ffblk { DIR *ff_dir; char ff_mask[FBB_MASKLENGTH+1]; char ff_base[FBB_BASELENGTH+1]; char ff_attrib; unsigned ff_ftime; unsigned ff_fdate; long ff_fsize; char ff_name[FBB_NAMELENGTH+1]; }; /* #define MAXPATH 80 */ #define MAXDIR 66 #define MAXFILE 9 #define MAXEXT 5 #define P_WAIT 0 #include "fbb_serv.h" extern int filter (char *, char *, int , char * , char *); #define CM_OPTIONJUSTIF 0 #define CM_OPTIONALARM 1 #define CM_OPTIONCALL 2 #define CM_OPTIONGATEWAY 3 #define CM_OPTIONAFFICH 4 #define CM_OPTIONSOUNDB 5 #define CM_OPTIONEDIT 6 #define CM_OPTIONINEXPORT 7 #define CM_FILESCANMSG 10 #endif fbb-7.0.10/include/global.h0000644000175000017500000000332213613360505012307 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* GLOBAL.H - RSAREF types and constants */ /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef PROTOTYPES #define PROTOTYPES 0 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word */ typedef unsigned long int UINT4; /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif fbb-7.0.10/include/ufortify.h0000644000175000017500000000437713613360505012731 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * FILE: * ufortify.h * * DESCRIPTION: * User options for fortify. Changes to this file require fortify.c to be * recompiled, but nothing else. */ #define FORTIFY_STORAGE #define FORTIFY_BEFORE_SIZE 16 /* Bytes to allocate before block */ #define FORTIFY_BEFORE_VALUE 0xA3 /* Fill value before block */ #define FORTIFY_AFTER_SIZE 16 /* Bytes to allocate after block */ #define FORTIFY_AFTER_VALUE 0xA5 /* Fill value after block */ #define FILL_ON_MALLOC /* Nuke out malloc'd memory */ #define FILL_ON_MALLOC_VALUE 0xA7 /* Value to initialize with */ #define FILL_ON_FREE /* free'd memory is cleared */ #define FILL_ON_FREE_VALUE 0xA9 /* Value to de-initialize with */ #define CHECK_ALL_MEMORY_ON_MALLOC #define CHECK_ALL_MEMORY_ON_FREE #define PARANOID_FREE #define WARN_ON_MALLOC_FAIL /* A debug is issued on a failed malloc */ #define WARN_ON_ZERO_MALLOC /* A debug is issued on a malloc(0) */ #define WARN_ON_FALSE_FAIL /* See Fortify_SetMallocFailRate */ #define WARN_ON_SIZE_T_OVERFLOW/* Watch for breaking the 64K limit in */ /* some braindead architectures... */ #define FORTIFY_LOCK() #define FORTIFY_UNLOCK() fbb-7.0.10/include/terminal.h0000644000175000017500000000214013613360505012657 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ void init_terminal(int termmode, char *call); void end_terminal(void); int read_terminal(char *buf, int len); void write_terminal(char *buf, int bytes); fbb-7.0.10/include/fmtheaders.h0000644000175000017500000000552413613360505013177 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #ifndef _FMTHEADERS_H #define _FMTHEADERS_H 1 #include /* Definitions for .VOC files */ #define MAGIC_STRING "Creative Voice File\0x1A" #define ACTUAL_VERSION 0x010A #define VOC_SAMPLESIZE 8 #define MODE_MONO 0 #define MODE_STEREO 1 #define DATALEN(bp) ((u_long)(bp->datalen) | \ ((u_long)(bp->datalen_m) << 8) | \ ((u_long)(bp->datalen_h) << 16) ) typedef struct _vocheader { u_char magic[20]; /* must be MAGIC_STRING */ u_short headerlen; /* Headerlength, should be 0x1A */ u_short version; /* VOC-file version */ u_short coded_ver; /* 0x1233-version */ } VocHeader; typedef struct _blocktype { u_char type; u_char datalen; /* low-byte */ u_char datalen_m; /* medium-byte */ u_char datalen_h; /* high-byte */ } BlockType; typedef struct _voice_data { u_char tc; u_char pack; } Voice_data; typedef struct _ext_block { u_short tc; u_char pack; u_char mode; } Ext_Block; /* Definitions for Microsoft WAVE format */ #define RIFF 0x46464952 #define WAVE 0x45564157 #define FMT 0x20746D66 #define DATA 0x61746164 #define PCM_CODE 1 #define WAVE_MONO 1 #define WAVE_STEREO 2 /* it's in chunks like .voc and AMIGA iff, but my source say there are in only in this combination, so I combined them in one header; it works on all WAVE-file I have */ typedef struct _waveheader { u_long main_chunk; /* 'RIFF' */ u_long length; /* filelen */ u_long chunk_type; /* 'WAVE' */ u_long sub_chunk; /* 'fmt ' */ u_long sc_len; /* length of sub_chunk, =16 */ u_short format; /* should be 1 for PCM-code */ u_short modus; /* 1 Mono, 2 Stereo */ u_long sample_fq; /* frequence of sample */ u_long byte_p_sec; u_short byte_p_spl; /* samplesize; 1 or 2 bytes */ u_short bit_p_spl; /* 8, 12 or 16 bit */ u_long data_chunk; /* 'data' */ u_long data_length; /* samplecount */ } WaveHeader; #endif fbb-7.0.10/include/xfbb.h0000644000175000017500000001232313613360505011771 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * Fichier des variables locales */ #define ENGLISH #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define IDOK 1 #define IDCANCEL 0 #define IDYES 1 #define IDNO 2 #define MB_OK 0x0000 #define MB_OKCANCEL 0x0001 #define MB_YESNOCANCEL 0x0003 #define MB_YESNO 0x0004 #define MB_ICONHAND 0x0010 #define MB_ICONQUESTION 0x0020 #define MB_ICONEXCLAMATION 0x0030 #define MB_ICONASTERISK 0x0040 #define MB_ICONINFORMATION MB_ICONASTERISK #define ED_MESSAGE 1 #define ED_EDITMSG 2 #define SEPARATOR 0 #define BUTTON 1 #define TOGGLE 2 #define TOOLBUTTON 3 #ifndef PUBLIC #define PUBLIC extern #endif PUBLIC XtAppContext app_context; PUBLIC XmRendition r_rend[10]; PUBLIC int r_index; PUBLIC FILE *p_fptr; PUBLIC Pixel df_pixel; PUBLIC Pixel rf_pixel; PUBLIC Pixel vf_pixel; PUBLIC Pixel bf_pixel; PUBLIC Pixel no_pixel; PUBLIC Pixel rc_pixel; PUBLIC Pixel vc_pixel; PUBLIC Pixel bc_pixel; PUBLIC Widget toplevel; PUBLIC Widget form; PUBLIC Widget pb; PUBLIC Widget MenuBar; PUBLIC Widget MenuFile; PUBLIC Widget MenuUser; PUBLIC Widget MenuEdit; PUBLIC Widget MenuWindow; PUBLIC Widget MenuOptions; PUBLIC Widget MenuConfig; PUBLIC Widget MenuPactor; PUBLIC Widget MenuHelp; PUBLIC Widget ToolBar; PUBLIC Widget Jauge; PUBLIC Widget ListForm; PUBLIC Widget ConnectLabel; PUBLIC Widget StatForm; PUBLIC Widget StatusLabel; PUBLIC Widget ConnectList; PUBLIC Widget ConnectString; PUBLIC Widget StatList; PUBLIC Widget Footer; PUBLIC int foothelp; PUBLIC int editoron; #define NB_ICON 16 PUBLIC Widget BIcon[NB_ICON]; #define NB_INIT_B 11 PUBLIC Widget Tb[NB_INIT_B]; PUBLIC Widget ScanSys; PUBLIC Widget ScanMsg; /* Liste des widgets de status */ PUBLIC Widget TxtUsed; PUBLIC Widget TxtGMem; PUBLIC Widget TxtDisk1; PUBLIC Widget TxtDisk2; PUBLIC Widget TxtMsgs; PUBLIC Widget TxtResync; PUBLIC Widget TxtState; PUBLIC Widget TxtHold; PUBLIC Widget TxtPriv; PUBLIC Widget Used; PUBLIC Widget GMem; PUBLIC Widget Disk1; PUBLIC Widget Disk2; PUBLIC Widget Msgs; PUBLIC Widget Resync; PUBLIC Widget State; PUBLIC Widget Hold; PUBLIC Widget Priv; PUBLIC Widget Popup; PUBLIC Widget Opt[10]; #define NB_PITEM 5 PUBLIC Widget PItem[NB_PITEM]; PUBLIC int CurrentSelection; int can_talk (int); int editor_on (void); int GetChList(void); int MessageBox(int, char *, char *, int); int record_message (char *ptr, int len); int set_callsign (char *buf); int SetChList(int clean); int talk_to (int channel); void CreateEditor(char *, char *, char *, int, int); void cursor_wait(void); void disconnect_channel(int, int); void end_edit (int); void end_wait(void); void FbbRequestUserList (void); void FbbSync (void); void EditMsgCB(Widget, XtPointer, XtPointer); void EditUsrCB(Widget, XtPointer, XtPointer); void get_callsign (char *buf); void ListCnxCB(Widget, XtPointer, XtPointer); void PendingCB(Widget, XtPointer, XtPointer); void set_option (int, int); void TextFieldGetString(Widget w, char *str, int len, int upcase); void HideFbbWindow(int numero, Widget parent); void AboutDialog(Widget, XtPointer, XtPointer); void CopyDialog(Widget, XtPointer, XtPointer); void InfoDialog(Widget, XtPointer, XtPointer); void CallsignDialog(Widget, XtPointer, XtPointer); void EditMessage(Widget); void EditUser(Widget); void ListCnx(Widget); void OptionsCB(Widget w, XtPointer client_data, XtPointer call_data); void PendingForward(Widget); void LabelSetString(Widget, char *, char *); void ScanMsgCB (Widget w, XtPointer client_data, XtPointer call_data); void ShowFbbWindow(int, Widget); void sysop_end(void); void TalkToCB (Widget w, XtPointer client_data, XtPointer call_data); void ToggleFbbWindow(int numero, Widget parent); void DisplayInfoDialog(int); void CreateEditor(char *file, char *preload, char *title, int options, int autow); Widget add_item(int type, Widget menu_pane, char *nom, XtPointer callback, XtPointer data, char *help, XtPointer HelpCB); fbb-7.0.10/include/xfbbX.h0000644000175000017500000000670713613360505012132 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * Fichier des variables locales */ #define ENGLISH #ifdef __MAIN__ #define PUBLIC #else #define PUBLIC extern #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MB_OK 0x0000 #define MB_OKCANCEL 0x0001 #define MB_YESNOCANCEL 0x0003 #define MB_YESNO 0x0004 #define MB_ICONHAND 0x0010 #define MB_ICONQUESTION 0x0020 #define MB_ICONEXCLAMATION 0x0030 #define MB_ICONASTERISK 0x0040 #define MB_ICONINFORMATION MB_ICONASTERISK #define FBB_MSGS 1 #define FBB_STATUS 2 #define FBB_NBCNX 4 #define FBB_LISTCNX 8 #define FBB_MONITOR 16 #define FBB_CONSOLE 32 #define FBB_CHANNEL 64 #define FBB_XFBBX 128 #define CONSOLE 0 #define MONITOR 1 #define ALLCHANN 2 #define MAX_CONF 4 #define MAXFEN 3 typedef struct { char name[80]; char mycall[80]; char host[80]; char pass[256]; int port; int mask; } conf_t; PUBLIC Display *display; PUBLIC conf_t conf[MAX_CONF]; PUBLIC unsigned curconf; PUBLIC Widget Rmt[MAX_CONF]; PUBLIC Widget toplevel; PUBLIC int fenetre[MAXFEN]; PUBLIC int CurrentSelection; #ifdef __cplusplus extern "C" { #endif /* xfbbX.c */ extern int close_connection (void); extern int console_input (char *, int); extern int init_orb (char *); extern int MessageBox (int, char *, char *, int); extern void Caption (int); extern void LabelSetString (Widget, char *, char *); /* xfbbXcnsl.c */ extern void AllChanCB (Widget, XtPointer, XtPointer); extern void ConsoleCB (Widget, XtPointer, XtPointer); extern void HideFbbWindow (int numero, Widget parent); extern void MonitorCB (Widget, XtPointer, XtPointer); extern void set_win_colors (void); extern void ShowFbbWindow (int, Widget); extern void sysop_end (void); extern void window_init (void); extern void window_write (int, char *, int, int, int); /* xfbbXabtd.c */ extern int GetConfig (void); extern int PutConfig (void); extern void AboutDialog (Widget, XtPointer, XtPointer); extern void CallsignDialog (Widget, XtPointer, XtPointer); extern void CopyDialog (Widget, XtPointer, XtPointer); extern void SetupDialog (Widget, XtPointer, XtPointer); #ifdef __cplusplus } #endif fbb-7.0.10/include/pbsv.h0000644000175000017500000000453613613360505012031 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* pbsv.h 1993.8.6 */ #define DEBUG 1 #define PBSV_VER "0.04" #define PBSV_ID "[930806]" typedef int VOID; typedef int BOOL; typedef int TINY; #define OK 1 #define NG 0 #define ON 1 #define OFF 0 #define NOT_DEFINE (-1) #define MAXUSER 20 #define MAXHOLE 100 #define MAXPFHDIR 16384 #define MAXBLKSIZE 244 #define ADRSIZE 7 /* adrs length */ #define CALLSIZE 10 #define HDRSIZE (1+7+7+1+1) #define FRMSIZE 2048 #define F_DIR 0x0001 extern unsigned short calc_crc(unsigned char c, unsigned short crc); struct stqcell { struct stqcell *next; }; struct stqueue { struct stqcell *head; struct stqcell *tail; }; struct sthole { struct sthole *next; long offset; ushort length; time_t start; time_t end; }; struct stuser { struct stuser *next; time_t entry_t; ushort flags; char call[CALLSIZE]; int file_type; long file_id; ushort block_size; long file_size; struct stqueue hole; }; struct stpfhdir { time_t t_old; time_t t_new; long file_id; int pfh_type; /* int pfh_size; */ }; struct stpfh { u_long file_number; char file_name[8]; char file_ext[3]; u_long file_size; u_long create_time; u_long last_modied_time; u_char seu_flag; u_char file_type; ushort body_checksum; ushort header_cecksum; ushort body_offset; ushort pfh_size; }; /* pbsv.h */ fbb-7.0.10/include/crc.h0000644000175000017500000001014213613360505011614 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* crctab calculated by Mark G. Mendel, Network Systems Corporation */ static const unsigned short crctab[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; /* * updcrc macro derived from article Copyright (C) 1986 Stephen Satchell. * NOTE: First srgument must be in range 0 to 255. * Second argument is referenced twice. * * Programmers may incorporate any or all code into their programs, * giving proper credit within the source. Publication of the * source routines is permitted so long as proper credit is given * to Stephen Satchell, Satchell Evaluations and Chuck Forsberg, * Omen Technology. */ /* #define updcrc(cp, crc) ( crctab[((crc >> 8) & 255)] ^ (crc << 8) ^ cp) */ /*#define updcrc(cp, crc) ((crc << 8) ^ crctab[(cp & 0xff) ^ (crc >> 8)])*/ #define updcrc(cp, crc) ( (crctab[((crc >> 8) & 0xFF) ^ cp] ^ (crc << 8)) & 0xFFFF) fbb-7.0.10/include/fbb_orb.h0000644000175000017500000001037513613360505012450 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * Packet sent protocol : * buf[0] = service * buf[1] = command * buf[2] = data length LSB * buf[3] = data length MSB * * Service : * ORB_CONSOLE * ORB_MONITOR * ORB_CHANNEL * data[0] = channel (CONSOLE=0, MONITOR=0xff, channel [1..254]); * data[1] = color; * data[2] = header; * data[3..] = data * ORB_XFBBX * data[0] = 0: disconnected * 1: connected * 2: connexion refused * 3: ask editor for Sx * 4: ask editor for SR * ORB_LISTCNX * (data = connection line) * ORB_MSGS * (data = private and bulletin number) * ORB_STATUS * (data = status) * ORB_NBCNX * (data = connection number) * ORB_DATA * Command = 0 : list of services * (data = list of services (one per byte)) * Command = 1 : Dir * (1st packet = filename/dir-mask, next packets = data, length=0 = end) * Command = 2 : File sent to client * (1st packet = filename+size, next packets = data, length=0 = end) * Command = 3 : File received accepted (length=0) * (1st packet = filename+size, next packets = data, length=0 = end) * Command = 4 : Forward management to client * (1st packet = filename+size, next packets = data, length=0 = end) * Command = 5 : Disconnection of users * (1st packet = Channel(1..50) callsign immediate(0/1)) */ /* * Packet received protocol : * buf[0] = service * buf[1] = command * * Service : * ORB_REQUEST * Command : * 0 : mask configuration * buf[2] = mask * 1 : Directory (mask follows) * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = directory mask * 2 : get file (filename follows) * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = filename * 3 : put file (1st packet = filename, next packets = data, length=0 = end) * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = filename or data * 4 : forward management * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command * 5 : disconnect request * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command * 6 : user management * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command * 7 : message management * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command * 8 : message request * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command * 9 : options management * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command * 10: pactor management * buf[2] = data length LSB * buf[3] = data length MSB * buf[4..] = command */ #define ORB_REQUEST 0 #define ORB_MSGS 1 #define ORB_STATUS 2 #define ORB_NBCNX 4 #define ORB_LISTCNX 8 #define ORB_MONITOR 16 #define ORB_CONSOLE 32 #define ORB_CHANNEL 64 #define ORB_XFBBX 128 #define ORB_DATA 0 #define SVC_LIST 0 #define SVC_DIR 1 #define SVC_RECV 2 #define SVC_SEND 3 #define SVC_FWD 4 #define SVC_DISC 5 #define SVC_USER 6 #define SVC_MSG 7 #define SVC_MREQ 8 #define SVC_OPT 9 #define SVC_PACTOR 10 #define SVC_INFO 11 #define SVC_MAX 12 #define IYapp 1 #define ICall 2 #define IDigis 3 #define IName 4 #define IHome 5 #define IChan 6 #define IPort 7 #define IN1N2N3 8 #define IFlags 9 #define IPaclen 10 #define IStatus 11 #define IMem 12 #define IBuf 13 #define IRet 14 #define IPerso 15 #define IUnread 16 fbb-7.0.10/COPYING0000644000175000017500000004311013613360505010305 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. fbb-7.0.10/doc/0000755000175000017500000000000013747536076010120 500000000000000fbb-7.0.10/doc/Makefile.in0000644000175000017500000005100413747457130012076 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" DATA = $(doc_DATA) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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 = $(datadir)/doc/@PACKAGE@ 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@ runstatedir = @runstatedir@ 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@ doc_DATA = \ satdoc-e.doc\ satdoc-f.doc\ satupdat.doc\ fbb.conf.min.sample\ fbb.conf.sample\ fbb.sh edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@prefix[@]|$(prefix)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@package_string[@]|$(PACKAGE_NAME)$(PACKAGE_VERSION)|g' \ -e 's|@package_version[@]|$(PACKAGE_VERSION)|g' CLEANFILES = fbb.sh fbb.conf.min.sample fbb.conf.sample SUBDIRS = html EXTRA_DIST = \ satdoc-e.doc\ satdoc-f.doc\ satupdat.doc\ fbb.conf.min.sample.in\ fbb.conf.sample.in\ fbb.sh.in all: all-recursive .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 doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ 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 check-am: all-am check: check-recursive all-am: Makefile $(DATA) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(docdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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 Makefile distclean-am: clean-am distclean-generic distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-docDATA 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 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: uninstall-docDATA .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ check-am clean clean-generic cscopelist-am ctags ctags-am \ distclean distclean-generic distclean-tags distdir dvi dvi-am \ html html-am info info-am install install-am install-data \ install-data-am install-docDATA 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-am uninstall \ uninstall-am uninstall-docDATA .PRECIOUS: Makefile fbb.sh: fbb.sh.in Makefile $(edit) $(srcdir)/$@.in > $@ fbb.conf.min.sample: fbb.conf.min.sample.in Makefile $(edit) $(srcdir)/$@.in > $@ fbb.conf.sample: fbb.conf.sample.in Makefile $(edit) $(srcdir)/$@.in > $@ # 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: fbb-7.0.10/doc/satupdat.doc0000644000175000017500000001351013613360505012334 00000000000000 Documentation for SATUPDAT / AJOURSAT by Bernard Pidoux, F6BVP DOS version created October 16, 1989 ported to Linux by Jean-Paul F6FBB satupdat program will read messages from AMSAT copied via packet radio. It extracts keplerian elements both in NASA and AMSAT formats and updates the data into the satellites data base of the F6FBB's BBS file that should be in the directory fbb/system/sat/satel.dat satupdat program must be put in the fbb/bin directory, together with binaries. Running satupdat without arguments will print the following message on your screen (between lines -----): ----------------------------------------------------------------------- Automatic update of satellites orbital parameters for F6FBB's bbs Version 1.83e - November 1994 - Bernard Pidoux, F6BVP Linux version - April 1997 - Jean-Paul ROUBELAT F6FBB Usage: satupdat [file name<.txt>] Reading option: /a AMSAT format (default) /n NASA format Update option: /f merging new and old data (default) /u update only satellites being in the data base /s keep only satellites being in the input file Delete option: /dxxx delete data older than xxx days (default xxx=100 days) <<769 satellites maximum>> ----------------------------------------------------------------------- Version 1.82 October 1994 ========================= This version replaces earlier versions to be compatible with REQKEP, a new satellite KEPlerian elements REQuest service for F6FBB BBS. A few minor bugs have been fixed and the number of satellites that can be managed by the program was increased to 768. Version 1.80 November 1993 ========================== This new version incorporates a new feature that deletes automatiquely from the satellites data base, keplerian parameters older than a specified number of days. Default is 100 days. This cleans the data base, removing decayed satellites without sysop intervention. Both AMSAT and NASA format checksum are verified, providing uncorrupted data feeding of the BBS data base. SYSOP information: For automatic update of keplerian elements into F6FBB's bbs, just create a virtual BBS into bbs.sys file. Its name could be AMSAT for example. 30 F5NUF 31 F5JAD 32 33 AMSAT <- Modify a free entry of bbs.sys to add AMSAT 34 35 36 37 Then declare the following forward in the file forward.sys : ------ * A AMSAT * G AMSAT P @ * * Adjust the next line depending of the xfbb root directory * C /fbb/system/sat/amsat.txt * ------ CAUTION: The path name should be the exact one of your configuration. In order to run automatically satupdat when xfbb makes its maintenance, you must modify the xfbb.sh batch file like the following example: maintenance() { echo "Running maintenance" sleep 2 epurmess epurwp 40 90 # Added lines for satupdat if [ -f $XFBBDIR/system/sat/amsat.txt ] then cd $XFBBDIR/system/sat satupdat amsat /n > satupdat.res satupdat amsat >> satupdat.res rm amsat.txt cd $XFBBDIR fi } SATUPDAT OPTIONS ================ The default extention for input file is .txt, however you can specify another extention. Both arguments after the filename in the command line are optional: the first one indicates the reading format, either the AMSAT format or the NASA "2-line" format. The first one is selected by default. The second option is for the choice of update mode. By default the program will merge the old list with the new one (same if you select option /f). Old data of satellites which are not present in the input file are kept as is and the other ones are updated. Option /u can be selected if you dont want to add new satellites to the ones already present. Only keplerian elements from known satellites are updated. This prevents the list to grow with incoming satellites that you are not eventually interested in. Option /s, on the contrary, gives you the possibility to keep only in the data base the data from the satellites whose name is in the input file. This can help you to suppress old satellites from the data base. Option /d is optionnal. Default is 100 days. This means that the program will remove data older than 100 days from the satellite data base, and will not take into account keplerian elements older than 100 days from the input file. In all cases the program takes care of the permanent data of satellites such as the frequency (for doppler) and the step for computing the tracking (the SYSOP must provide both manually only the first time). If the keplerian elements of the input file are older than the ones already present in the BBS data base, the old ones are kept. The list is sorted by name in order to help finding of the satellite name when someone is connected to the BBS. If elements for one satellite are duplicated in the input file, the program will look again for the newest data. Of course, if CRC computed by the program is not the same as the one in the input file, the program informs you that the CRC is BAD and it does not take the keplerian elements. In the batch file example given above you have certainly noticed that I call twice the program satupdat with two different format arguments. The first time I ask the program to read the NASA format and the second time to read the default format AMSAT. The reason is that the probability for an error to occure in both formats for the same satellite is very small. Thus if an error occurs in one format the program will complete the update when it founds uncorrupted keplerian elements in the other format. Thanks to the checksum adopted by AMSAT! The results of the update operation is written into the satupdat.res file. All remarks and suggestions will be appreciated by F6BVP. 73's de Bernard, F6BVP @F6BVP.FRPA.FRA.EU f6bvp@amsat.org http://f6bvp.free.fr fbb-7.0.10/doc/Makefile.am0000644000175000017500000000160513613360505012056 00000000000000docdir = $(datadir)/doc/@PACKAGE@ doc_DATA = \ satdoc-e.doc\ satdoc-f.doc\ satupdat.doc\ fbb.conf.min.sample\ fbb.conf.sample\ fbb.sh edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@prefix[@]|$(prefix)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@package_string[@]|$(PACKAGE_NAME)$(PACKAGE_VERSION)|g' \ -e 's|@package_version[@]|$(PACKAGE_VERSION)|g' fbb.sh: fbb.sh.in Makefile $(edit) $(srcdir)/$@.in > $@ fbb.conf.min.sample: fbb.conf.min.sample.in Makefile $(edit) $(srcdir)/$@.in > $@ fbb.conf.sample: fbb.conf.sample.in Makefile $(edit) $(srcdir)/$@.in > $@ CLEANFILES = fbb.sh fbb.conf.min.sample fbb.conf.sample SUBDIRS = html EXTRA_DIST = \ satdoc-e.doc\ satdoc-f.doc\ satupdat.doc\ fbb.conf.min.sample.in\ fbb.conf.sample.in\ fbb.sh.in fbb-7.0.10/doc/satdoc-f.doc0000644000175000017500000001110213613360505012202 00000000000000 Documentation du programme SATDOC version 2.8.6 sous Linux - 29 septembre 2009 SATDOC est un programme complementaire du logiciel BBS de F6FBB. Mais on peut aussi l'utiliser seul. Copier ans.txt, Makefile et satdoc.c dans un même répertoire. Entrer dans ce répertoire. Compiler le fichier source satdoc.c en tapant make Tout d'abord, pour en vérifier le bon fonctionnement tapez ./satdoc ans.txt ou bien ./satdoc -i ans.txt ans.txt comporte des bulletins de l'AMSAT NEWS SERVICE qui donnent des informations utiles sur les satellites en service diffuse par Internet ou paquet radio. Dans le premier cas SATDOC va creer des fichiers nnnnn.sat avec le numero NASA de chaque satellite comme nom de fichier. Dans le second cas (option -i) SATDOC nommera les fichiers au nom de chaque satellite. Cette option est plus utile pour une consultation locale des fichiers. INTRODUCTON =========== Merci a Mike N1JEZ qui a courtoisement accepte ma proposition de modifier ses bulletins ANS a partir du numero ANS-292 et dont vous avez peut etre note le changement. J'ai demande a Mike d'introduire une ligne comportant le numero de catalogue apres la ligne d'identification de chaque satellite. Un peu comme dans les bulletins d'elements kepleriens de l'AMSAT. Ce numero de catalogue ouvre en effet la voie au traitement automatise de l'information sur chaque satellite en vue de mettre a jour les fichiers documentaires presents dans les serveurs BBS type F6FBB. SATDOC parcourre le fichier AMSAT.TXT exporte par le systeme de courrier de la BBS, et recherche la presence des bulletins AMSAT NEWS SERVICE dans le but d'y recuperer les informations pertinentes de chaque satellite. Chaque objet en orbite se voit en effet attribuer un numero de catalogue international par la NASA. Ceci permet de construire un nom de fichier non equivoque a partir de ce numero et de l'extension .SAT A l'inverse, les noms des satellites peuvent etre multiples et ambigus. COMMENT LE SYSOP DOIT-IL INSTALLER ET CONFIGURER LE SYSTEME DE MISE A JOUR DOCUMENTAIRE ======================================================================================= Si vous avez deja mis en place le logiciel AJOURSAT pour la mise a jour des elements kepleriens des satellites, vous pouvez sauter le paragraphe suivant. Vous devez creer un BBS fictif nomme AMSAT dans le fichier BBS.SYS Le fichier amsat.fwd de forward pour ce BBS fictif AMSAT pourra ressembler a ceci : A AMSAT * G KEPLER G AMSAT P @ c /usr/local/var/ax25/fbb/sat/amsat.txt B AMSAT F AMSAT F KEP F KEPS F KEPLER F SAT F SATTV F SATELL ----------- Ainsi AMSAT.TXT collectera tous les messages ayant une documentation sur les satellites (frequences, changement de mode, information de lancements etc...) Les SYSOPs doivent ensuite ajouter un appel au programme SATDOC dans le script de maintenance juste avant l'appel a AJOURSAT avec AMSAT.TXT comme argument. Le resultat du fonctionnement du programme est ecrit dans le fichier SATDOC.RES -------------extrait du script de la procedure de maintenance------------- if [ -e $FBBDIR/sat/amsat.txt ] then cd $FBBDIR/sat/ /usr/local/bin/satdoc amsat.txt > $FBBDIR/satdoc.res /usr/local/bin/satdoc -i amsat.txt >> $FBBDIR/satdoc.res /usr/local/bin/ajoursat amsat.txt /n /d60 > $FBBDIR/ajoursat.res /usr/local/bin/ajoursat amsat.txt /a /d60 >> $FBBDIR/ajoursat.res rm amsat.txt fi ------------fin de l'extrait----------- Donc, des qu'un bulletin ANS est recupere par la BBS, les nouvelles et les documentations sur les satellites seront automatiquement transcrits dans des fichiers au numero et au nom du satellite. Des lors un utilisateur du BBS peut recuperer cette information a la demande. Apres connexion, les commandes pour acceder au service satellite du serveur sont : F pour passer le BBS en mode serveur et T pour entrer dans le sous menu satellite. Ensuite les choix possibles sont : C pour lire les nouvelles et documentations individuelles des satellites P pour lire les elements kepleriens T pour obtenir une prevision de passage de satellite Dans ma BBS les programmes executables de service sont dans le repertoire /usr/local/bin/ Veuillez configurer vos fichiers AMSAT.FWD et de maintenance en fonction de votre propre configuration d'installation. La version la plus recentes du logiciel se trouve sur : http://f6bvp.free.fr/logiciels/satdoc/ Afin de faciliter la consultation des informations documentaires la BBS liste les noms des satellites avec une '*' en face des noms des satellites pour lesquels existe un fichier documentaire consultable. 73 de Bernard, f6bvp. f6bvp@amsat.org fbb-7.0.10/doc/satdoc-e.doc0000644000175000017500000000754713613360505012223 00000000000000Documentation for SATDOC program Linux version 2.8.6 - 2009 september 29 The most recent version of this program and ANS files can be downloaded from http://f6bvp.free.fr/logiciels/satdoc/ SATDOC is primarily designed as an utility for F6FBB's BBS application. However it can be used independantly. If satdoc executable file is not present, you need to compile the source file : Gcc -o satdoc satdoc.c Then you can check if the program works correctly after making a copy of ans.txt file provided into the same directory as satdoc and type ./satdoc ans.txt or type ./satdoc -i ans.txt ans.txt file comprises AMSAT NEWS SERVICE bulletins with usefull informations about active satellites distributed via Internet or packet radio. With the first command line syntax SATDOC will create nnnnn.sat files with the NASA number of each satellite as file name. If option -i is used, SATDOC will name the files after each satellite name. This option is more usefull for local consultation of documentation files. INTRODUCTON =========== Thanks to Mike N1JEZ for kindly accepting my proposition to make a modification into ANS bulletins starting with ANS-292 that you may have noticed. I asked Mike to introduce the catalogue number on a line after the satellites name. These objects catalog numbers allow automatic processing of satellite information by procedures or programs in order to update satellite documentation files present in F6FBB's BBS servers. SATDOC will check AMSAT.TXT files exported by F6FBB's BBS mail system for the presence of any AMSAT News Service and capture the relevant information of each satellite. Each object in orbit has a unique catalog number given by NASA. This allows to build a non equivocal reference file, given this number plus a .sat extention. HOW SYSOPs MAY INSTALL AND CONFIGURE THIS SATELLITE AUTO DOCUMENTATION SYSTEM ============================================================================= If you have already installed SATUPDAT program for satellit keplerian parameters update, you can skip this paragraph. You must create a dummy BBS named AMSAT in your BBS.SYS file. The FORWARD file for this AMSAT BBS could look like: A AMSAT * G KEPLER G AMSAT P @ c /usr/local/var/ax25/fbb/sat/amsat.txt B AMSAT F AMSAT F KEP F KEPS F KEPLER F SAT F SATTV F SATELL ----------- Thus AMSAT.TXT will collect all messages with interesting documentation on satellites (frequencies, mode changes, launch information etc...) SYSOPs should add a call to this program into maintenance script named 20_epursat before the call to SATUPDAT with argument AMSAT.TXT. The result of processed satellite documentation will be written into SATDOC.RES .... if [ -e $FBBDIR/sat/amsat.txt ] then cd $FBBDIR/sat/ /usr/local/sbin/satdoc amsat.txt > $FBBDIR/satdoc.res /usr/local/sbin/satdoc -i amsat.txt >> $FBBDIR/satdoc.res /usr/local/sbin/satupdat amsat.txt /n /d60 > $FBBDIR/satupdat.res /usr/local/sbin/satupdat amsat.txt /a /d60 >> $FBBDIR/satupdat.res rm amsat.txt fi ... Thus, each time an ANS bulletin is sent, satellite news and documentation will automatically go into the corresponding satellite documentation file. A BBS user can then get this information on request by connecting to the BBS. When connected, the set of commands for consulting satellite menus is : F for entering into server mode and T for entering satellite submenu. Then the available choice are : C for individual satellite documentation and news P for keplerian parameters T for tracking an object If a documentation file is present for a specific satellite, an "*" will be displayed near the satellite name. In my own system fbb executable files are in /usr/local/sbin/ directory. Please configure your maintenance file according to your own implementation. Same for your fbb sat directory in amsat.fwd forward file. 73 de Bernard, f6bvp. f6bvp@amsat.org fbb-7.0.10/doc/fbb.conf.min.sample.in0000644000175000017500000000045013613360505014066 00000000000000# # FBB Set-up file # version = FBB@package_version@ # Callsign of BBS callsign = F6FBB.FMLR.FRA.EU # SSID of BBS ssid = 1 # Qra Locator of BBS qraloc = JN03QL # Qth of BBS city = Toulouse # First name of SYSOP name = Jean-Paul # Callsign of SYSOP sysop = F6FBB # # End of fbb.conf file # fbb-7.0.10/doc/html/0000755000175000017500000000000013747536077011065 500000000000000fbb-7.0.10/doc/html/docconf.htm0000644000175000017500000000245513613360505013117 00000000000000 CONFERENCE commands

CONFERENCE COMMANDS.

Any text typed while in the conference is sent to all the parties involved.
A header before the text shows its origin. The header is not repeated if
the next text has the same origin.

In the conference, the commands should begin with a semi-colon in the first
column, so as to be interpreted as commands and not text.

Commands in the Conference mode:

.C[PORT] CALLSIGN : Connect to a callsign on a port. The port indication
is optional; the port of the connected user is otherwise chosen as a 
default.

.D CALLSIGN : Disconnects the callsign from the conference.

.H : Help 

.W : Shows a list of the participants in the conference.

.Q : Exit the conference.







This page was last updated 

fbb-7.0.10/doc/html/fmtmaint.htm0000644000175000017500000000244113613360505013316 00000000000000 FORMAT of MAINTx.SYS

MAINTx.SYS


MAINTx.SYS (\FBB\SYSTEM).

 This file is in the SYSTEM directory. This works exactly like INITTNCx.SYS,
but the parametres are sent to the TNC when the BBS is shut down. The file
can look like this:

 Y 1
 U 1 BBS ($c) was shut down for service $d $T.

 Y 1 means that only 1 station can connect my TNC now.
 U 1 means that the TNC will send this message to any user that connects
after the BBS has shut down.

If you use a PK-232, the same file would look like this:

 UR1
 CTBBS ($c) was shut down for service $d $T.

 The  commands  sent  to  the  TNC,  are  the  commands  described in the 
documentation for the firmware you use, or in the documentation for PK-232,
DRSI, BPQ , KAM etc.






This page was last updated 

fbb-7.0.10/doc/html/docfunck.htm0000644000175000017500000002307113613360505013275 00000000000000 Console-commands FBB BBS.

Console commands

(Function-keys and other).

There are a few differences in WinFBB from DosFBB.

For WinFBB:

 Most of these commands will open a window. The server operation is NOT
suspended while these windows stay open.

F1     -  Help.
F2     -  Connect to the BBS locally with the console-callsign.
F3     -  Disconnect a channel.
F4     -  Start or stop forwarding.  Shows how many/big messages are waiting
          for forward right now (real-time).  Click on the BBS(s) you want to
          start forward to, and click "Start Fwd". There are also buttons for
          "Start All" and "StopFwd", as well as import and export.
F5     -  Toggle monitoring on/off. 
F6     -  Change console-callsign.  That callsign is used when connecting to
          the BBS with F2 or via gateway F9.  The callsign have sysop-status.
F7     -  Program TNC directly. This allows a dynamic modification of the
          parameters which will be affected as default to the channels of 
          the related port. These parameters will not be taken into account
          for the channels already connected, and will be transferred to the
          channel upon disconnect. The commands are specific to the TNC in
          use: WA8DED with a TNC2, HostMode PK232 with a PK232, or the BPQ
          node.
F8     -  Not used
F9     -  Gateway, using console-callsign.
F10    -  Initiate a chat with a user (click on the user first).

ALT-F1 -  Not used
ALT-F2 -  Not used
ALT-F3 -  Start or stop forward-scan. Before starting scanning, FORWARD.SYS
          and its include-files, BBS.SYS and SWAPP.SYS are recompiled.
ALT-F4 -  Quit FBB.
ALT-F5 -  Start a text-editor.
ALT-F6 -  Not used
ALT-F7 -  Show last connections.
ALT-F8 -  Not used
ALT-F9 -  Not used
ALT-F10-  Not used

ALT-B  -  Not used
ALT-D  -  Not used
ALT-R  -  Not used
ALT-N  -  Not used
ALT-S  -  Not used
ALT-X  -  Not used

CTRL-F1 to CTRL-F10 hold pre-defined texts, that are sent when pressing
          that key.  The texts are in the file MEMO.SYS.  Works only in
          the editor.
          Exceptions:
          CTRL-F1 and CTRL-10 are captured by Windows.
          CTRL-F4 exits the editor.

In addition to the function-keys, there are quite a few push-buttons on
the screen in WinFBB, in standard Windows-fashion.  Click on them to get 
the wanted result.  This should be self-explanatory.  Much information may
be retrieved this way, and many things may be configured this way.

In addition to the main FBB-window, you may want to have open at the same
time the DISPLAY ALL CHANNELS and MONITOR windows (I do, hi).  They may
be re-sized to fit beside and under the main FBB-window.  The windows
position and size and saved if you stop the BBS.


For LinFBB:
No function-keys are available in LinFBB.


For DosFBB:

 Most of these commands will open a window. The server operation is
suspended while these windows stay open, but the user requests are queued and
will not be lost. If no reply is given, the window will close down after a
few seconds, and the default reply will not be taken into account. Do not
forget to validate your replies with "Enter".

F1     -  General help on all function-keys.
F2     -  Connect to the BBS locally with the console-callsign.
F3     -  Disconnect a channel.
F4     -  Start or stop forwarding.
          Manual forwarding request, or cancellation of current 
          forwarding. If a number up to 8 is specified, the corresponding 
          port will be scanned for forwarding. If the number 9 is specified,
          all ports will be scanned. If a callsign is specified, it will be
          scanned for forwarding. Preceding the callsign with + will force
          reverse even if there is no waiting mail, preceding the callsign
          with - will stop the forwarding and disconnect.
F5     -  Toggle monitoring on/off.  With monitor on, the lower part of
          the screen displays the monitored traffic, while the upper part of
          the screen shows traffic in the BBS.  Number of lines in upper/lower
          part of the screen, can be adjusted with the arrow-up or arrow-down
          keys.
F6     -  Change console-callsign.  That callsign is used when connecting to
          the BBS with F2 or via gateway F9.  The callsign have sysop-status.
F7     -  Program TNC directly. This allows a dynamic modification of the
          parameters which will be affected as default to the channels of 
          the related port. These parameters will not be taken into account
          for the channels already connected, and will be transferred to the
          channel upon disconnect. The commands are specific to the TNC in
          use: WA8DED with a TNC2, HostMode PK232 with a PK232, or the BPQ
          node.
F8     -  Reboot PC.  Can be done at once, or when all channels are free.
F9     -  Gateway, using console-callsign.
F10    -  Talk to a user (that have sent a T) or initiate a chat with a user.

ALT-F1 -  Shows pending forward(s).  Shows number of personal messages,
          bulletins, and the total amount of kB waiting to be forwarded.
ALT-F2 -  Shows all callsigns connected to the BBS.
ALT-F3 -  Start or stop forward-scan. Before starting scanning, FORWARD.SYS
          and its include-files, BBS.SYS and SWAPP.SYS are recompiled.
ALT-F4 -  Shows the last connected callsigns.
ALT-F5 -  Starts a very simple text-editor (use F1 for help there).
ALT-F6 -  Various "options" :  Sysop is in ?  Enables T-command.
                               Beep at connect ? 
                               Show callsigns etc. on every channel ?
                               Gateway allowed ?
                               Justification on text typed from console ?
                               Use screen editor ?
ALT-F7 -  Import messages from file.
ALT-F8 -  Export messages to file.  Messages that are waiting to be 
          forwarded to one BBS.  These messages can be forwarded to a file.
ALT-F9 -  Exit to DOS.  WARNING: the BBS operation is suspended all this
          time long. The users will not be disconnected, and their commands
          will be queued.  Return to BBS by typing EXIT.
ALT-F10-  Stop the mailbox-program.  Can be done at once, or when all 
          channels are clear.

ALT-B  -  Blank screen.
ALT-D  -  Save scroll-buffer to file.
ALT-N  -  Allows reprogramming a telephone modem
ALT-R  -  Redisplay screen.
ALT-S  -  Show last DOS-screen.  Press a key to return to BBS.
ALT-X  -  Stop the BBS (same as ALT-F10).

CTRL-F1 to CTRL-F10 holds pre-defined texts, that are sent when pressing
          that key.  The texts are in the file MEMO.SYS.

Arrow -> - Display next channel.
Arrow <- - Display previous channel.
Ctrl -> or Ctrl <- Return to the display of all channels.
PG-UP Display the previous page if it exists
PG-DW Display next page.
HOME Display the first page.
END Display the last page.






This page was last updated 

fbb-7.0.10/doc/html/fmtbeaco.htm0000644000175000017500000000254313613360505013262 00000000000000 FORMAT of BEACONx.SYS

BEACONx.SYS


BEACONx.SYS (\FBB\SYSTEM).

 This file is in the SYSTEM directory. This file makes the text that will be
broadcast as mail-beacon from the BBS. The first line is a parametre that 
says how often to send the beacon. %15 means "send one beacon every 15 
minutes". The next line says to what unproto-address the beacon will be sent.
! MAIL v LA7QR means send beacon to MAIL via LA7QR digipeater.
There may be several !-lines for different paths for each port.

The next lines are the actual beacon-text. Here we can use variables like $d
$T etc. We cannot use variables that are specific to one channel alone. You
do not need to change anything else then the !-line in this file. But you
will need one file named BEACON1.SYS for TNC1, one called BEACON2.SYS for
TNC2 etc.


 %15
 ! MAIL v LA7QR
 $d $T <<< Mailbox $O $c >>> $N active messages.
 Messages for$W$Q







This page was last updated 

fbb-7.0.10/doc/html/Makefile.in0000644000175000017500000003616413747457130013054 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = doc/html ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac 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; }; \ } am__installdirs = "$(DESTDIR)$(docdir)" DATA = $(doc_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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 = $(datadir)/doc/@PACKAGE@/html 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@ runstatedir = @runstatedir@ 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@ doc_DATA = docackno.htm docfwcom.htm doctraje.htm fmt_afro.htm\ fmtetat.htm fmtmess.htm fmtrunfb.htm fmtyappl.htm toolfv.htm\ docappen.htm docfwpro.htm doctrick.htm fmtappel.htm fmtfbbio.htm\ fmtmulti.htm fmtsatel.htm fpk232.htm toolinst.htm docbbs.htm\ docgate.htm docvaria.htm fmtbbs.htm fmtfbcm.htm fmtnewdo.htm\ fmtsat.htm ftfpcx.htm toolisda.htm docconf.htm docgloss.htm\ docwild.htm fmtbeaco.htm fmtfilfi.htm fmtoptio.htm fmtserv.htm\ ftlock.htm toollgst.htm docconts.htm doc.htm docwp.htm\ fmtconfi.htm fmtforwa.htm fmtpassw.htm fmtswapp.htm ftpe1chl.htm\ toolminf.htm doccopyr.htm doclined.htm fbpq.htm fmtcron.htm\ fmtheard.htm fmtpg.htm fmttelne.htm fttfwin.htm toolmkpg.htm\ doccstat.htm docmined.htm fdrsi.htm fmtdirme.htm fmtinf.htm\ fmtphnmo.htm fmttheme.htm tlfbb_zm.htm toolmrej.htm docdocut.htm\ docmisc.htm finittnc.htm fmtdriv.htm fmtinit.htm fmtport.htm\ fmttpsta.htm tllinux.htm toolsatu.htm docedit.htm docnomen.htm\ fkam.htm fmtdsz.htm fmtlang.htm fmtprote.htm fmttxt.htm\ tlxfbbc.htm toolsetu.htm docfbbd.htm docproc.htm fmnewdoc.htm\ fmtems.htm fmtlog.htm fmtredis.htm fmtunpro.htm toolclea.htm\ toolslee.htm docfeatu.htm docqthlo.htm fmstatis.htm fmtepurm.htm\ fmtmail.htm fmtrejec.htm fmtwfbid.htm toolclus.htm toolview.htm\ docfirst.htm docrecme.htm fmtack.htm fmterror.htm fmtmaint.htm\ fmtreqcf.htm fmtwpsys.htm toolcut.htm docform.htm docserv.htm\ fmt_afax.htm fmtess.htm fmtmemo.htm fmtreqdi.htm fmtxfbb.htm\ toolepum.htm docfunck.htm docsysop.htm fmt_afne.htm fmtesska.htm\ fmtmesfi.htm fmtreqfi.htm fmtyapex.htm toolepwp.htm EXTRA_DIST = $(doc_DATA) 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 doc/html/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/html/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): install-docDATA: $(doc_DATA) @$(NORMAL_INSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(docdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(docdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(docdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(docdir)" || exit $$?; \ done uninstall-docDATA: @$(NORMAL_UNINSTALL) @list='$(doc_DATA)'; test -n "$(docdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(docdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(docdir)"; 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-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-docDATA 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: uninstall-docDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-docDATA 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 tags-am uninstall uninstall-am \ uninstall-docDATA .PRECIOUS: Makefile # 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: fbb-7.0.10/doc/html/fmtmulti.htm0000644000175000017500000002115713613360505013345 00000000000000 MULTI-server

MULTI server.

MULTI.EXE, server for FBB-BBS.
(By LA6CU, Per)

This server is used to send personal copies of special messages.  The 
original is addressed to a special "call", and then there is automatically
made personal copies to everyone that shall have one.

MULTI may work in 2 ways.  You may use one of them, or both.  I use both at
the same time.

New in version 3.00:
The server may use different languages.  There is a new file MULTI.TXT (reside
in SYSTEM-directory) that holds all languages.  There is one "module" for
each language.  See the text in MULTI.TXT for more info.


1:  WITH DAT-FILES:
-------------------

Installation:

MULTI.EXE is put in the same directory as SERV.EXE.   MULTI will read from
INIT.SRV...

In INIT.SRV, MULTI is included together with REQFIL, REQDIR etc.  Example:
#
------
#
REQFIL  REQFIL
REQDIR  REQDIR
CLUB    MULTI
TEST    MULTI
#

In this example all messages sent to
SP CLUB
will be copied to all callsigns in the file CLUB.DAT, while messages sent to
SP TEST
will be copied to all callsigns in the file TEST.DAT.

CLUB.DAT and TEST.DAT (in this example) must stay in the FBB-directory.
You must make one such .DAT-file for every to-field you define in INIT.SRV.

The .DAT-files must consist of callsigns (@BBS and H-addresses allowed) for 
all those that shall have a copy.

There are 4 different copy-types.
A (action)      :  This is the callsign that will receive the message, or
                   perform the action described in the message.
C (copy)        :  This callsign receives a copy of the message.
I (information) :  This callsign receives a copy for information.
H (hidden)      :  This callsign receives a copy, but his callsign will not
                   appear in the footnotes of the message, telling who has
                   received a copy.
                   
There may be more than one callsign on each line (starting with A, I, C or H)
separated by a comma.  There may be maximum 100 callsigns altogether.  
Comment-lines are extras, they MUST start with a #

From version 3.00 there will also be a separate line with a letter 
corresponding to the language the server will use.  What letter corresponds
to what language, is explained in MULTI.TXT.

Example of CLUB.DAT:

E                           <-----  Use ENGLISH language for CLUB-server
A LA6CU, LA1B, LA2D         <-----  Copies to the people doing the job
A LA6GDA                    <-----    "     "   "   "    "     "     "
                                    May be several lines if there is not 
                                    enough room in one line. 
I LA5RBA                    <-----  LA5RBA is informed on the matter
C LA6IM @ LA6IM             <-----  LA6IM receives a copy for updating his
                                    node-lists
H LA2GIA                    <-----  LA2GIA receives a copy, but will not appear
                                    in the list of callsigns at the end of
                                    each message.

Beware:  The .DAT-files shall consist of callsigns and comments, nothing 
         else !  No /EX, no * and no *** end of file.

MULTI will NOT send a copy back to the originator, even if he also is in
the .DAT-file.  This to avoid "looping" of messages.
MULTI will send an acknowledge-message back to the originator, telling 
him that the copying was successful, and show him a list of all callsigns
that will receive such a copy.

R:lines on incoming messages are removed, until there has arrived 2 lines
without R:  After that. R:lines are accepted again.  This is done to make it
possible also to forward messages back the same route, and at the same time
make it possible to include R:lines in the message itself.

R:lines are NOT checked to prevent forward to BBSs that are already in
these R:lines, because a message to a MULTI-server only will be processed
at the end-BBS anyway.

MULTI needs very little memory (I have not checked how much..), but I have
been told that it needs less than 35k.  MULTI does not write to screen.

MULTI.EXE must be in the same directory as SERV.EXE.
From version 3.00 the .DAT-files must be in the SYSTEM-directory.
MULTI.TXT must also be in SYSTEM-directory.

MULTI makes a temporary file MULTI.TMP on disk, and delete it afterwards.
Everything else is done in memory, and the result is placed in MAIL.IN, as
all servers do.


2:  WITH ALL CALLSIGNS DIRECTLY IN THE ORIGINAL-MESSAGE.
--------------------------------------------------------

MULTI still works exactly as before, with the same installation.  But after
a request from F6ABJ and F6FBB I have made a modification so that users
themselves can decide what callsigns will receive a copy.  This is done
by including the callsigns in the message itself.

In INIT.SRV, MULTI is still included like before (see further up).  But
in addition, you now must have 1 extra line, like this:

#
------
#
REQFIL  REQFIL
REQDIR  REQDIR
CLUB    MULTI
TEST    MULTI
MULTI   MULTI               <----  This line is new.
#

From version 3.00 SP MULTI uses the default language (see MULTI.TXT).
Other languages may be configured.  For example you may have:
MULTI   MULTI   (for default language)
MULTIE  MULTI   (for english language)
MULTIF  MULTI   (for french language)
MULTIH  MULTI   (for netherlands language)
MULTIN  MULTI   (for norwegian language)
So, you may send the same message SP MULTI, SP MULTIE, SP MULTIF, SP MULTIH,
SP MULTIN etc.  The first 5 letters must always be MULTI, when used without
DAT-file.  Default language will typically be english (SP MULTI), but the
users will have the possibility to use others, as configured.

Users will now be able to send messages to MULTI, like this:
SP MULTI     The program will now collect the info on who will receive a 
copy, from the message itself, and not from a seperat .DAT-file like 
SP CLUB or SP TEST still will do.

There are 4 different copy-types.
A (action)      :  This is the callsign that will receive the message, or
                   perform the action described in the message.
C (copy)        :  This callsign receives a copy of the message.
I (information) :  This callsign receives a copy for information.
H (hidden)      :  This callsign receives a copy, but his callsign will not
                   appear in the footnotes of the message, telling who has
                   received a copy.
(In addition one may use CC: instead of only C for Copy.  Special request..)

There may be more than one callsign on each line (starting with A, I, C or H)
separated by a comma.  There may be maximum 100 callsigns altogether.  
Comment-lines are extras, they MUST start with a #

Example:
SP MULTI
Digipeater upgrade          <-----  Title of message
A LA6CU, LA1B, LA2D         <-----  Copies to the people doing the job
A LA6GDA                    <-----    "     "   "   "    "     "     "
I LA5RBA                    <-----  LA5RBA is informed on the matter
C LA6IM @ LA6IM             <-----  LA6IM receives a copy for updating his
                                    node-lists
H LA2GIA                    <-----  LA2GIA receives a copy, but will not appear
                                    in the list of callsigns at the end of
                                    each message.
---------                   <-----  After the last callsign, there must be a
                                    string of at least 5 '-' before the
                                    actual message.
                                    
Then follows the contents of the message, and end with Ctrl-Z or /EX.

As usual, the sender will receive a message saying that the copies were
made.  The messages to all the other callsigns will be identical, and look
like this:

Message via LA6CU MULTI-server (v3.00) :

Contents of message

============================================================================
For action       : LA6GDA, LA6CU, LA1B, LA2D.
For copy         : LA6IM.
For information  : LA5RBA.
============================================================================

All copies are identical, but A, C and I determines in which line in the
footnotes the callsigns will appear.  A callsign after an H will not 
appear in the footnotes.

73 de Per, LA6CU.






This page was last updated 

fbb-7.0.10/doc/html/docfirst.htm0000644000175000017500000004632013613360505013320 00000000000000 First installation and startup

First installation and startup.

 This part of the manual is intended for the sysop who has never used FBB
software before. I hope this part of the manual will help you to get "on the
air" with FBB without too many problems.

 FBB is designed in 3 versions.  One for Dos (referred to as DosFBB), one
for Windows (referred to as WinFBB) and one for Linux (referred to as LinFBB).
This manual covers all versions.  Most of the contents is identical for all
versions, but when there is a difference, it will be clearly stated.  In 
either case, I presume that you have installed your operating-system (DOS,
Windows or Linux) correct before you attempt to install FBB.

 Normally you will install FBB from diskettes. Normally your diskette-drive
will be called A, and normally you will install the FBB-program on hard-disk
called C. But this is no absolute need, you may use other drives as well.
More about this a little later.

 Your hard-disk is organised in several directories. If you are not familiar
with this, you should read in your operating-system's manual about how the 
hard-disk is organized.

 FBB will normally be installed on your hard-disk in a directory named FBB.
This directory should be placed directly under root  (C:\FBB). This directory
will be automatically created for you. The BBS will also need a lot of other
directories, and they can be created directly from root, or they can be 
created under the FBB-directory. In the procedure I will describe here, only 
the FBB-directory will be at the root (C:\FBB) of the hard-disk, while all the
other directories will be placed under FBB (like  C:\FBB\USERS etc). But you 
can choose this yourself. More about this a little later.

 However, this is the recommended  organization  for  your  directories.  The 
directories will be created like this if you make no changes (a list of the
files and directories is given in appendix 14).

 You should now be ready to start the installation procedure. Put the first
of the diskettes in your disk-drive.

For WinFBB:

 Have Windows up-and-running.  Install WinFBB from your diskette-drive the 
same way as you normally install programmes from diskette.  In Windows 3.x 
I think it should be normal to go to the file-manager, select RUN, and type
A:INSTALL.  In Win95 you may press START, then RUN, then type A:INSTALL.

 You will first be asked for the directory (and drive) that you want to 
have WinFBB installed to.  If you accept the defaults, just press ENTER.
If you want WinFBB installed in another directory or on another drive, 
just do the changes you want now, by typing your own drive/path.

 The screen will now display a text with some more information on the
installation.  Read it carefully before you proceed (by closing that
window).  

 The installation continues.  You will be advised that SYSTEM.INI will be
modified to replace the COMM-driver.  This is the driver for the TNCs and
telephone-modem.  You will also be told to increase the environment to 2kb.
AUTOEXEC.BAT will also be updated with the correct path to your 
FBB-directory.

 Next, the installation-procedure continues by starting the program
INSTWFBB.  (If this is not started during installation, you should start
it after the installation has completed, by clicking on the icon for
WinFBB Configuration).  This program lets you set most of the parametres you
need (all parametres for PORT.SYS and INIT.SRV) for your installation.  
Please take great care here, and go through ALL the pages of this installation
very carefully before you exit the program.  Use the NEXT - PREV buttons to go
through the entire installation.  Be sure to insert your correct callsign, 
your correct H-route etc.  INSTWFBB will update both INIT.SRV and PORT.SYS for
you, you will not need to change them manually later, if you take great care 
to do a good job now.

 When you are sure that your setup now is correct, you may exit the 
INSTWFBB.  The PC will then reboot, to finish the setup.  After this,
you will have a new program-group with icons for WinFBB and for
WinFBB Configuration.  You may run WinFBB Configuration at any time later,
to change your setup again.  The configuration may also be changed while 
the BBS is running, by clicking on the word Config on the top of the 
screen.

Next, the same procedure for DosFBB and LinFBB follows.  Skip them, and go
directly to the section called "FIRST-TIME SETUP OF DIFFERENT FILES."


For DosFBB:

 You should now be ready to start the installation procedure. Put the first
of the diskettes in your disk-drive, and type A: if that drive is named A, 
or B: if that drive is named B. Press ENTER to execute the command (you must
always press ENTER after a command to the PC). Your PC will now answer with
something like A:\> or B:\>

 If you now are ready to install FBB for the first time on your PC, you
type INSTA700.

 You will now see at your screen something like this:

 ---- QUOTE: ----

       ****   FIRST TIME INSTALLATION OF FBB 7.00 FROM DISK %disk%   ****

-  Main BBS-directory -  C:\FBB
-  System-files       -  C:\FBB\SYSTEM
-  Messages           -  C:\FBB\MAIL
-  Binary-messages    -  C:\FBB\BINMAIL
-  User's dir.        -  C:\FBB\USERS
-  Yapp files         -  C:\FBB\USERS\YAPP
-  Oldmail            -  C:\FBB\OLDMAIL
-  Statistics         -  C:\FBB\STATS
-  Documentation      -  C:\FBB\DOCS
-  FBB-manuals        -  C:\FBB\DOC
-  Fwd-include-files  -  C:\FBB\SYSTEM\FWD
-  Executable files   -  C:\FBB\BIN
-  Example-files      -  C:\FBB\EXAMPLES.700
-  Utillities         -  C:\FBB\UTIL
   (Fwd-include-files MUST stay under %system%.)

       If this configuration does not suit your needs, you must stop now
       with CTRL-C and edit the SET-lines in the file A:SUITE1.BAT.
       If a version of FBB 5.15c already exists, press Ctrl-C 
       and use 515c700.BAT for upgrading.

 ----- UNQUOTE. -----

 This screen may vary a bit from version to version, but the work you have to
do, will still be the same. First of all, you will see that the PC says that
you will install from disk A. Is this correct ? If you are installing from
disk-drive B, you must stop the installation now. The same applies if you
want to use other directory-names or paths for some of the other directories
that are listed on your screen now.

 If you DO want to change any of these things, you MUST do it now. The
changes are described in this paragraph; if you do NOT want any changes, you
can go on to the next paragraph. You stop the installation-batch by pressing
CTRL-C. Now you will see the standard A:\> prompt again. Now you must use a
normal text-editor and edit the file SUITE1.BAT on your diskette. I presume
you have such an editor... Make sure that it is able to save the file again
in ASCII (DOS) format ! So if you use for example Word Perfect, you MUST
remember to save the file again in DOS-format !

 At the beginning of that file, you will see a line saying SET disk=A: If you
want to install from B-drive, you edit this line like this:

 SET disk=B:

 You change only the letter after '=', nothing else ! You can also change all
directory-names or directory-paths in this same way. If you do not want to
use C:\FBB\SYSTEM, but want it to be C:\FICHIERS, you just change the line
saying

 SET system=C:\FBB\SYSTEM
 to
 SET system=C:\FICHIERS

 and so on. You must ONLY change the name behind the '=' sign, you must NOT
change anything before that in that line. You can do this with any (or all)
the directory-names and paths. But remember that you will need to do some
extra work with other config-files later if you do not use the default
installation.

 When you have finished doing the changes you want in the lines starting with
SET, you must save the file again to disk. When that is done, you start over
again from the beginning, by typing INSTA700 etc.

 OK. That is about all. Now the BBS-program and all its files will be
installed on your hard-disk. You only have to change diskettes each time you
are asked to (if you install from more than one diskette). 

 Next, the installation-procedure continues by starting the program
FBBSETUP.  This program lets you set all the parametres in INIT.SRV and 
PORT.SYS that you need for your installation. 
(FBBSETUP supports multiple language files, but for the first time 
installation you will probably have only the English language files.)  
Please take great care here, and go through ALL the pages of this
installation very carefully before you exit the program.  Be sure to put in 
your correct callsign, your correct H-route etc.  FBBSETUP will update 
INIT.SRV and PORT.SYS for you, you will not need to change it manually later,
if you take great care to do a good job now.

 The path FBB\BIN must be included in your PATH in AUTOEXEC.BAT. Do this by
adding to the PATH line in AUTOEXEC.BAT ";C:\FBB\BIN" like :

PATH C:\;C:\FBB\BIN

Next, the same procedure for LinFBB follows.  Skip it, and go directly to 
the section called "FIRST-TIME SETUP OF DIFFERENT FILES."


For LinFBB:

There are two versions:
  a windowing version (using X11 windowing system and MOTIF toolkit).
  a daemon version. The daemon version has no interface and works alone in
  background (like works an anti-virus, hi...). So the compter may be used
  for any application while the BBS is running.

Tnx to SM6TKY:

If you need some help in setting up AF_AX25 and AF_NETROM for use with
LinFBB, you may want to read the Appendix 23.

You should now be ready to start the installation procedure.
To install and run LinFBB you MUST have root access,
you may log in as root or you can go to superuser mode with: su root

(1)
Put the floppy disk into the diskdrive.

(2)
If you have MTOOLS installed.
 To copy from floppy disk A:, type: mcopy a:/x700.tgz /tmp
 To copy from floppy disk B:, type: mcopy b:/x700.tgz /tmp

If you have NOT MTOOLS installed.
 To mount floppy drive A: type: mount -t msdos /dev/fd0 /mnt
 To mount floppy drive B: type: mount -t msdos /dev/fd1 /mnt

 Then type: cp /mnt/x700.tgz /tmp , to copy the contents of disk to /tmp,
 then type: umount /mnt , to unmount the floppy disk.

(3)
Now you should create the base directory where you want LinFBB.
 Example, if you want LinFBB in: /usr/local/fbb
 Then type: mkdir /usr/local/fbb

(4)
If you now are ready to install LinFBB for the first time on your PC,

 Type: cd /usr/local/fbb , to go to the LinFBB root directory.
 Type: tar xvzf /tmp/x700.tgz , to unpack the LinFBB archive.

OK. That is about all.
Now the BBS-program and all its files will be installed on your hard-disk. 

Next, the installation-procedure continues by starting the installation
script named INSTALL.SH

This script lets you set most of the parametres in INIT.SRV (BUT NOT ALL !)
that you need for your installation.  Please take great care here, and go 
through ALL the questions of this installation very carefully before you 
exit the script. Be sure to put in your correct callsign, your correct 
H-route etc. The script INSTALL.SH will update INIT.SRV for you, but you 
will also need to check the rest of it manually, too, afterwards !


FIRST-TIME SETUP OF DIFFERENT FILES.

 So far so good... Now we must modify some files, to make the system work. I
will describe all the changes you MUST do, and some changes that you CAN do,
if you like. Read this section very carefully. For most of the files it is
VERY important that the number of non-comment lines must NOT be changed.
Later in the sysop-manual you will find more details on some of these files,
and also details on other files that are not described here in this startup-
section.

Files you MUST check/change:
RUNFBB.BAT (ONLY for WinFBB)
XFBB.SH    (ONLY for LinFBB)
APPEL.BAT  (ONLY for DosFBB)
PORT.SYS   (MUST be changed for LinFBB, no changes needed for WinFBB or DosFBB)
INITTNCx.SYS
MAINTx.SYS

Files you must change if you plan to do any forward:
BBS.SYS
FORWARD.SYS

Files you should check, too, but not SO important:
BEACONx.SYS
EPURMESS.INI
SWAPP.SYS

Files that are automatically configured by INSTWFBB and FBBSETUP, and should
normally not be needed to change manually after (DosFBB and WinFBB).
INIT.SRV
PORT.SYS 

Files you may have a look at later (not so important).
CRON.SYS
REJECT.SYS
PROTECT.SYS
LANGUE.SYS
THEMES.SYS
REDIST.SYS
MEMO.SYS



Start the BBS for the first time.

 Now you should be ready to start the BBS for the first time. Before you do,
make sure that the internal clock of the BBS is correct. If not, you must
correct it now with the DOS-command DATE and TIME. In most newer PCs today,
the clock is automatically set at each power-up. But in some older PCs you
may need to use a special clock/calendar card in your PC, and use a special
program to set the date/time at each startup. For this you must look in the
manual for that clock/calendar card and include the appropriate command in
your AUTOEXEC.BAT file.

For WinFBB:
 Go to the FBB program-group an double-click the WinFBB icon.

For DosFBB:
 Go to the FBB directory and type APPEL and press ENTER.

For LinFBB:
 To start LinFBB in X-Windows:
  Go to base directory and run "./xfbb.sh" in a xterm.
 To start LinFBB deamon:
  Go to base directory and run "./xfbb.sh -d &".

 The first time you start the BBS like this, it may ask you if you want to
create some files. Just answer Y (for Yes) every time. Then those files are
automatically created for you.

 The BBS should now be ready for use. Try a connect to the BBS. Do this by
pressing F2. The BBS will ask you for your name, city, home-BBS and 
ZIP-code.

Only for LinFBB:
Deamon version of LinFBB:
 Go to 'bin' directory, then use the utility 'xfbbC' to connect (eg: xfbbC -c).
 If you have set up PORT.SYS to allow incoming Telnet connections
 to LinFBB, then you can also use this..
 For example, if you defined LinFBB to listen on port 6300 (hex = 189C) 
 for incoming Telnet connections, then you type: telnet sm6tky.ampr.org 6300
X-Windows version of LinFBB:
 Select the "Window" in menu, and then select "Console"
 to enter Console connection.


 Next you must define all the BBSs you want to forward to. You do this with
the command EU. If you want to have forward to for example LA2D, you 
type EU LA2D.

 The BBS will say that this callsign is not known, and ask if you want to
create it. You answer Y. Next you will see a line of different options for
that user. You only have to type B. Now that callsign (LA2D) will be defined
as a BBS. You must press ENTER once more to stop editing the user. Repeat
this procedure with the callsign of all the BBSs that you will forward to.
You terminate the keyboard-session with the command B (Bye).

 Well, if all is ok, and you have not encountered any big problems so far,
you can stop the BBS.  
In DosFBB you do this with Alt-F10 or Alt-x.
In WinFBB you do this by pressing Alt-F4).
In LinFBB you do this:
  Deamon version:
   Do 'ps ax' , check for 'xfbbd' look after
   the process number and do 'kill <process number>'
  X-Windows version:
   Select "File" in menu, and then select "Exit"
   to shutdown the BBS.

You can connect the TNCs, and in INIT.SRV you must change from No to Ok in
the line that asks 'Mode test ?', or 
in WinFBB  : Click on the WinFBB Configuration icon
in LinFBB  : Use INSTALL.SH
in DosFBB  : Use FBBSETUP 
to change the field "TEST MODE" to "NO".


The TNC.

 This software will work with different kinds of TNCs or TNC-interfaces:

 - TNC-2 or close clones. The EPROM of type 27256 must be replaced by a
special EPROM with the WA8DED host-mode software, or by the german TF4, 
TF8, TF18 or similar.

 - PK-232 in host-mode.

 - Kantronics KAM in host-mode. You need a special driver called ESSKAM.

 - DRSI-card.

 - G8BPQ-node (uses TNCs in KISS-mode).

 The software for the TNC-2 host-mode EPROMs TF4 and TF8, may be included on
the distribution-disks. If you cannot burn new EPROMs yourself, there are a 
lot of hams around who can. You can also send a new EPROM to F6FBB or FC1GHV
(with return-postage and packing material, of course) and they will do the
work for you.

 The TNC should work on 4.9 MHz. The standard is 2.5 MHz, but a modification
for this is normally quite simple. In some cases it might be necessary to
replace the Z80 and the Z80 SIO by A-versions.

 If you use standard TNC-2 with one of the mentioned host-EPROMs, you can
start again now, and all should work fine. Make sure that the TNCs have the
same baud-rate as you wrote in PORT.SYS, and that they really are connected
to the COM-ports that you said in PORT.SYS.

 If you do NOT use a standard TNC-2 with DED-type host, but PK-232, BPQ,
Kantronics KAM or DRSI-card, you must read about your special TNC-
setup in one (or more) of the chapters PK-232, BPQ, KAM, DRSI or TFPCX/TFPCR
before you can start the BBS again.

 If the TNCs don't work ok with the software, you will see this when you
start the BBS. You will have a lot of error-messages on the screen, and the
TNCs may start to resync. Stop the program and go through all the setup once
more.

For WinFBB:
You may need to check the port-speed in Windows, make sure it is the same
for the port, as you have set the TNC and PORT.SYS to.






This page was last updated 

fbb-7.0.10/doc/html/tllinux.htm0000644000175000017500000003137513613360505013206 00000000000000 Linux help (Appendix 23)

Installation-help for Linux.

The contents of this file is:

Why use FBB with Linux ?
Info on AF_AX25, AF_NETROM and AF_ROSE.
Install AF_AX25, AF_NETROM and AF_ROSE.
Config AF_AX25, AF_NETROM and AF_ROSE for KISS TNC and SCC card.
Telnet installation (Appendix 24).


Why use FBB with Linux ?

LINUX is a true multitasking system where many applications may run 
concurently. When Linux (and other UNIX systems) has finished booting
it is possible to run one ore more applications running concurently (NODE,
BBS, CLUSTER, TCPIP, etc...) on the same CPU and above all very fast and 
secure.

Another good thing for linux is that the AX25 is included in the kernel, 
and then you need no TNC, no BPQ or other. You only need hardware. (think
of a DOS including Netrom, Rose, AX25, TCPIP and other software....)


Info on AF_AX25, AF_NETROM ans AF_ROSE.

Standard kernel AF_AX25, AF_NETROM and AF_ROSE sockets
AX.25, NET/ROM and ROSE protocol are built into the Linux kernel.

I recommend to use these interfaces, because it will give you
more flexibility to build a system with many futures..

This choice may be little difficult to set up,
because the functions is depended of lots of things.. eg:
 - Linux kernel version
 - ax25-utils version
 - z8530drv version
 - net-tools version
 ... and more

If you desire to use this/these interfaces,
i strongly recommend to read at least AX25-HOWTO!

The AX25-HOWTO located at:
http://sunsite.unc.edu/mdw/HOWTO/AX25-HOWTO.html

More HOWTO´s located at:
http://sunsite.unc.edu/mdw/HOWTO/HOWTO-INDEX-3.html

The Linux Documentation Project Homepage is located at
http://sunsite.unc.edu/mdw/linux.html


Install AF_AX25, AF_NETROM and AF_ROSE.

How to set up Linux kernel AF_AX25, AF_NETROM, AF_ROSE socket.

These examples are for Linux kernel 2.0.27 patched with ax25-module-7.

First, get these files (or newer files).
 Linux kernel 2.0.27
  available @ ftp://ftp.funet.fi/pub/Linux/PEOPLE/Linus/

 ax25-utils-2.0.12c.tar.gz
 ax25-module-7.tar.gz
 ax25-utils-module-7.tar.gz
  available @ http://www.cs.nott.ac.uk/~jsn/

Unpack kernel 2.0.27 in ´/usr/src´ with ´tar zxvf linux-2.0.27.tar.gz´
this will unpack kernel 2.0.27 to a directory called ´linux´ ,
beware if you already have a directory named ´linux´ in ´/usr/src´.

Tip:
I rename my kernel source directory to kernel version with ´mv linux linux-2.0.27´
then i do a symbolic link to this directory with ´ln -s linux-2.0.27 linux´

Before i install a new kernel, i remove the symbolic link (eg: rm linux),
this allows me to have more kernel sources installed at same time.. :-

Okay, now it´s time to compile the ´ax25-utils-2.0.12c.tar.gz´ ,
unpack this file in ´/usr/src´ with ´tar zxvf ax25-utils-2.0.12c.tar.gz´.

I can´t compile ´ax25-utils-2.0.12c.tar.gz´ after patching the kernel
with ´ax25-module-7.tar.gz´... :-/

Read the ´INSTALL´ file how to compile, and install this package.

Now it´s time to patch the kernel with ´ax25-module-7.tar.gz´,
unpack this file in ´/usr/src´ with ´tar zxvf ax25-module-7.tar.gz´,
then type ´cat ax25-module-7/ax25-2.0.27-2.1.19.diff | patch -p0´

Okay, do ´cd linux´ now, read the file README now, to know how to set up the kernel!

Okay, now it´s time to run ´make config´ , be sure that you enable
- Amateur Radio AX.25 Level 2 (CONFIG_AX25)
- Amateur Radio NET/ROM (CONFIG_NETROM)

If you want to use ROSE, enable this..
- Amateur Radio X.25 PLP (Rose) (CONFIG_ROSE) 

You can make these as loadable modules, or to be compiled into the kernel.

After you finished with ´make config´ , then type ´make dep; make clean; make zImage´
to compile the new kernel with AX.25 and NET/ROM support (and ROSE if defined).

After compilation, install the new kernel, as in the /usr/src/linux/README file.

Okay, you should have rebooted and started up the new kernel now..

Now it´s time to compile ´ax25-utils-module-7.tar.gz´ ,
unpack this file in ´/usr/src´ with ´tar zxvf ax25-utils-module-7.tar.gz´,
do ´cd ax25-utils.module-7´ and read the INSTALL file how to compile and install!

If all steps has gone without problem, you are now ready to set up your Linux system
to work with kernel AX.25, NET/ROM (and ROSE if defined), CONGRATULATIONS!

Now you should go to ´/usr/src/ax25-utils-2.0.12c´ and read the README file,
to find out what files you should need to change for suite you.

All configuration files are in ´/etc/ax25´.


Tip:
 Read the AX25-HOWTO @ http://sunsite.unc.edu/mdw/HOWTO/AX25-HOWTO.html


Config AF_AX25, AF_NETROM and AF_ROSE for KISS TNC and SCC card.

How to setup LinFBB to use kernel AF_AX25, AF_NETROM and AF_ROSE sockets.

Here is a example with LinFBB and one KISS TNC at COM1, 8 channels.

# /etc/ax25/axports
#
# The format of this file is:
#
#name	callsign	speed	paclen	window	description
#
ax0	SM6TKY-3	9600	256	7	Tx: 437.975 Rx: 434.000 MHz 9600bps


----


# /usr/local/fbb/system/port.sys
#
# Comments is deleted to save space
#
#Ports TNCs
 1     1
#
#
#Com Interface Adress (device) Baud
 1   9         ****            9600
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
 1   8    1   ax0    250   7     2     10     30/01   XUWYL  ax0
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
#1    2   SK6BA-0       B
#
# End of file.
#

----

# /etc/rc.d/rc.ax25
#
# This file is called from /etc/rc.d/rc.local
#
# attach a TNC2 with KISS
#
# (/dev/cua0 = COM1, /dev/cua1 = COM2, /dev/cua2 = COM3, /dev/cua3 = COM4)
#
/usr/sbin/kissattach -i 44.140.208.129 /dev/cua0 ax0
#
# set up default IP routings
# This is not needed if you don´t want to run TCP/IP on Radio
#
/sbin/ifconfig ax0 44.140.208.129 netmask 255.255.255.0 broadcast 44.140.208.255 arp mtu 256
/sbin/route add -host sk6ba.ampr.org ax0
/sbin/route add -net 44.140.208.0 gw sk6ba.ampr.org netmask 255.255.255.0 ax0
/sbin/route add default gw sk6ba.ampr.org ax0
#
# Send ID every 10 min
#
/usr/sbin/beacon -t 10 ax0 "This Packet Radio Node is Powered with Linux Unix" &
#
# If you want to run LinFBB in X-Windows,
# comment out this below...
#
# Start up LinFBB deamon
#
/home/xfbb/xfbb.sh -d &
#

-------------------------------------

Here is one example with one KISS TNC2 on COM2, NET/ROM interface, 16 channels.


# /etc/ax25/axports
#
# The format of this file is:
#
#name	callsign	speed	paclen	window	description
#
ax0	SM6TKY-3	9600	256	7	Tx: 437.975 Rx: 434.000 MHz 9600bps

----

# /etc/ax25/nrports
#
nr0 SM6TKY-13 #IP 236 Radio 9600bps
nr1 SM6TKY-0 XFBB 236 NET/ROM<->XFBB

----

# /etc/ax25/nrbroadcast
ax0	1	192	10	1

----

# /usr/local/fbb/port.sys
#
# Comments is deleted to save space
#
#Ports TNCs
 1     2
#
#
#Com Interface Adress (device) Baud
 1   9         ****            9600
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
 1   8    1   ax0    250   7     2     10     30/01   XUWYL  ax0
 2   8    1   nr1    236   7     2     10     30/01   XUY    netrom
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
#1    2   SK6BA-0       B
#
# End of file.
#

----

# /etc/rc.d/rc.ax25
#
# This file is called from /etc/rc.d/rc.local
#
# attach a TNC2 with KISS
#
# (/dev/cua0 = COM1, /dev/cua1 = COM2, /dev/cua2 = COM3, /dev/cua3 = COM4)
#
/usr/sbin/kissattach -i 44.140.208.129 /dev/cua1 ax0
#
# attach NET/ROM interface
/usr/sbin/nrattach -i 44.140.208.129 nr0
#
# This is for LinFBB NET/ROM
/usr/sbin/nrattach -i 44.140.208.129 nr1
#
# set up default IP routings
# This is not needed if you don´t want to run TCP/IP on Radio
#
/sbin/ifconfig ax0 44.140.208.129 netmask 255.255.255.0 broadcast 44.140.208.255 arp mtu 256
/sbin/route add -host sk6ba.ampr.org ax0
/sbin/route add -net 44.140.208.0 gw sk6ba.ampr.org netmask 255.255.255.0 ax0
/sbin/route add default gw sk6ba.ampr.org ax0
#
# Start up NET/ROM deamon
/usr/sbin/netromd
/usr/sbin/nrparms -parms -qual 192
#
# Send ID every 10 min
/usr/sbin/beacon -t 10 ax0 "This Packet Radio Node is Powered with Linux Unix" &
#
# If you want to run LinFBB in X-Windows,
# comment out this below...
#
# Start up LinFBB deamon
/home/xfbb/xfbb.sh -d &
#

-------------------------------------

Here is a example with 2 ports SCC (PA0HZP compatibelt) card installed, 16 channels,
and SCC driver is a loadable module.

# /etc/z8530drv.conf
#
# Lines must not be longer than 255 bytes!
#
#
# Hardware section
#
# SCC chip 1
#
chip	1
data_a  0x153			# data port A
ctrl_a  0x152			# control port A
data_b  0x151			# data port B
ctrl_b  0x150			# control port B
irq     5			# IRQ No. 5 (#)
pclock  4915200			# clock (+)
# board	PA0HZP
# escc yes
# escc    no			# enhanced SCC chip? (8580/85180/85280) (*)
# vector  0			# latch for interrupt vector ($)
# special no			# address of special function register (*)
# option  0			# option to set via sfr (*)
#
# (*) option, default value is 0
# (+) option, default is 4915200
#
# SCC chip 2
#
# chip	2
# data_a  0x157
# ctrl_a  0x156
# data_b  0x155
# ctrl_b  0x154
# irq     5			# IRQ No. 5 (#)
# pclock  4915200			# clock (+)
# board	PA0HZP
# escc	no
# vector	0
# special	no
# option	0
#
# (#) all chips can share one interrupt, or you may use multiple INTs,
#     but there must be at least one IRQ defined in this system.
# ($) only one Vector Latch for all Chips is allowed.
#
#
# Software section
#
# The order of entries IS important!
#
# 	first     : DEVICE
# 	then      : MODEM section
# 	after that: Level 1 parameters
#
# Definition of /dev/scc0
#
device	/dev/scc0
speed	9600
clock	divider
mode	nrzi
# rxbuffers 8
# txbuffers 16
# bufsize 1152
#
txdelay 30
persist 250
slot	8
tail	8
fulldup	0
wait    12
min	3
maxkey	7
idle	3
maxdef  120
group   0
txoff   off
softdcd off			# use software dcd
#
# Definition of /dev/scc1
#
device	/dev/scc1
speed	1200
clock	divider
mode	nrzi
# rxbuffers 8
# txbuffers 16
# bufsize 1152
#
txdelay 30
persist 250
slot	8
tail	8
fulldup	0
wait    12
min	3
maxkey	7
idle	3
maxdef  120
group   0
txoff   off
softdcd off

----

# /etc/ax25/axports
#
# The format of this file is:
#
#name	callsign	speed	paclen	window	description
#
scc0	SM6TKY-3	9600	256	7	Tx: 437.975 Rx: 434.000 MHz 9600bps
scc1	SM6TKY-1	1200	256	7	MARKnet Lan 144.800 MHz 1200bps

----

# /usr/local/fbb/port.sys
#
# Comments is deleted to save space
#
#Ports TNCs
 1     2
#
#
#Com Interface Adress (device) Baud
 1   9         ****            9600
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh  Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode   Freq
 1   8    1   scc0    250   7     2     10     30/01   XUWYL  scc0
 2   8    1   scc1    250   7     2     10     30/01   XUWYL  scc1
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
#1    2   SK6BA-0       B
#
# End of file.
#

-----

# /etc/rc.d/rc.ax25
#
# This file is called from /etc/rc.d/rc.local
#
# Load the SCC module and init
/sbin/insmod scc
/sbin/sccinit
#
# attach the SCC card
#
/sbin/ifconfig scc0 44.140.208.129 hw ax25 sm6tky-3 up
/sbin/ifconfig scc1 44.140.208.129 hw ax25 sm6tky-1 up
#
# set up default IP routings
# This is not needed if you don´t want to run TCP/IP on Radio
#
/sbin/ifconfig scc0 44.140.208.129 netmask 255.255.0.0 broadcast 44.140.255.255 arp mtu 256
/sbin/ifconfig scc1 44.140.208.129 netmask 255.255.255.0 broadcast 44.140.208.255 arp mtu 256
/sbin/route add -host sk6ba.ampr.org scc1
/sbin/route add -net 44.140.208.0 gw sk6ba.ampr.org netmask 255.255.255.0 scc1
/sbin/route add default gw sk6ba.ampr.org scc1
#
#
# Send ID every 10 min
/usr/sbin/beacon -t 10 scc0 "This Packet Radio Node is Powered with Linux Unix" &
/usr/sbin/beacon -t 10 scc1 "This Packet Radio Node is Powered with Linux Unix" &
#
# If you want to run LinFBB in X-Windows,
# comment out this below...
#
# Start up LinFBB deamon
/home/xfbb/xfbb.sh -d &
#








This page was last updated 

fbb-7.0.10/doc/html/docserv.htm0000644000175000017500000000205713613360505013147 00000000000000 SERVER-mode.

SERVER-MODE.

The server commands are gathered in groups.

C : Connections - Statistics.
D : Documentation.
Q : QTH locator.
N : Ham Callsigns Directory ("Call-Book").
T : Satellite orbits computation.

F : Switches back to BBS mode.
B : Quit and disconnects






This page was last updated 

fbb-7.0.10/doc/html/doctraje.htm0000644000175000017500000000354113613360505013274 00000000000000 Satellite orbital elements server

Satellite orbits server.

Satellite orbital parameters computation, and satellite characteristics.

P : Display of orbital parameters. Selected satellite orbital parameters 
    display. These parameters will be used for the computation.
C : Amateur Satellites characteristics.
F : Switches back to Server main menu.
T : Satellite orbital computation.
M : Manual editing of orbital elements.

 To select a satellite, type the number (a list of the satellites can be
obtained with the command L instead of the number). Once the satellite has
been selected, you will have to supply the date and the time to be taken into
account for the computation. If you only answer with a return character, the
current date (or time) will be taken. The geographical position is the QTH
Locator of the connected user, if it is known in the file. Otherwise, the QTH
Locator of the server will be used as a default. Depending on the satellites,
the computation step can be variable, and one line of parameters will be
displayed per step. This line corresponds to a minimal elevation of -5 degree
s, that means the satellite 5 degrees below the horizon.


F : Switches back to the Server main menu.
B : Quit and Disconnect.






This page was last updated 

fbb-7.0.10/doc/html/docform.htm0000644000175000017500000001173013613360505013131 00000000000000 Format of FBB-files, menu

Format of FBB system-files.

 The miscellaneous files used for the configuration and the operation of this
BBS software have a very accurate syntax. The good behaviour of your software
depends upon how these files have been configured.

 The first file to be configured is INIT.SRV. This file contains the
information on the BBS and about your hardware.

 The system holds more than 10 text files which can be configured. Do not
forget to save the previous content of the file before modification. This
will ease the restore which might often be necessary. Never delete a
file, you might loose major data. Never modify a binary file. Some files have
a preset number of lines, and adding or deleting lines might generate an
error message. This is the case of the configuration files and text files.

 In most of the configuration files and within the text files, the character
# in the FIRST COLUMN means that the line is a comment, and will not be taken
into account for the number of lines.

 Files may stay in different directories, FBB, BIN, SYSTEM, etc... The
default directory is indicated after the file name inside parentheses.

Standard system-files (for sysop to change):


RUNFBB.BAT	Startup-file.  	Only for WinFBB	
XFBB.SH         Startup-file.	Only for LinFBB    
APPEL.BAT 	Startup-file.  	Only for DosFBB		
DSZ.BAT 	Start binary transfer	
INIT.SRV	BBS initializing file	
EPURMESS.INI	Configure housekeeping	
PORT.SYS 	Configure ports
SWAPP.SYS	Swap to/from/etc in messages
INITTNCx.SYS	Startup-parametres for TNC and/or modem
MAINTx.SYS	Closedown-parametres for TNC and/or modem
BEACONx.SYS	Configure beacon 
BBS.SYS 	Define all BBSs that receive bulletins
FORWARD.SYS 	The main forward-file
CRON.SYS 	Run certain tasks/programs every hour
REJECT.SYS	List of callsigns to be rejected/held
PASSWD.SYS	Password-file for remote sysops
PROTECT.SYS	Define "safe" directories
LANGUE.SYS 	Define languages
THEMES.SYS	Define various theme-zones.
ERROR.SYS	File for logging errors
ETAT.SYS	Shows when the BBS was put in service
HEARD.BIN    	Stations heard on radio-ports
REDIST.SYS 	Define bulletin redistribution
english.TXT	Texts used by the BBS. One for each language
english.HLP	User-help. One for each language
english.ENT	Logon-text. One for each language, and for modem/telnet.
english.NEW	Logon-text. One for each language. Shows ONCE
english.INF	Texts used by the BBS. One for each language
FBBLOG.nn	Logfile for the BBS.  One for each week
MEMO.SYS	Define "hot keys" (DosFBB and WinFBB different)
nnnnn.SAT 	Characteristics of satellites
NEWDOC.SYS	Authorize callsigns for NEWDOC-server

Other file-formats (please do not change unless you 
   are 100% sure that you know what you are doing):
   (Incorrectly modifying these files will most likely cause your
    BBS to work incorrectly, or maybe even crash)

STATIS.DAT	Statistical data of BBS-usage
OPTIONS.SYS	Options for console-usage
DIRMES.SYS	Records for every single message
TPSTAT.SYS	
WFBID.SYS 	Records of BIDs
INF.SYS 	Records of users
YAPPLBL.DAT	Information on binary files
SATEL.DAT	Information on satellites
WP.SYS 		White Pages database
MESS.WP		File from WP tp update BBS








This page was last updated 

fbb-7.0.10/doc/html/toolview.htm0000644000175000017500000000147613613360505013356 00000000000000 Tool: FBB_VIEW

FBB_VIEW

(Only LinFBB)

FBB_VIEW is a small program used by the BBS when a user sends the

"View (filename)" command.

View contents of ARC, DWC, LBR, LZH, PAK, ZIP, ZOO files.

VIEW command of LINUX version calls fbb_view program (or any program
defined by the variable $FBB_VIEW). fbb_view may be a shell script.







This page was last updated 

fbb-7.0.10/doc/html/fmtepurm.htm0000644000175000017500000000624413613360505013343 00000000000000 FORMAT of EPURMESS.INI

EPURMESS.INI


EPURMESS.INI (\FBB).

 This file is also in the main FBB-directory. This is the file that controls
the lifetime of messages. Each night EPURMESS will be activated at the time
specified in INIT.SRV. Normally you will not need to change this, but if you
did any changes during installation, you must also change the same pathnames 
here. That goes for all lines that include a pathname.

 Next, you decide if you want to save "killed" messages in the OLDMAIL-
directory. If you do, write a 1 first, if you want to save old personal
messages, and another 1 if you want to save old bulletins.

 # Personal Bulletins (0=kill 1=archive in oldmail)
 0 0
 #

 Next we have the actual parametres (in days) for the lifetimes of bulletins
and personal messages. Let me just explain the letters in use here:
 P=Personal message
 B=Bulletin
 N=Not read
 Y=Had been read
 F=Forwarded (forwarded to all BBSs that should receive this msg)
 X=Expired (still readable, but will not be forwarded to other BBSs)
 K=Killed (readable only by sysop)
 A=Archived (same as killed, but will be deleted at once, or moved to
   OLDMAIL)

 I think this is self-explanatory:

 # Parametres in days:
 #
 # PARAMETRES FOR PERSONAL MESSAGES:
 #
 # PN -> PX (days after message is written)
 30
 #
 # PY -> PX (days after changed to Y)
 7
 #
 # PF -> PK (days after changed to F)
 7
 #
 # PX -> PK (days after changed to X)
 0
 #
 # PK -> PA (days after changed to K)
 0
 #
 # PARAMETRES FOR BULLETINS
 #
 # BN -> BX (days after the message is written)
 7
 #
 # B$ -> BX (days after the message is written)
 7
 #
 # BY -> BX (days after changed to Y)
 7
 #
 # BX -> BK (days after changed to X)
 14
 #
 # BF -> BX (days after message is written)
 14
 #
 # BK -> BA (days after changed to K)
 0
 #
#
# Automatic generated return-messages for non-forwarded messages.
# Each line may be max 255 characters long.  Disable with only an 0.
#
# Timeout for valid forward-path (number of days + text, end with $W)
21 This message could not be forwarded, due to bad link.$W
#
# Unknown routing or wrong H-address (number of days + text, end with $W)
2 This message could not be forwarded, due to bad callsign or bad route.$W
#
# Max number of lines in a returned message:
10
#
------
#
# At the end of the file, you can have special lifetimes for special messages.
# In the example below, messages that are TO LA6CU will be 365 days old,
# messages FROM system will be 0 days, messages @LA will be 365 days. I have an
# # in front of them, this means they are disabled right now.
# List of lifetime-tests
#
# To/from/via Callsign Days
@  VEST   365
@  LA     365
>  LA6CU  365
< system 0
#
# End of this file.
#






This page was last updated 

fbb-7.0.10/doc/html/fmtforwa.htm0000644000175000017500000005470413613360505013335 00000000000000 FORMAT of FORWARD.SYS

FORWARD.SYS


FORWARD.SYS (\FBB\SYSTEM).

I have divided this section in two parts:
1   :  Simple instruction (for first-time setup).

2   :  Advanced setup, with more details.
2.1 :  Line types.
2.2 :  Definition of a forward-file.
2.3 :  Include-files.
2.4 :  Automatic forward to a file.
2.5 :  End-of-file DOS-command specific to a port.

Simple instruction (for first-time setup).

 This file is in SYSTEM directory. In this file all necessary data for
forwarding of messages are held. First I will give an example of a file that
contains the minimum of data that MUST be in FORWARD.SYS if you have forward
to only 1 other BBS, called LA2D in this example.

 The file is organised in blocks, one block for each BBS we forward directly
to. A block starts with A (callsign) and ends with -------- We can have as
many blocks as we want in FORWARD.SYS.

 A LA2D
   #
   P C
   #
   C C LA2D
   #
   B LA2D
   F LA2D
   #
 ---------

 All lines starting with a '#' are comments-lines, and are ignored by the
BBS. The first line must always start with the letter A, and next the
callsign of the BBS we want to forward to. Here: A LA2D

 Then there must be a line telling on which port to start the forward.
This line must be there even if we only have 1 port.

 In this example I use port C, which is the same as TNC 3 in my PORT.SYS.
Command: P C

 So I will send the connect-command to the TNC. That line must start with a C
before the actual connect-command. So if I call LA2D directly, I need to
write C C LA2D. (Only one C will not work). And lastly I must write which
messages I shall forward to that BBS. In this case I type only B LA2D, which
means all messages with @ LA2D, and F LA2D, which means all messages TO LA2D.
The forward-file must end with a string of -------. If you have more than one
BBS to forward to, you write all data for that BBS in a similar block in this
same FORWARD-SYS-file (starting with A, and ending with ----) right after
this block for LA2D.

 You can also use one include-file for every BBS, but we will look at that
later in this sysop-documentation.

 Well. I expect you do not want to forward only those messages that are TO
LA2D or @ LA2D (in this example), I expect you want to forward bulletins
also. Just include some lines starting with G, like G EU, G ALL, G WW etc in
the file. G EU means all bulletins addressed to @ EU. So may want to add this
in each file, like this:

 A LA2D
   #
   P C
   #
   C C LA2D
   #
   B LA2D
   F LA2D
   #
   G EU
   G ALL
   G WW
 ---------

 OK. Next you may want to forward messages through LA2D, that is not really
for LA2D, but that LA2D can forward on to this other BBS. These other BBSs
can be included in lines starting with a B, like B LA1G, B LA4O, B LA5G etc.
like this:

 A LA2D
   #
   P C
   #
   C C LA2D
   #
   B LA2D
   F LA2D
   #
   B LA1G
   B LA4O
   B LA5G
   #
   G EU
   G ALL
   G WW
 ---------


 Also, if you want to forward ALL messages for other SM-BBSs this way, you
can use wildcards (as in DOS) like B SM*, B SK*, B OH* etc. like this:

 A LA2D
   #
   P C
   #
   C C LA2D
   #
   B LA2D
   F LA2D
   #
   B LA1G
   B LA4O
   B LA5G
   #
   B SM*
   B SK*
   B OH*
   #
   G EU
   G ALL
   G WW
 ---------


 Well. Now the file is almost complete for most needs. We may want to add the
possibility to forward (on VHF or UHF) via several nodes. This is very easy,
as we just add another C C (callsign) line for each node we have to call. If
I must call first my local node LA7QR, next the local node of LA2D (LA1EAX-
7), and lastly LA2D, the complete file for LA2D will now look like this:

 A LA2D
   #
   P C
   #
   C C LA7QR
   C C LA1EAX-7
   C C LA2D
   #
   B LA2D
   F LA2D
   #
   B LA1G
   B LA4O
   B LA5G
   #
   B SM*
   B SK*
   B OH*
   #
   G EU
   G ALL
   G WW
   #
   R
   #
 ---------

 I put in an R at the end. This forces my BBS to call LA2D BBS and ask him
for forward from him to me (reverse forward), even if I have nothing to
forward to him.

 Well, this was a simple forward-file. There is a lot more we can do with
this file, so you should read Advanced setup very carefully, I think you
will find all you need there.  But you now have learnt the basics..


Advanced setup (with more details).

 The FORWARD.SYS file defines the setup of the various adjacent BBS's to
which we will route the mail. The file is organized in blocks, each block
being specific to a BBS. Only the adjacent BBS's should be defined.

 This file and its includes are compiled at the BBS start-up and after
editing with the built-in editor, or return from the DOS Shell (AltF9 in
DosFBB) if one of the files has been modified.

 If the FORWARD.SYS file or one of its includes has been modified all the
active messages are scanned, and new routings will be set according to the
updated file(s). The scanning can be stopped with AltF3. (Can be convenient
if the modification does not impact the routing.)

 Every line of the file begins with a letter which defines the function of
the line. Any line beginning with a # is regarded as a comment and is
ignored.

Line types :

A (callsign)
 All blocks must start with a line like this. The callsign is the callsign of
the BBS we will forward to.

B (callsign)
 All blocks must include at least one line like this. Personal messages
addressed to somebody with address '@ (callsign)' will be forwarded.

C C (callsign1) [V DIGI1 DIGI2 ETC...]
 The complete line of connection (C callsign V digi1 digi2) must follow the
letter C. In most cases, there will be two letters C successively, with a
space between them. The letter V, specifying a string of repeaters is
optional if PROMs TF4 (or equivalent) are used - see WA8DED.DOC. There may be
several lines C, in the case of cascaded connections (use of THENET, as per
an example). A line of conditional connection (enclosed between an IF and an
ENDIF) allows calls on preset times. Up to 8 lines are allowed, each line can
hold up to 80 characters.

 In case of KA-node and X-connect, we can send C X (callsign). When connected
to a node, all command after the first C is actually sent to that node. Like
here, the X is sent too.

Only for LinFBB and WinFBB:
To forward with Telnet the syntax is:
C C <callsign> <IP address> [port]
IP-address is required, port is optional (default 23).

D (command)
 Command to be performed by the DOS (transceiver frequency set, for example).
For WinFBB:
A separate DOS-window is opened, and the command performed there.  The window
is closed when the command has been executed.  In WinFBB the D (command) and
X (command) is identical.

For DosFBB and LinFBB:
The screen is saved before the command, and restored when done, thus enabling
screen access for this command. When running BAT files, a COMMAND.COM is
automatically first sent. That needs some more memory.

DC (command)
 Same as D-command above, but executed when the connection is done.
This allows to change parameters or program a function when
the other BBS is connected. When the connection is made from another
BBS, the LC, DC and XC are executed if the BBS exists in forward file.

ELSE
 Complementary conditional lines to the previous IF.

ENDIF
 End of conditional lines defined by an IF.

F (callsign)
 Callsign which will be automatically routed (except if a routing has been
specified) to the BBS which has been previously stated by a B line (must
follow a B line). There may be several F lines following a B line. If this
line is not preceded with a B line, then the bulletins will be routed on
their destination.

 G (route)
 Group routing  indicator  for  bulletins  (EU  for  example).  This 
indicator  applies  only  to  bulletins.  The  private  messages  are sent
according to the BBS indicator (see line B). There may be several routing
indication lines per adjacent BBS.

H (route)
 Route definition using the hierarchical addressing mode. The wildcards (* or
?) must be used to replace the missing part of the address as a function of
the destination.  H-routing should be used as much as possible.

IF C1 ... IF C9
 Conditional test of the route selection. The value for "n" is a figure, from
1 to 9, depending upon the selection. The first selection is 1, and the
maximum is 9. The lines located between the IF Cn and the ENDIF will be taken
into account only if the current selection is n. If the connection has not
been successful (remote BBS prompt not received), the selection number will
be incremented, and the block will be tested again if the port is still the
same. If the port is different, the block will be tested during the tests
related to the new port. If the connection is successful, the selection
number is reset at 1 for the next call, otherwise the selection number is
incremented. If all the selections failed, the selection number is reset at
1, the call is given up, and the system manages the next block.

IF D xx
 Conditional test of the days of the week. This line defines a set of lines
which will be taken into account if the expression which defines the day(s)
following the IF is true. 0 corresponds to Sunday and six to Saturday. The
expression 'IF D 0,2,4-6' is true for Sunday, Tuesday, and Thursday to
Saturday. There can be several embedded IF's (indentation recommended), they
shall never expand outside a block. The ENDIF defines the end of the
conditional block.

IF H xx
 Conditional test of the hour (IF). This line defines a set of lines which
will be taken into account only if the hour period following the IF is TRUE.
The hour period written in the format 0,4,12-23 is true at 0h, 4h, and for
the hours from 12h to 23h. There may be several IF conditions embedded
(indentation should be used), but never outside of the blocks.

IF FREE
 Conditional test for the availability of a port. The test will be true if
none of the channels for the port is in use. This test can be a necessity
before the autoqsy of a transceiver as for an example. There can be several
embedded IF's (indentation is recommended), they shall never expand outside a
block. The ENDIF, defines the end of the conditional block.

IF MAN
 Conditional test only true if forward has been asked manually by F4, FR or
FW commands.

IF N (number)
 Tests on number-of-day in the month (1-31)

J        (data means 7+ here)
  J 0 : no data sent
  J 1 : data is sent (default)
  J 2 : personal data is sent
  J 3 : only data is sent (exclusive)

K Channel
 Forces forwarding to start on the specified channel. If the channel is busy,
forwarding will not start.

L (command) [value]
 Parametres programming for the TNC. The parameters will be assigned to the
related channel. The syntax is the one of the TNC hostmode. Only the command
B (Paclen = packet size) has been supplied in all cases. B parameter must be
used with all TNCs (including KAM) to specify a paclen. The paclen is always
managed by the BBS software, as the different host modes are transparent to
the paclen. The PACLEN of the KAM should be 0/0 (256) to make the BBS paclen
work in all circumstances.

LC (command) [value]
 Same as L-command above, but are executed when the connection is done.
This allows to change parameters or program a function when
the other BBS is connected. When the connection is made from another
BBS, the LC, DC and XC are executed if the BBS exists in forward file.

N (number)
 Assigns the standard forward protocol (MBL/RLI) for the specified BBS.
  1 = FBB forwarding allowed
  2 = FBB+BIN forwarding
  4 = FBB+BIN+Resume
  8 = XFWD
  Ex: N 15 = Sum of all protocols (default)

O (minutes)
 Defines a timeout for the specified BBS. Timeout is expressed in minutes.

P (port)
 Selects the port on which the connection is to take place. The port is
defined by a letter from A to H for the ports 1 to 8.

Q
 Prevents the reverse forwarding from my BBS to take place.

R
 Specifies that a call should be made to the adjacent BBS even if there is no
mail in queue, so as to trigger the reverse forwarding.

S Connect Failure Busy
 It is a set of supplementary test in the case of sequential connections
(TheNet network for example). The 3 tests should be defined. The tests
"Connect" "Failure" and "Busy" are already defined in the software.  Ex.:
S Conne Echec Occup. The software will interpret "Conne" like Connect,
"Echec" like Failure, and "Occup" like Busy. This allows to comply with nodes
messages which are not those commonly used by TheNet.
 Up to 4 S lines (set of tests) can be defined in a forwarding block.
S line (choices of forward) now checks default as a last choice. Up to four
previous choices are checked as declared before. Warning, these tests are
case dependent.

T options
 Definition of the maximum size for a file authorized to be forwarded, type
of messages and strategy. This line can be made conditional (between an IF
and an ENDIF).

 T P : Send only personal messages
 T S : Send smaller first (instead of older first)
 T 2 : Send only messages less than, or equal to, 2 KB.
 T D : Disable the feature of sending only 1 message from each 
       callsign in each forward-block

 It is possible to combine one or more of these option like :

 T P S 2 : means only private less or equal to 2 KB, smallest first.

 In all cases, personal messages are forwarded first, bulletins next.

U ROUTE1 ROUTE2 ... (up to eight routes)
 Give the priority when forwarding bulletins. Bulletins @ROUTE1 will be
forwarded first, then bulletins @ROUTE2, then other bulletins. It may be up
to eight specified routings. Private mail (including P, T and A messages) are
always forwarded first.

V (text)
 Text sent on connection of the called BBS. (Mandatory on some TCPIP BBS to
declare the protocol in use). Allows sending callsign and password when
connecting to a phone BBS.

W
 Command W allows to skip one or more prompts (default one) before starting
a forward session (mainly used when "Linked to ..." gives more than 
one prompt)

X (command)
 Command to be executed by DOS (Selection of a frequency, as for an example).

For WinFBB:
A separate DOS-window is opened, and the command performed there.  The window
is closed when the command has been executed.  In WinFBB the D (command) and
X (command) is identical.

For DosFBB and LinFBB:
The screen is not saved before the command, thus, the latter should not
access the screen. This command is identical to the D command, but it is
transparent and faster. When running BAT files, a COMMAND.COM is automatically
first sent. That needs some more memory.

XC (command)
 Same as X-command above, but executed when the connection is done.
This allows to change parameters or program a function when
the other BBS is connected. When the connection is made from another
BBS, the LC, DC and XC are executed if the BBS exists in forward file.

Y
 Automatic time update of PMS having the clock ability. (if SID looks like
[PMS-3.0-C$]). PMS is set with the local time.

Z route
 NTS routing indicator for NTS messages. This routing indicator applies only
to messages of "T" type. Wildcards can be used to define masks. There may be
several routing indication lines per adjacent BBS.

------ (string of dashes)
 Defines the end of the block for the adjacent BBS. The block begins with an
A line.

! Line
 Defines an exception. Will be used with lines of types B, F, G, H. The
exception should always be set before the true condition statement. An
exception is always from the same type statement (you cannot have a !F
exception to a B line).
 Ex:
 ! B F6FBB Except for F6FBB BBS
 B F* Forward to all the BBS which begin with an F
 The number of the exceptions is not limited.

< File
 Include the file specified. The name of the file should be in the directory
SYSTEM or in one of its subdirectories.

#
 Comment line.


Definition of the forward file :

 A forward file is made of a main file including a set of blocks, each block
corresponds to an adjacent BBS, that is to say that can be connected.

 Definition of the minimum block :

 A block will be an included file in the FORWARD.SYS file. It is always made
with a first line beginning with an A, defining the name of the adjacent BBS,
and of a last line made of a string of dashes. Inside this block, there will
be at least one P line (port used) a C line (connection request), and a B
line (destination BBS). An F line with the SYSOP callsign may follow the B,
enabling the automatic routing for his mail.

 A FC1CDC
   P A                      Port A
   C C FC1CDC-1 F6FBB-5     connection line
   B FC1CDC BBS             desserved by FC1CDC
   F FC1CDC                 callsign automatically forwarded to FC1CDC
 --------

 This type of block is well suited for PMS of BBS which do not support
automatic mail forwarding.


Example of a more complex block :

 A FC1HAQ
   #
   G EU                     FC1HAQ will receive
   G FRA                    the bulletins for those
   G WW                     various routings.
   G AMSAT
   F AMSAT                  bulletins to AMSAT are also marked.
   #
   H *.NA                   All the H. routes which end
   H *.SA                   with .NA, .SA
   H *.EU                   and .EU
   #
   O 5                      5 minutes timeout.
   #
   IF C1                    1st choice parameters
     P C
     L B 250                Paclen is 250 bytes
     L N 4                  Retry 4
     C C FC1HAQ-1 F6FBB-7 019301
   ENDIF
   IF C2                    2nd choice parameters
     P C
     IF 8-17                from 8h to 17h
       T 5                  files of 5 kb Max.
     ENDIF
     L B 250                Paclen is 250 bytes
     L N 4                  Maxframe is 4
     C C FC1HAQ-1 F6FBB-7 019002
   ENDIF
   IF C3                    3rd choice parameters
     P A                    port A is used
     T P                    private mail only
     C C F6FBB-2            Connection of the 1st Thenet.
     C C FF6KUB-2           Connection of the 2nd Thenet.
     C C FC1HAQ-1           Final connection.
   ENDIF
   #
   B FC1HAQ                 Definition of the various
   F FC1HAQ                 BBS routed by FC1HAQ and
   F F6CQU                  of its SYSOPs and /or direct
   #                        specified users.
   B F6ABJ
   F F6ABJ                  Other BBS and miscellaneous
   #                        callsigns forwarded by FC1HAQ.
   B F5LO
   F F5LO
   #
   B G*                     other BBSs.
   B ON*
   B D*
   B HB*
   #
 ------                     End of the FC1HAQ block


Include-files.

 It is possible to use include-files with FBB. In this way we can have a
very small FORWARD.SYS, with only the callsign of the BBSs to forward to, and
then we have another directory with all the forward-blocks. One file for each
BBS, for example. Just transfer one whole block (starting with A (callsign)
and ending with ------) to file, and put the filename in FORWARD.SYS with a
'<' in front of it, like  this:

 Example of FORWARD.SYS file with include-files.

 #
 # FORWARD FILE F6FBB
 # ------------------------
 #
 # UHF
 #
 < FWD\FE6BIG
 < FWD\FC1GJC
 < FWD\FF6KNI
 < FWD\FC1HAQ
 < FWD\F1EBV
 < FWD\FD1JGK
 < FWD\EA3BKZ
 #
 # PMS
 #
 < FWD\FD1CDC
 < FWD\FD1MEU
 < FWD\FD1OAC
 < FWD\F8PD
 < FWD\F6HED
 < FWD\FE1JYH
 < FWD\F1LMI
 #
 # HF
 #
 < FWD\LA1B
 < FWD\LA6CU
 < FWD\SV1IW
 < FWD\4X1RU
 < FWD\RS3A
 < FWD\I7XGL
 < FWD\EA8AML
 < FWD\EA8RT
 #
 # VHF
 #
 < FWD\F6CDD
 #
 # FILES
 #
 < FWD\AMSAT
 < FWD\MAIL
 #
 # Back to the park frequency.
 #
 P B
 IF 0-3,21-23
   X ICOM A2E8 M14
 ELSE
   X ICOM A2E8 M4
 ENDIF

 
 Example of an include file FWD\EA8RT
 ------------------------------------

 A EA8RT
   #
   G EU
   G ALL
   G AMSAT
   G WW
   G EA
   G EANET
   G LATNET
   #
   P B
   #
   O 2
   #
   L T 20
   L B 80
   L O 2
   L P 100
   L F 2
   L @T2 20
   #
   #
   IF 7-22
     X ICOM A2E8 M6
     C C EA8RT-2
   ENDIF
   #
   B EA8RT
   F EA8RT
   F E?1*
   F E?4*
   F E?7*
   F E?8*
   #
   B E?1*
   #
   B E?4*
   #
   B E?7*
   #
   B E?8*
   #
 ----



Automatic forward to a file.

 It is interesting to allow automatic routing of messages or bulletins to a
file, for further processing, archive, or communication between BBSs which
co-exist in the same computer. The communication can be made through files.
The incoming mail file (see INIT.SRV) is tested once every minute; in case of
existence, the mail it contains is imported into the BBS.

 On the other hand, a file can be defined in a forward block and updated once
every 15 minutes. This file is defined in a block of forward identical to the
forward between BBSs, the port being @ and the connection line given the name
of the file created or updated. The name of the BBS (possibly dummy) used
will be declared in BBS.SYS, of course.

 Example of a forward to a file (forward to the file B:MAIL.FBB of my own
private mail) :

 A MAIL
   P @
   C B:\MAIL.FBB
   B F6FBB
   F F6FBB
 ------


End-of-file DOS command specific to a port.

 Each DOS command (D or X line) defined out of a forward block will be run
only if the forwarding port matches with the last port selection.

 Example :

 You use the autoqsy capabilities of your HF transceiver with a special
program named "ICOM". To be sure to return to your standby frequency, you
must set your frequency at the end of the forward file, only if the forward
applies to the HF port. You only have to select the port before running the
DOS command.

   B xxxxxx
   #
 -------                   End of last forward block
 #
 P D                       Select HF port (port D)
 X ICOM A3E8 M12           Send the DOS command ICOM with its
 #                         arguments if the file is scanned for
 #                         D port. IF and ENDIF are allowed.






This page was last updated 

fbb-7.0.10/doc/html/docfwpro.htm0000644000175000017500000001521313613360505013323 00000000000000 Forward protocol (Appendix 9)

FBB forward protocol.

(Appendix 9)

 FBB software includes two forward protocols. The first one is standard with
MBL/RLI  protocol.  The  second  one  was  developed  to  allow 
efficiency, particularly on long links where propagation time of data are
long. The exchange of commands is reduced to a minimum, and not acknowledged
to get time. The data transfer direction is changed every block of data, a
block of data holding up to five messages. This uses the "pipeline" effect of
long links (Nodes and digipeaters), and gain some time over short links
(HF...).

 FBB protocol is very simple in its principle. It is based on MID/BID usage.
The identification is made by the F letter in the SID (system type identifier
contained in square brackets). All command lines must start in first column
with the 'F' character. All command lines are ended by a return (CR)
character.

 Suppose I call another BBS to forward some mail. When I connect another BBS
using FBB protocol, I will receive the SID followed by a text and the prompt
(">"). If the SID contains the F flag, I will send immediately my SID and the
first proposal.

 Proposals looks like :

 FB P F6FBB FC1GHV FC1MVP 24657_F6FBB 1345
 F> HH

 FB : Identifies the type of the command (proposal)
 P : Type of message (P = Private, B = Bulletin).
 F6FBB : Sender (from field).
 FC1GHV : BBS of recipient (@field).
 FC1MVP : Recipient (to field).
 24657_F6FBB : BID ou MID.
 1345 : Size of message in bytes.
 F> : End of proposal.
 HH is optional. It is the checksum of the whole proposal in hexadecimal.

 ALL the fields are necessary. This kind of command must hold seven fields.
If a field is missing upon receiving, an error message will be send
immediately followed by a disconnection.

 A proposal can handle up to five FB command lines. If the total size of
messages seems to be too important, the proposal can handle less lines. In
FBB software, a parameter is defined in INIT.SRV file to tell the maximum
size of the message block. It is set by default to 10KB.

 Example of proposal :

 FB P F6FBB FC1GHV.FFPC.FRA.EU FC1MVP 24657_F6FBB 1345
 FB P FC1CDC F6ABJ F6AXV 24643_F6FBB 5346
 FB B F6FBB FRA FBB 22_456_F6FBB 8548
 F> HH

 This proposal is limited to three FB lines, as the amount of messages
overran the 10KB limit.

 When receiving the proposal, the other BBS will reject, accept or defer the
message. This command is made by a FS line :

 FS -+=

 This means :

 - I don't want the first message (-).
 - I need the second message (+).
 - I defer the third message, as I'm still receiving it.

 In the new version 1 of FBB protocol there are 3 more responses:
 R, E or H:

 "FS +R++" means that the second message is rejected. Only works with new 
 version of the protocol.
 The information is also written in the LOG like :
 MJ B:Message_Bid V:Callsign_Rejecting
 A warning message may be sent to the sending sysop when his message is 
 rejected (see INIT.SRV for more info on warning messages).
 The message is not marked as 'F', and still can be forwarded to another BBS

 "FS +H++" means that the second message is held. Only works with new 
 version of the protocol.
 The information is also written in the LOG like :
 MH B:Message_Bid V:Callsign_Rejecting
 A warning message may be sent to the sending sysop when his message is 
 held (see INIT.SRV for more info on warning messages).

 "FS +E++" means that the second message has a format error. Only works 
 with new version of the protocol. 
 A warning message may be sent to the sending sysop when his message  
 proposal is wrong (see INIT.SRV for more info on warning messages).

 It should interesting to defer a message if you are still receiving it on a
other channel, or if you think that the size is to big, or for another
reason. The message should be proposed again at the next connection.

 FS line MUST have as many +,-,=, R, E, H signs as lines in the proposal.

 When receiving the FS lines, I can send the block of messages. Each message
is made with the title on the first line, the text, and a Ctrl Z in the last
line. The is no blank line between the messages.

 Title of 2nd message
 Text of 2nd message
 .....
 ^Z

 When the other BBS has received all the asked messages, it acknowledges by
sending its proposal, and the system is reversed.

 If it has no message to send, it only sends a line :

 FF

 This line must not to be followed by a F>.

 If the other hand has no message, it sends a line :

 FQ

 and asks for the disconnection.


 Example :
 ---------

 F6FBB                          FC1GHV
 ----------------------------------------------------------------

 Connects FC1GHV

                                Connected

                                [FBB-5.11-FHM$]
                                Bienvenue a Poitiers, Jean-Paul.
                                >

 [FBB-5.11-FHM$]     (F6FBB has the F flag in the SID)
 FB P F6FBB FC1GHV.FFPC.FRA.EU FC1MVP 24657_F6FBB 1345
 FB P FC1CDC F6ABJ F6AXV 24643_F6FBB 5346
 FB B F6FBB FRA FBB 22_456_F6FBB 8548
 F> HH

                                FS +-+ (accepts the 1st and the 3rd).

 Title 1st message
 Text 1st message
 ......
 ^Z
 Title 3rd message
 Text 3rd message
 ......
 ^Z

                                 FB P FC1GHV F6FBB F6FBB 2734_FC1GHV 234
                                 FB B FC1GHV F6FBB FC1CDC 2745_FC1GHV 3524
                                 F> HH

 FS -- (Don't need them, and send immediately the proposal).
 FB P FC1CDC F6ABJ F6AXV 24754_F6FBB 345
 F> HH

                                 FS + (Accepts the message)

 Title message
 Text message
 ......
 ^Z

                                 FF (no more message)

 FB B F6FBB TEST FRA 24654_F6FBB 145
 F> HH

                                 FS + (Accepts the message)

 Title message
 Text message
 ......
 ^Z

                                 FF (still no message)

 FQ (No more message)

 Disconnection of the link.


 In this example, FBB protocol is used as the two BBS were identified by the
F flag in the SID. If F6FBB had sent the SID [FBB-5.11-MH$] when answering
FC1GHV, the protocol should be the standard MBL/RLI.

 All callsigns are only examples !







This page was last updated 

fbb-7.0.10/doc/html/fmtredis.htm0000644000175000017500000000235313613360505013316 00000000000000 FORMAT of REDIST.SYS

REDIST.SYS

REDIST.SYS (\FBB\SYSTEM).

REDIST is a built-in server for resending personal messages as bulletins.
May be used for sending a bulletin in another area than the users own area.


#
# Configuration of the REDIST server
#
# Route for the local BBS (SP LOCBBS)
LOCBBS=LA1B
# Name of the BBS coverage
LOCBBS_DESC=LA1B BBS
#
#Route(s) for local bulletins (SP LOCAL)
LOCAL=LA6CU,LA1B
# Coverage of the local BBS
LOCAL_DESC=Bergen, LA1B and LA6CU BBSs
#
# Route(s) for regional bulletins (SP REGION)
REGION=VEST
# Name of the region
REGION_DESC=Hordaland, Rogaland (Western Norway)
#
# Route(s) for national bulletins (SP NATION)
NATION=NOR
# Name of the country
NATION_DESC=Norway
#
# Default destination
DEFAULT_TO=ALLE
#
# Send a mail to the sysop
MAIL_SYSOP=YES
#







This page was last updated 

fbb-7.0.10/doc/html/docsysop.htm0000644000175000017500000002552613613360505013353 00000000000000 Sysop commands

SYSOP COMMANDS.

Commands available under the BBS menu.

DU callsign : Displays the information related to the given callsign.

DB : Lists the BBS callsigns.

DE : Lists the EXCLUDED callsigns.

DF : Lists all PMS-users.

DL : Lists the callsigns with LOCAL status.

DM : Lists the callsigns with modem acces.

DP : Lists callsigns which are using the page scroll.

DS : Lists the SYSOPS callsigns.

DX : Lists the EXPERT callsigns.

E msg# :
 Edits the message # header. The message header is first displayed, then a
string of options will allow you to edit the various fields of this header. A
"return" terminates the edit.

EM msg# : 
 Edits the body of a message.  During edit the message is not being 
forwarded.

EU callsign :
 Edits the main parameters of a user. The user's parameters are first
displayed, then a string of options will allow you to edit the various
parameters. A "return" terminates the edit. Most of fields can be cleared
with a point. A user can be edited while connected and then action is
immediate. Flags are :

  R : All mail (included personal) can be read
  P : Paging validated
  B : BBS
  S : Sysop
  X : Expert
  L : Local (Allowed to all commands on guest access).
  E : Excluded (cannot connect to the BBS)
  M : Modem access
  U : Unproto (Allows unproto list requests).
  I : Give list of new messages on logon.
  F : PMS forwarding (allows forward but texts are like normal user).


 Other commands must be followed with information :

  G number   : selected language
  N name     : name of the user
  W password : password of the user
  V directory: private directory of the user (12 characters max)
  H home-bbs : home-bbs of the user
  Z zip-code : zip-code of the user

FA msg# BBS :
 Specifies that the message defined by its number will be forwarded to the
specified adjacent BBS.

FB BBS : Gives the list of messages waiting for forward to this BBS.

FC Route :
 Gives the list of BBSs that will receive the messages with the specified
route. If the route is a possible callsign, the BBS will look for BBS 
routing, if composed with digits will look for NTS routing, otherwise
will look for bulletins (group) routing.

FD msg# BBS :
 Removes the message # from the forward to the specified adjacent BBS.

FG : Shows the partly received messages (may be resumed in next forward).

FH BBS : Gives the hierarchical extension for BBS.

FI BID command:
 BID maintenance.
 Command = ? : Gives message number and the message type of the BID/MID.
           + : Adds the BID/MID to the list.
           - : Deletes the BID/MID from the list.

FL [BBS] : Lists the messages in the forward-queue [for BBS if specified].

FN Msg# :
 List of the BBSs which are in the waiting list for this message number, and
the BBSs already forwarded or named in the preamble.

FP command callsign:
 Swap test.
 Command = @ : Gives the swap (if existing) for the via callsign.
           > : Gives the swap (if existing) for the to callsign.
           < : Gives the swap (if existing) for the from callsign.

FR Argument :
 Forces reverse forwarding to BBS (or port), even if there is no pending
mail. If the argument is a callsign of known BBS, reverse forwarding to
this BBS will start. The argument can be a portnumber, in this case the
reverse forwarding will start on that port, if 9 is specified then the
reverse forwarding will start for all the ports.

FS Argument :
 Stops the forwarding. If the argument is a callsign of known BBS, the
forwarding to this BBS will be stopped. The argument can be a portnumber,
in this case the forwarding will be stopped on that port, if 9 is
specified then the forwarding will be stopped for all the ports.

FT [BBS] :
 Lists the volume of the messages which are waiting for forward to all
BBSs, or to only one BBS if the callsign of that BBS is specified. 
The command shows the volumes in real-time.

FU Channel :
 Immediately disconnects the specified channel.

FV :
 Recompiles FORWARD.SYS and its include files, SWAPP.SYS and BBS.SYS and then
starts scanning the messages to update the forwarding list. This may be
necessary after a FORWARD file change.

FW Argument :
 Starts forwarding to BBS (or port). If the argument is a callsign of 
known BBS, forwarding to this BBS will start. The argument can be a 
portnumber, in this case the forwarding will start on that port, if 9
is specified then the forwarding will start for all the ports.

HO msg# : Puts a message in the HOLD-list.

IE Callsign :
 Gives first the WP information using IL format (see below), and then prompts
the deletion of the record. If the answer is Y, the record will be deleted,
else you enter the edition mode. Type return to exit edition mode. The
commands are :
 U          : Updates primary part with the temporary part (2 -> 1).
 N  name    : Changes the name of the user.
 1H Route   : Changes the primary route.
 1Q Qth     : Changes the primary Qth.
 1Z Zipcode : Changes the primary ZipCode.
 2H Route   : Changes the temporary route.
 2Q Qth     : Changes the temporary Qth.
 2Z Zipcode : Changes the temporary ZipCode.

IL Callsign :
 Gives all the information of a callsign from the white pages database.

Kx :
 The fact that a leading K is entered before a kill command with the
letter K (I.E. KK, KK<, ...) triggers immediate killing of the specified
message. The archiving will be done at the next epurmess process according to
epurmess parameters. The status of the message becomes "A". The syntax is
identical to the command "K".

K> callsign : Deletion of any message to this callsign.

K< callsign : Deletion of any message sent from this callsign.

K@ route : Suppresses all the messages which have the specified route.

KF : Suppresses all the messages already forwarded.

$ msg# :
 Information about msg# forwarding: lists the BBS which have not yet
received the message #.

LU (RU) :
 Lists (or displays) all the personnal messages which have not yet
been read by their addressee.

Mx :
 Same as the command "L", with the same syntax, but the BID is inserted
at the beginning of the "SUBJECT"-field. This command allows you to do some
search or to visualize BIDs in the message lists (commands MS, ML, etc...).

PR :
 Enables or disables the printer from the console. The printer is
automatically disabled on disconnect.

PR> filename : validates and redirects the printing to a filename.
               (Works only in DosFBB)

PR> -        : validates and redirects the printing to the standard printer.
               (Works only in DosFBB)

RE : Releases HELD messages.

SR [#msg] [+filename] [subject]
 Reply to a message already read or formerly suppressed, or to a message
matching the specified number and appends the contents of filename. If the
subject is not stated, it will be the title of the read message, with the
"Re:" placed ahead.

SYS :
 Enables remote Sysop mode. A callsign validated as SYSOP is permitted
to access messages and files in the BBS according to the settings in
PASSWD.SYS file.  The  SYS  command  will  return  a  string  of numbers
corresponding to the position of a letter in a sentence located in the
PASSWD.SYS file. If you send back the 5 letters (without any space) matching
the 5 numbers, an OK will be sent out to confirm that the SYSOP mode is
granted.

YL file : Modifies the description of an existing YAPP file.


Other commands:

M :
 In the SATELLITE ORBITAL COMPUTATION menu, manual modification of the
orbital parameters of the satellites.

N Callsign :
 In  the  "Call-book"  menu,  this  command  allows  to  edit/modify
call-book information of a user.

S file :
 In the gateway and in command mode, send an ascii file.

W file :
 In the gateway, opens a capture file. The file is closed with another W
command.

YU Filename :
 In gateway mode and only from the console send a binary file to a remote
system under the YAPP protocol.

YD Filename :
 In gateway mode and only from the console receive a binary file from a
remote system under the YAPP protocol.

/R : Reboot PC
/A : Stop BBS-program
/K : Reboot BBS, including housekeeping.
/L : Reboot BBS, wait till all users have disconnected.
/M : Reboot BBS, immediately.

You will also find a list of all function-keys in the Console Commands
chapter.






This page was last updated 

fbb-7.0.10/doc/html/doclined.htm0000644000175000017500000000744513613360505013271 00000000000000 Line editor (Appendix 1)

How to use the line-editor.

(Appendix 1)

 The FBBDOS offers a small line editor allowing the process of ASCII 
files.  It can help the remote SysOp to maintain the system files of 
the software.

 The commands are straightforward, and for better efficiency, they can
be chained on a single line.

Here are the available commands:


? : Shows all commands that can be used in the editor.

A : Adds a line after the current line.  The text for the new line
    shall follow the letter A.  If more commands are to follow after
    the text, the text must be ended with a "/" before next command.  If 
    the sign "/" itself is to used in the text, a "\" must be written 
    just before the "/".  If again the "\" is to be used inside the text
    as a valid character, it must be written twice ("\\").  
    The pointer will be at the start of the new line.
      
B : Go to start of file.
   
E : Go to end of file.

F : Search for the first occurrence of a character (or string of 
    characters) in the file.  The search starts at the current line.
    The string of characters must be ended with a "/" if more commands
    are chained (se the paragraph on the A-command).
       
I : Insert a line before the current line.  Read about ending with a
    "/" in the paragraph on the A-command.

K : Delete the number of lines that are stated just before the letter K.
    Example:  3K
    If no number is used, then 1 line is deleted.
       
L : Move a number of lines from the current line.  The number can be 
    negative to move towards the start of the file.
    Examples:  5L   -10L
       
N : Toggle line-numbering on/off.

P : Show a number of lines from the current line.  Example 8P.  This
    will show 8 lines, starting with the current line.
       
R : Search and replace.  Search for a string of characters and replace it
    with a new one.  Example:  RALL/ALLE  will replace all ALL with ALLE
    from the current line to the end of the file.  
       
S : Save file.

Q : Exit the editor without saving the file.


Examples::


    "EDIT>B5L10P" sets pointer at start of file.  Move 5 lines down, and
                  show 10 lines from there.
                  
    "EDIT>B4L6K-2L1OP" sets the pointer to the start of file.  Move down
                  4 lines.  Delete 6 lines.  Move back 2 lines, and show
                  10 lines.
                     
    "EDIT>BFBonjour/K-2L5P" sets the pointer to the start of file,
                  searches for "Bonjour", deletes the line containing
                  "Bonjour",  moves back 2 lines and shows 5 lines.
     *                
    "EDIT>BFBonjour/IC'est une nouvelle ligne avec un \/ dedans/-1L3P"
                  sets the pointer to start of file.   Searches for
                  "Bonjour", inserts the new line.  The new line also
                  contains the character "/".  Goes back 1 line and
                  shows 3 lines.
                     
    "EDIT>SQ"     save file and quit the editor.
       





This page was last updated 


fbb-7.0.10/doc/html/fmtess.htm0000644000175000017500000000406613613360505013005 00000000000000 ESS.COM

ESS.COM

ESS.COM: (Only for DosFBB)

 ESS is an async port driver optimized for FBB software. It can drive either
TNC2/PK232/clones or KAM.

 This small device driver is loaded as resident at the beginning of the
machine initialization (TSR).

 One ESS handles one serial line and makes use of one IRQ.

 The COM number, the address of the serial interface and the IRQ number are
given as parameters appended to the command line. The address should be given
as a FOUR digit hex number.

 Example : Install ESS for COM1 at hex 03F8 and using IRQ 4 :
 ESS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus ESS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device in the machine. On a PC the IRQ's can not usually be
shared.

 Should there be more than one port to handle, several ESS can be cascaded.
The IRQ should be different for each ESS, except for the case in which the
interrupt sharing is supported by the serial card used.

 Example :

 ESS 1 03F8 4
 ESS 2 02F8 3

 This sequence will load ESS's for COM1 and COM2.

 ESS accommodates also the muxing arrangement of serial ports.

 Version 1.08 of ESS-driver (included with DosFBB distribution)
 must be used with the MUX ! 






This page was last updated 

fbb-7.0.10/doc/html/fmtpassw.htm0000644000175000017500000000415213613360505013344 00000000000000 FORMAT of PASSWD.SYS

PASSWD.SYS

PASSWD.SYS (\FBB\SYSTEM).

 This file is in SYSTEM directory.

 The first line in this file is the generic password. That is, this password
will be used for all sysops that do NOT have a special password of his own.
Be adviced to change this to your own, secret password !

 The next line is a special password for one special sysop. In this case
LA6CU. The two first numbers correspond to the same "security-numbers" in
INIT.SRV (check this). So in this case of LA6CU, I will have the security-
number 69 before a successful SYS-command, and 1023 after. In the next line
the numbers for LA6IM is 123 and 1023.

 jkshdfkjasdfuweiuryiusdfashdfabsmfzmxncvbiouweqyriuyweruyasjhf
 LA6CU 69 1023 jkasdhfiuweyiruyasidkasfuiweriuoasdfkjlahsdfjlha
 LA6IM 123 1023 uiwyejhaskjdfhasdfiuyaiuowyeruakjsdfhkjahfdlkja

 Each line in PASSWD.SYS can have a maximum of 255 characters.  For the first
tests with the BBS-program, you will only need the first line. Write whatever
you like in it, and have a copy of it an paper. And let nobody else see that
paper (hi).

To get priviliges as a remote sysop, you must first have been declared as a
sysop with the EU-command.  Set flag S for Sysop.
Next you must send the command SYS to the BBS.  The BBS will answer like:
LA1B-5>  12 53 45 28 92  [0852415395]
You will have to respond by 5 characters, the 5 corresponding to the 5
numbers you have received from the BBS.  The extra numbers in brackets, the
[0852415395], is for an automatic MD2 password decoding system, which has
been implemented in TPK and some other terminal-programs (I believe..).
You may ignore the numbers in the brackets.








This page was last updated 

fbb-7.0.10/doc/html/fmtesska.htm0000644000175000017500000000137513613360505013321 00000000000000 ESSKAM.COM

ESSKAM.COM.

ESSKAM.COM:    (Only for DosFBB)

ESSKAM works exactly as ESS.COM, but only for Kantronics Kam TNCs.






This page was last updated 

fbb-7.0.10/doc/html/fmtcron.htm0000644000175000017500000000370013613360505013146 00000000000000 FORMAT of CRON.SYS

CRON.SYS



CRON.SYS (\FBB\SYSTEM).

 This file is in the SYSTEM directory. The BBS looks in this file once every
hour. If the hour and date is right, the BBS will execute the commands in
this file.

 DOS-programs are run with X or D command, like X DOTHIS.EXE or D DOTHAT.EXE.
When running BAT files, a COMMAND.COM is automatically first sent. That needs
some more memory.

In DosFBB the the screen is saved with D-cpmmand, and reappears after the 
program has terminated.  With X the program will not write to the screen.

 #
 # File CRON.SYS. Here DOS-commands can be executed to fixed
 # hours, also Gateway, Yapp, Bip and Talk can be turned on or
 # off.
 # Format: TALK YES (NO), BIP YES (NO), GATE 1 YES (NO), YAPP 2
 # YES (NO).
 # DOS-program is run like in FORWARD.SYS with D or X command.
 #
 # As in FORWARD.SYS, you can use H for hour and D for day.
 # 0=sunday, 1=monday,.....6=saturday.
 # Also IF-ENDIF and IF-ELSE-ENDIF is allowed
 #
 # Possible formats for time:
 # IF H 0-9 All hours between 00 and 09.
 # IF H 0,9 Only at 00 and 09.
 # IF H 0,9-11 At 00, and all other hours between 09 and 11.
 # IF D 0-2 Sunday, monday tuesday.
 #
 TALK NO
 BIP NO
 GATE 1 YES
 GATE 2 YES
 YAPP 1 YES
 YAPP 2 YES
 IF D 1-5
   IF H 15-23
     GATE 3 YES
     YAPP 3 YES
   ELSE
     GATE 3 NO
     YAPP 3 NO
   ENDIF
 ELSE
   IF H 8-23
     GATE 3 YES
     YAPP 3 YES
   ELSE
     GATE 3 NO
     YAPP 3 NO
   ENDIF
 ENDIF
 X DOTHIS ARG1 ARG2 ARG3
 D DOTHAT ARG1 ARG2






This page was last updated 

fbb-7.0.10/doc/html/docappen.htm0000644000175000017500000000475213613360505013277 00000000000000 Appendix (menu)

APPENDIX.

(Menu)

APPENDIX 1 : EDIT Commands
APPENDIX 2 : PK232 Host-Mode 
APPENDIX 3 : G8BPQ interface
APPENDIX 4 : Kantronics KAM
APPENDIX 5 : DRSI-card
APPENDIX 6 : PROCESS NUMBERS AND HELP 
APPENDIX 7 : RECORDING A MESSAGE 
APPENDIX 8 : TRICKS AND TIPS 
APPENDIX 9 : FBB FORWARD PROTOCOLE 
APPENDIX 10: COMPRESSED FORWARDING 
APPENDIX 11: FORMAT OF ACK MESSAGES
APPENDIX 12: REPLACEMENT CHARACTERS OR WILDCARDS
APPENDIX 13: PROGRAMMING TECHNICS FOR SERVERS
APPENDIX 14: CONTENTS OF THE DIRECTORIES 
APPENDIX 15: CONNECTION FILTERING 
APPENDIX 16: MESSAGE FILTERING 
APPENDIX 17: PG PROGRAMS DEVELOPMENT
APPENDIX 18: UNPROTO MESSAGE LISTS 
APPENDIX 19: EXTENSIONS TO THE YAPP PROTOCOLE
APPENDIX 20: Telephone modem
APPENDIX 21: File filtering
APPENDIX 22: MAIL.IN (import messages directly)
APPENDIX 23: Installation-help for LinFBB
APPENDIX 24: TELNET installation for LinFBB and WinFBB
APPENDIX 25: TFPCX / TFPCR / TFKISS (Hostmode KISS-driver)
APPENDIX 26: EMS/XMS memory.
APPENDIX 27: Using FBB with PE1CHL NET and the BPQ Hostmode Emulator
APPENDIX 28: Conference-mode
APPENDIX 29: Gateway-mode
APPENDIX 30: TFWIN.DLL Kiss-interface for WinFBB32
APPENDIX 31: LOCK-files.






This page was last updated 


fbb-7.0.10/doc/html/fmtprote.htm0000644000175000017500000000175213613360505013343 00000000000000 FORMAT of PROTECT.SYS

PROTECT.SYS

PROTECT.SYS (\FBB\SYSTEM).

 This file is in the SYSTEM directory.

 In this file you can specify some directories in which you do NOT want any
sysop to be able to delete any files, without a special syntax. To delete
files in  protected  directories,  the  command  must  look  like  this: 
DEL +FORWARD.SYS In an un-protected directory the command looks like this:
DEL FORWARD.SYS. So you can see that you need an extra '+' sign in 
protected directories.


 Example of PROTECT.SYS:
 \
 \FBB
 \TOOLS






This page was last updated 

fbb-7.0.10/doc/html/toolmrej.htm0000644000175000017500000000145213613360505013333 00000000000000 Tool: MAINTREJ

MAINTREJ.COM

This page is under construction !

 Utility maintaining the REJECT.SYS file. The REJECT.SYS file describes
the Reject, Hold and Local hold information.

 The program reformats the lines and verify the number of parameters.






This page was last updated 

fbb-7.0.10/doc/html/fmtmesfi.htm0000644000175000017500000000617113613360505013315 00000000000000 Message filtering (Appendix 16)

Message filtering.

(Appendix 16)


 FBB software allows filtering messages. Filtering is not done by the BBS
software but by external programs developed by users.

 When the BBS starts, the M_FILTER does not really need to be there.  But at
the first message, it must exist.  If it does not exist at THAT time, it will
not be checked again.  So if a M_FILTER is added after that, the BBS must be
rebooted for the filter to take effect.

M_FILTER may be interactive and allows to incorporate some features like 
dedicated information for predefined callsigns, password filtering, etc...

 I did not develop such programs, but this is an open door to many
applications.

 The M_FILTER program must be found by the PATH of MsDos. Its extension can
be COM or EXE, and it must be little and fast as multitasking is stopped
during the activity of this program. If this program is not found, it will
not be called until the BBS is rebooted.

 The M_FILTER may also be created as a DLL.  Both for WinFBB and DosFBB (!!).
The filter must be installed in the path (\FBB\BIN) of Dos.

 The message filter is called (if found) each time a message is ready to be
recorded (when Ctrl Z or /EX is received). The decision to validate or not
the message is function of the exit value of the M_FILTER program.

 The M_FILTER program (if found) is called with some arguments including a
level number. This number is incremented each time the program is called in
the same connection session. The first time the level number will be 0.

 The line arguments given to the M_FILTER program are :

- File name including the text of the message.
- Type of the message (P, B, T).
- Sender.
- "To" field.
- Record number of DIRMES.SYS file.

 The M_FILTER program ends with an exit value. This value is very important
and tells the BBS what to do :

 0 : Message is recorded.
 1 : Message is killed   (status = K).
 2 : Message is archived (status = A).
 3 : Message is held     (status = H).


/*
 * M_FILTER.C
 *
 * The message filter MUST be named M_FILTER (COM or EXE).
 *
 * This example only writes its call arguments in the TEST.MES file.
 *
 * It is called with 5 arguments :
 *   File name of the message.
 *   Type .
 *   Sender.
 *   To.
 *   Number of the record in the DIRMES.SYS file.
 *
 * If it returns 0 : The message is accepted.
 *               1 : The message is killed (status K).
 *               2 : The message is archived (status A).
 *
 */

#include <stdio.h>
main(argc, argv)
int  argc;
char **argv;
{
  int  i;
  FILE * fptr = fopen("TEST.MES", "at");

  for (i = 0 ; i < argc ; fprintf(fptr, "%s ", argv[i++]));
  fputc('\n', fptr);

  fclose(fptr);

  return(0);
}










This page was last updated 

fbb-7.0.10/doc/html/docproc.htm0000644000175000017500000000404313613360505013130 00000000000000 Process (Appendix 6)

Process numbers and help.

(Appendix 6)

Process number and on-line help identification.

 The various processing functions contained in the software are identified by
three numbers displayed in the status banner. The first of those three
numbers  is  the  main  process  system  (BBS,  FBBDOS,  Satellite
Computation, etc...), the second number is the process function (in the BBS,
list, message sending, etc..) and the third number is a sub-function (record
of the message title, message, etc..)

 A complete description of these numbers would be useless and time consuming.
They are mainly used for debugging purpose. The first number is also used to
identify the help block out of the x.HLP file. Upon receipt of the "?" or the
"H", the  software  searches  the  x.HLP  file  for  a  line  of  
corresponding to the language in use, and of the format @@ number word in
which "number" stands for the current processing level, and "word" stands for
the word following the command "?" or "H".

 Example : you are inside FBBDOS, and you type in the command "? EDIT", the
help block searched for must begin with the line:

 @@ 9 EDIT

 It may happen that a block matches several search keywords. It is enough to
specify the various words separated by the character "|" (vertical bar), WITH
NO SPACE.

 @@ 9 EDIT|EDITEUR

 List of the processing levels :

 0 Connection.
 2 Qra-Locator.
 3 Statistics.
 4 Information.
 5 Nomenclature.
 6 Satellite Orbital Computation.
 9 FbbDos.
 11 Telephone Modem
 14 BBS.
 15 Forward.
 16 Gateway Sysop page.
 17 YAPP.
 18 Conference.







This page was last updated 

fbb-7.0.10/doc/html/docfbbd.htm0000644000175000017500000001532113613360505013063 00000000000000 FBBDOS commands

FBBDOS COMMANDS.

The syntax of the various FBBDOS commands is very close to that of 
MsDos(R).

Several specific commands have been added: PUT and GET for ASCII file
transfers. XPUT, YPUT and XGET, YGET for binary file transfers.

EDIT command for ASCII files editing.

When entering FBBDOS, the prompt shows the virtual directory in which the
user is located. There is no physical drive concept (A, C, etc...), the user
is situated in a directory defined in the INIT.SRV file; this directory
becomes the root of the available directory tree. Should the user be a SYSOP,
and if he successfully validated his privileges using the SYS command, the
root of FBBDOS will be the root of the current drive.

A file created by a user belongs to this user.
Only the owner of the file, or a SYSOP granted writing privileges (SYS
command) are permitted to delete or modify this file.

BGET file :
 A binary file is downloaded from the BBS. The Autobin protocol is used.

BPUT file :
 A binary file is uploaded to the BBS. The Autobin protocol is used. 

CD directory :
 Changes the active directory. This command allows you to move within the
directory tree by changing the active directory. "CD.." changes back by one
directory "upstream" towards the root.

COPY Origin Destination :
 Copies a file into another file. If the destination file already exists, it
must belong to the user.

DEL file :
 Deletes a file. A file cannot be deleted if it does not belong to the user.

DIR [mask] :
 Displays all the files contained in the directory or these corresponding to
the mask if it is specified. If the mask matches a directory name, the
content of this directory will be listed.

DOS Program Arguments :
 Allows a remote SYSOP (after SYS command) to run a DOS program. This program
can not expect keyboard input. A list of arguments can be specified. The
output to the screen will be send to the remote SYSOP at the completion of
the program. If the program expects inputs, after a time-out of 2'45, it will
be aborted (if possible) and the normal operation will resume.

DU [mask] : Gives the size of the tree, and local used disk.

EDIT file :
 Edition of a text file, using the line editor. If the file already exists,
 it must belong to the user. Instructions on how to use the line editor is
 in a seperat section of this documentation.

EXIT : Exit FBBDOS and return to the BBS or server.

GET file :
 Displays the content of an ASCII file. Such a display is never scrolled by
pages, and ends with a Ctrl-Z, thus allowing ASCII file transfers from the
BBS to the user.

LIST mask :
 Displays all the files contained in the directory or these matching the mask
specified. if the mask matches a directory name, the content of this
directory will be listed. Each line displays the filename and a descriptive
comment (cf YI command).

MD directory :
 Creates a new directory. The new directory is appended next to the current
directory.

O : Display various options.

OL : Lists the available languages.

OL number : To select a language.

OP : Validates or disables the scrolling of pages.

OP nbr of lines : Set how many lines per page in page scrolling.

PRIV :
 Access to a private directory (or return to Fbb-Dos directories). Each user
can have access to a private directory provided it has been defined by the
SYSOP (I.E. EU command). Several users may share a private directory.

PUT file :
 Accepts an ASCII file from a user. The file must end with a Ctrl-Z to be
validated. If the file already exists, it should belong to the user.

RD directory :
 Deletes a directory. A directory cannot be deleted as long as it is not
empty.

TYPE file :
 Displays the content of an ASCII file. Eventually, this list can be scrolled
by pages.

VIEW mask :
 Displays the content of all the archive files contained in the directory and
corresponding to the specified mask. 
For DosFBB and WinFBB: This function uses the FV.COM shareware.
Thanks to the authors of this last one.
In LinFBB: VIEW command of LINUX version calls FBB_VIEW program. (or any 
program defined by the variable $FBB_VIEW). fbb_view may be a shell script.


WHERE filename :
Command to find one or more files in FBBDos.  Wildcards are allowed.

XGET file [offset]:
Only via telephone-modem:
A binary file is downloaded from the BBS. The Xmodem protocol is used. This command
works only on a PSTN modem port. If offset is specified, download will start
from offset.

X1GET file : Same as above, with 1K-Xmodem protocol.

XPUT file :
Only via telephone-modem:
A binary file is uploaded to the BBS. The Xmodem protocol is used. This command
works only on a PSTN modem port.

YGET file :
A binary file is downloaded from BBS. 
Via radio:
Both YAPP and YAPC protocols may be used.  
Via telephone-modem:
YGET starts the YMODEM, YMODEM-batch or YMODEM-G protocols.

YPUT file :
A binary file is uploaded to the BBS. 
Via radio:
Both YAPP and YAPC protocols may be used.
Via telephone-modem:
YPUT starts the YMODEM protocole.  This is NOT available if the BBS is
running DosFBB !

ZGET file :
Only via telephone-modem:
ZGET starts download from the BBS using the YMODEM, YMODEM-batch or 
YMODEM-G protocols.

ZPUT file :
Only via telephone-modem:
YPUT starts upload to the BBS using the YMODEM protocole.  This is NOT 
available if the BBS is running DosFBB !





This page was last updated 

fbb-7.0.10/doc/html/fmtrunfb.htm0000644000175000017500000001077313613360505013331 00000000000000 Format of RUNFBB.BAT

RUNFBB.BAT

Only for WinFBB !

RUNFBB.BAT (\FBB\BIN).

 This is the very first file that WinFBB will use. You will find it in 
\FBB\BIN-directory. You don't really need to do any changes in this file,
unless you did some changes during the installation-process.  If you did, 
you must change the pathnames in RUNFBB.BAT exactly the same as you did 
during the installation.
This is very important ! So look for the lines that I have marked with 
an     <---      here :

@echo off
rem -------------------------------------------------
rem This file is run from RUNFBB.EXE.  Only the relevant part is started.
rem It can be START, STOP, RERUN, MAINT or ERROR.
rem Do not forget to type "goto end" at the end of each section !
rem --------------------------------------------------

break off
set fbb=C:\FBB                                 <----
goto %1

:start  ********************** START of START script ************************
  echo off
  cd %fbb%
  goto end
rem *************************** END of START script **************************

:rerun  *********************** START of RERUN script ************************
  cd %fbb%
  goto end
rem **************************** END of RERUN script **************************

:maint  ********************** START of MAINT script **************************
    cd %fbb%
    @echo off
    cd %fbb%\system\sat                              <----          
    if not exist amsat.txt goto amsatend
    satupdat amsat.txt /n > satupdat.res
    satupdat amsat.txt >> satupdat.res
    del amsat.txt
  :amsatend
    echo Backup of important files
    copy %fbb%\system\dirmes.sys %fbb%\backup\dirmes.s1		<----           
    copy %fbb%\system\inf.sys %fbb%\backup\inf.s1               <----
    echo Cleaning up messages...
    del epurmess.res
    epurmess
    rem EPURWP Parametre:  Number of days before update, and delete
    rem Default is 40 and 90
    epurwp 45 95
    del %fbb%\system\wp\wp.old				<----
    cd %fbb%\system
    clr_user>>%fbb%\clr_user.res			<----
    MAINTINF 3 /a
    COPY %FBB%\SYSTEM\INF.NEW %FBB%\SYSTEM\INF.SYS	<----
    cd %fbb%
    del %fbb%\system\dirmes.new				<----
    del %fbb%\system\dirmes.old				<----
    if not exist %fbb%\error.sys goto direct		<----
    rem ---------------------------------------------------
    rem --- If you want a message when errors have occured:
    rem --- PLEASE exchange LA6CU with your own callsign !!!!	
    rem echo SP LA6CU             >> %FBB%\MAIL.IN		<----
    rem echo Error-report         >> %FBB%\MAIL.IN		<----
    rem type %FBB%\ERROR.SYS       >> %FBB%\MAIL.IN		<----
    rem echo.                     >> %FBB%\MAIL.IN		<----	
    rem ECHO /EX                  >> %FBB%\MAIL.IN		<----
    rem type %FBB%\ERROR.SYS       >> %FBB%\ERROR.LOG		<----
    rem del %FBB%\ERROR.SYS					<----
    rem ---------------------------------------------------
:direct
    goto end
rem **************************** END of MAINT script  ************************

:stop ************************* START of STOP script *************************
  goto end
rem ***************************** END av STOP script *************************

:error  ********************** START av ERROR script *************************
  echo WFBB exited with ERRORLEVEL %2
  sleep 5
  goto end
rem **************************** END av ERROR script **************************

:end
  echo %1 script is finished.
  sleep 2






This page was last updated 

fbb-7.0.10/doc/html/fmtport.htm0000644000175000017500000010605113613360505013174 00000000000000 FORMAT of PORT.SYS

PORT.SYS

PORT.SYS (\FBB\SYSTEM).

First, be aware of this useful feature:
If PORT.SYS does not exist, FBB looks for 
PORT_D.SYS (for DosFBB)
PORT_W.SYS (for WinFBB)
PORT_L.SYS (For LinFBB)
So it is possible to have for example DosFBB and WinFBB files in the PC
at the same time.  This is useful at sites where you want to change
from WinFBB to DosFBB from time to time..

I have divided this section in two parts:
1   :  Simple instruction (for first-time setup).

2   :  Advanced setup, with more details.
2.1 :  For BPQ.
2.2 :  For DRSI.

1: Simple instruction (for first-time setup).

 This file is found in the directory called SYSTEM (if you used my default
directory-names). In this file we decide what kind of TNCs to use, how many
available channels etc. You must do several changes here, and be very careful
that you do all changes correctly. If you don't, the BBS cannot operate
properly.  Remember that a line starting with # is a comment-line, and the
BBS ignores these lines.

 # FBB7.00
 # File for programming of channels and TNCs.
 #
 # Ports : How many ports (COM1, COM2, Etc...)
 # TNCs : How many TNCs and modems in use. With multiplexer
 # there can be up to 4 TNCs per port.
 #
 #Ports TNCs
 2      2
 #

 Next you must type one complete line of parametres for each COM-port you
use. You must be careful to use the correct values here.

Here are the valid interfaces for DosFBB and WinFBB:

For WinFBB:
The mostly-used interface for WinFBB is 6.  This interface replaces ESS,
MBBIOS etc and FBBIOS.  The driver is FBBCOMM.DRV, which is installed 
during the installation-process.
In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-adress as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll (only WinFBB32)
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !

For LinFBB (Linux):
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).

For DosFBB:
If you use drivers like COMBIOS, BPQ or DRSI-card, you must be careful to 
give the correct values here. If you use COMBIOS, FBBIOS, BPQ etc, they 
must always be loaded before you start the BBS-program.
In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..


Example for WinFBB:
I use 2 TNCs, one on COM1 and one on COM3, and I use the standard 
FBBCOMM.DRV loaded by Windows:

# Com       : COM-number (1,2,...8)
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll (only WinFBB32)
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
1    6         3F8                9600
3    6         338                9600
#


Same example for DosFBB:
I use 2 TNCs, one on COM1 and one on COM3, and I use the ESS-driver 
(ESS must be properly loaded before FBB is started):

# Com       : COM-number (1,2,...8)
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
1    1         3F8                9600
3    1         338                9600
#

Same example for LinFBB (Linux):

# Com       : COM-number (1,2,...8)
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (Device)   Baud
1    9         /dev/cua0          9600
3    9         /dev/cua2          9600
#

 Once more, the number of lines below must be the same as number of TNCs in
use. One line for each TNC. I think most of it is self-explanatory. MultCh
will normally be 1. If you use DRSI-card, you can use a value from 0 to 7. 
If you use BPQ, the first TNC must have MultCh 0, the next must have MultCh1
and so on.  This is very important. If you have a KAM in host-mode, you must
use 1 for VHF and 2 for HF.  When using kernel AF_AX25 socket in Linux,
MultCh is the interface name (eg: ax0). 
MxBloc decides how many kb will be forwarded one way to another BBS before 
the forward is reversed. Leave this value at 10 for VHF/UHF and a little 
smaller for HF. Type host-mode depends on your TNC, and if you use BPQ :

 # TNC     : Number on TNC in use.  Use 0 for file-forward !
 # NbCh    : Number of channels I want to use in the TNC.
 #           Maximum available channels depend on firmware.
 # Com     : Number of the COM-port. Com1, Com2 etc.
 # MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
 #           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
 #           With BPQ first TNC must have MultCh 0, the next 1, etc. 
 #           When using kernel AF_AX25 socket in Linux, MultCh is the
 #           interface name (eg: ax0)
 # Paclen  : PACLEN on this TNC.
 # Maxframe: The maximum nb of frames the TNC will send at a time.
 # NbFwd   : Number of channels for OUTGOING forward at same time.
 # MxBloc  : Size of forward-block in kb.
 # M/P-Fwd : Minute of the hour for start of forward, and period
 #           (how many minutes between each forward-start).
 # Port mode, one of these:
 #           B : BBS-mode.
 #           G : "Guest"-mode.
 #           U : Normal-mode.
 # Type host-mode, one of these:
 #           D : WA8DED
 #           K : KAM hostmode.  Must use ESSKAM driver.
 #           P : PK-232
 #           Q : BPQ v 4.x
 #           T : Ethernet/TCP-IP
 #           X : AX25 domain socket (for Linux)
 # Addition: One or more of these letters can be used too:
 #           L : Send unproto beacon after each arriving mail.
 #           M : Telephone-modem.
 #           Y : Yapp allowed on this QRG.
 #           W : Gateway allowed TO this QRG.
 #           R : Modem port allowed in Read-only mode.
 # Freq.   : Text to describe this port (max 9 characters, no space)
 #
 # Same number of lines as TNCs:
 #
 #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
 1    7    1   1      230   4     1     10     30/60   UDYW 433.650
 2    1    3   1      80    2     1     5      17/30   GDW  15/20m
 #

 At the end of the file, you can specify one (or more) callsigns and SSIDs
for some channels. You might use this for special callsigns on forward-
channels. If you don't need this (you probably don't, at least not the first
times..), place an # in front of the line. This only works with WA8DED
interface.

 # Special callsigns and modes for some channels.
 #
 #TNC Nbs Callsign-SSID Mode
 1    2   LA1B-1        B
 #
 # End of file.
 #



2. Advanced setup, with more details.

The BBS may use a special port-multiplexer so that you can have up to
4 TNCs per COM-port.  
For DosFBB you may also use other drivers like COMBIOS, MBBIOS, FBBIOS etc.
These drivers must be loaded BEFORE the BBS-program. You can include the
drivers in APPEL.BAT for convenience. It is possible to use telephone-modem
with the BBS. In that case the number of TNCs include the modem. The FBBIOS-
driver must be loaded before the BBS starts.
For WinFBB you do not need COMBIOS, MBBIOS, ESS or FBBIOS.  They are all
included in FBBCOMM.DRV (interface 6).


Example for WinFBB:
 Standard PORT.SYS with 1 TNC (COM1) with WA8DED-hostmode,
FBBCOMM.DRV-driver, 4 channels, 1 channel for outgoing forward, 1 channel
reserved for BBSs with callsign LA1B-1 :

# FBB7.00
# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
1      1
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll (only WinFBB32)
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
1    6         3F8                9600
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
#           With BPQ first TNC must have MultCh 0, the next 1, etc.
#           When using kernel AF_AX25 socket in Linux, MultCh is the
#           interface name (eg: ax0)
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.  Must use ESSKAM driver.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
1    4    1   1      230   4     1     10     30/60   UDYL   433.650
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
1    1   LA1B-1        B
#
# End of file.
#

Same example for LinFBB (Linux):
Standard PORT.SYS with 1 TNC (COM1) with WA8DED-hostmode,
4 channels, 1 channel for outgoing forward, 1 channel
reserved for BBSs with callsign LA1B-1 :

# FBB7.00
# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
1      1
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll (only WinFBB32)
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
1    9         /dev/cua0          9600
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
#           With BPQ first TNC must have MultCh 0, the next 1, etc.
#           When using kernel AF_AX25 socket in Linux, MultCh is the
#           interface name (eg: ax0)
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.  Must use ESSKAM driver.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
1    4    1   1      230   4     1     10     30/60   UDYL   433.650
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
1    1   LA1B-1        B
#
# End of file.
#


Same example for DosFBB:
 Standard PORT.SYS with 1 TNC (COM1) with WA8DED-hostmode,
ESS-driver, 4 channels, 1 channel for outgoing forward, 1 channel
reserved for BBSs with callsign LA1B-1 :

# FBB7.00
# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
1      1
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll (only WinFBB32)
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
1    1         3F8                9600
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
#           With BPQ first TNC must have MultCh 0, the next 1, etc.
#           When using kernel AF_AX25 socket in Linux, MultCh is the
#           interface name (eg: ax0)
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.  Must use ESSKAM driver.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
1    4    1   1      230   4     1     10     30/60   UDYL   433.650
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
1    1   LA1B-1        B
#
# End of file.
#

Note that the differences in the three PORT.SYS files above (for WinFBB, LinFBB
and DosFBB) is ONLY the Interface and (for LinFBB:) the address !


In the next examples, all comment-lines are removed, for clarity.

One example for WinFBB:
Now an example of a file with 4 ports, 13 channels, FBBCOMM.DRV, with a
port-multiplexer on COM 1. Port 1 has limited access (guest-user), port 2 and
3 allows YAPP-transfer and port 4 uses a PK-232.  Port 2 and 3 also allows
unproto-beacon-lists.

# FBB7.00
#
#Ports TNCs
1      4
#
#Com Interface Address (device)   Baud
1    6         3F8                9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
1    4    1   1      230   4     0     1      00/60   GD    433.650
2    4    1   2      230   4     1     5      10/30   UDYL  144.675
3    4    1   3      230   3     4     10     20/60   UDYWL 433.650
4    1    1   4      80    1     1     5      15/30   BP    15/20m
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#

Same example for LinFBB (Linux):
Now an example of a file with 4 ports, 13 channels, with a
port-multiplexer on COM 1. Port 1 has limited access (guest-user), port 2 and
3 allows YAPP-transfer.  Port 2 and 3 also allows unproto-beacon-lists.

This example is really no good for LinFBB, as port 4 uses a PK-232 which is
not supported by LinFBB (yet ?).  But if it ever will be, it will probably
look something like this:

# FBB7.00
#
#Ports TNCs
1      4
#
#Com Interface Address (device)   Baud
1    9         /dev/cua0          9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
1    4    1   1      230   4     0     1      00/60   GD    433.650
2    4    1   2      230   4     1     5      10/30   UDYL  144.675
3    4    1   3      230   3     4     10     20/60   UDYWL 433.650
4    1    1   4      80    1     1     5      15/30   BP    15/20m
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#


Same example for DosFBB:
Now an example of a file with 4 ports, 13 channels, ESS-driver, with a
port-multiplexer on COM 1. Port 1 has limited access (guest-user), port 2 and
3 allows YAPP-transfer and port 4 uses a PK-232.  Port 2 and 3 also allows
unproto-beacon-lists.

# FBB7.00
#
#Ports TNCs
1      4
#
#Com Interface Address (device)   Baud
1    1         3F8                9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
1    4    1   1      230   4     0     1      00/60   GD    433.650
2    4    1   2      230   4     1     5      10/30   UDYL  144.675
3    4    1   3      230   3     4     10     20/60   UDYWL 433.650
4    1    1   4      80    1     1     5      15/30   BP    15/20m
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#

Note that the difference in the 3 PORT.SYS files above (for WinFBB, CFBB
and DosFBB) is ONLY the Interface and /for LinFBB:) the address !


Next an example of a file with 4 ports, 13 channels.  
This one is for DosFBB, but it is identical for WinFBB, with the exception
of interface, which must be changed to 6 for WinFBB. 

# FBB7.00
#
#Ports TNCs
4      4
#
#Com Interface Address (device)   Baud
1    1         3f8                9600
2    1         2f8                9600
3    1         3e8                9600
4    1         2e8                9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
1    4    1   1      230  4     0     1      00/60   GD   433.650
2    4    2   1      230  4     1     5      10/30   UDY  144.675
3    4    3   1      230  3     4     10     20/60   UDYW 433.650
4    1    4   1      80   1     1     5      15/30   BP   15/20m
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#

Same example for LinFBB (Linux):

# FBB7.00
#
#Ports TNCs
4      4
#
#Com Interface Address (device)   Baud
1    9         /dev/cua0          9600
2    9         /dev/cua1          9600
3    9         /dev/cua2          9600
4    9         /dev/cua3          9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
1    4    1   1      230  4     0     1      00/60   GD   433.650
2    4    2   1      230  4     1     5      10/30   UDY  144.675
3    4    3   1      230  3     4     10     20/60   UDYW 433.650
4    1    4   1      80   1     1     5      15/30   BP   15/20m
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#


2.1 For BPQ:
Now an example of a file with 2 ports with BPQ-node and 4 channels on 
each port.  Note that MultCh starts with 0 on first port !
This one is 100% identical for DosFBB and WinFBB !
This one is not possible for LinFBB as BPQ cannot be run in Linux.
BPQ must be correctly installed for DOS or WINDOWS (respectively) before
it can be used with FBB.

# FBB7.00
#
#Ports TNCs
1      2
#
#Com Interface Address (device)   Baud
8    2         0                  9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
1    4    8   0      230   4     1     1      00/60   UQY  433.650
2    4    8   1      230   4     1     5      10/60   UQY  144.675
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#

Note that I use COM8.  This is because this is a "virtual" port, and if I use
for example COM2, I will not be able to use COM2 for other purposes.
2.2 For DRSI: Next an example of a file with 1 DRSI-card and 8 channels, max 1 channel on HF. As for BPQ, this one is 100% identical for DosFBB and WinFBB ! # FBB7.00 # #Ports TNCs 1 2 # #Com Interface Address (device) Baud 8 4 0 9600 # #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq 1 8 8 0 230 4 1 10 00/60 UDY 433.650 2 1 8 1 80 2 1 10 30/60 GDW HF # #TNC Nbs Callsign-SSID Mode #1 1 LA1B-1 B # # End of file. # Same example for LinFBB (Linux): A file with 1 DRSI-card and 8 channels, max 1 channel on HF. This example needs z8530drv by DL1BKE properly installed! # FBB7.00 # #Ports TNCs 1 2 # #Com Interface Address (device) Baud 8 9 **** 9600 # #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq 1 8 8 scc0 230 4 1 10 00/60 XUY 433.650 2 1 8 scc1 80 2 1 10 30/60 XGW HF # #TNC Nbs Callsign-SSID Mode #1 1 LA1B-1 B # # End of file. # Last, SM6TKY's own (big) setup for Linux : Standard kernel AF_AX25 socket, 7 interfaces, 42 channels, 1 interface for file forward, 1 interface to a KISS TNC (ax0), 2 interfaces to a PA0HZP compatible SCC card (scc0 & scc1), 1 interface to Pseudo-TTY loopback for LinuxNode (ax2), 1 interface for EtherBPQ (bpq0), and 1 interface to NET/ROM in kernel (nr1). # FBB7.00 # File for programming of channels and TNCs. # # Ports : How many ports (COM1, COM2, Etc...) # TNCs : How many TNCs and modems in use. With multiplexer # there can be up to 4 TNCs per port. # #Ports TNCs 1 6 # #In WinFBB ONLY THESE interfaces are available: # Interface : 2 = BPQ-node (BPQ in AA4RE-mode) # 4 = DRSI # 5 = TFPCR/TFPCX interface. Interrupt MUST be 0xFD or the same # as stated in INIT.SRV, if any.. # 6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS. # 7 = TCP/IP. Needs WINSOCK.DLL. Put port-address as 17. # TNC-emulation is T (see below) # 8 = TFWin.dll (only WinFBB32) # BEWARE: The old interface 1 and 3 will NOT be used in WinFBB. Interface 6 # replaces both. (FBBCOMM.DRV). Neither ESS nor FBBIOS can be # used with WinFBB ! # #In LinFBB ONLY this interface is available: # Interface 9 = Linux. Can work via serial port (D),via AX25 domain # socket (X) or via Telnet port (T). # #In DosFBB ONLY THESE interfaces are available: # Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc) # 2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode) # 3 = Telephone-modem with FBBIOS # 4 = DRSI card with driver # 5 = TFPCR/TFPCX interface. Interrupt MUST be 0xFD or the same # as stated in INIT.SRV, if any.. # Address : Address of port in hexadecimal (Needed for multiplexer). # In LinFBB: # Address is the device name (/dev/cua0). # Be sure you have the rights to access to the device (rw-rw-rw-). # When using kernel AF_AX25 socket, address is not used. # When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23) # Baud : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet. # # Use same number of lines as number of ports. # #Com Interface Address (device) Baud 1 9 **** 9600 # # TNC : Number on TNC in use. Use 0 for file-forward ! # NbCh : Number of channels I want to use in the TNC. # Maximum available channels depend on firmware. # Com : Number of the COM-port. Com1, Com2 etc. # MultCh : Number of channel if port-multiplexer is used, otherwise 1. # In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF. # With BPQ first TNC must have MultCh 0, the next 1, etc. # When using kernel AF_AX25 socket in Linux, MultCh is the # interface name (eg: ax0) # Paclen : PACLEN on this TNC. # Maxframe: The maximum nb of frames the TNC will send at a time. # NbFwd : Number of channels for OUTGOING forward at same time. # MxBloc : Size of forward-block in kb. # M/P-Fwd : Minute of the hour for start of forward, and period # (how many minutes between each forward-start). # Port mode, one of these: # B : BBS-mode. # G : "Guest"-mode. # U : Normal-mode. # Type host-mode, one of these: # D : WA8DED # K : KAM hostmode. Must use ESSKAM driver. # P : PK-232 # Q : BPQ v 4.x # T : Ethernet/TCP-IP # X : AX25 domain socket (for Linux) # Addition: One or more of these letters can be used too: # L : Send unproto beacon after each arriving mail. # M : Telephone-modem. # Y : Yapp allowed on this QRG. # W : Gateway allowed TO this QRG. # R : Modem port allowed in Read-only mode. # Freq. : Text to describe this port (max 9 characters, no space) # # Same number of lines as TNCs: # #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq 0 0 0 0 0 0 0 0 00/01 ---- File-fwd. 1 8 1 ax0 250 7 2 10 30/01 XUWYL ax0 2 8 1 scc0 250 7 2 10 30/01 XUWYL scc0 3 8 1 scc1 250 7 2 10 30/01 XUWYL scc1 4 8 1 ax2 250 7 2 10 30/01 XUY Loopback 5 8 1 bpq0 250 7 2 10 30/01 XUWYL bpqether 6 2 1 nr1 250 7 2 10 30/01 XUY netrom # # Special callsigns and modes for some channels. # #TNC Nbs Callsign-SSID Mode 1 2 XXXXX-1 B # # End of file. # This page was last updated
fbb-7.0.10/doc/html/docgloss.htm0000644000175000017500000000406313613360505013316 00000000000000 Format of FBB-files, menu

Glossary.

This is an ettempt to explain difficult/strange words from this documentation. Send all your suggestions for this page to LA6CU. Autobin : A protocole for transfer of binary files via radio-ports. Supported by several terminal-programs. DLL : DLL is Dynamic Link Library. This is used in the windows environment and allows a program to attach a library which holds some code during the session or only during a phase of a program (like filters in FBB). This allows a very fast and efficient mechanism. Also DLL may be compact. DPMI : Dos Protected Mode Interface. It enables Ms-Dos based applications to access all the extended memory installed in the PC maintaining system protection. DosFBB uses it, so it is not limited to the memory below 1Mb and PG/SERVERS have more that 500Kb of memory to run. GPF : Windows error-message. Means that the BBS has performed an action that has caused a General Protection Failure. VXD : VXD is more complex. I don't know exactly but they are something like drivers for Windows using 32 bit code. YAPP : "Yet Another Packet Program". Originally a program by WA7MBL for simple transfer of binary files on packet radio. The protocol from his program is widely known as the YAPP-protocol. Xforward : Another kind of compressed forward, implemented in FBB. This page was last updated
fbb-7.0.10/doc/html/toolmkpg.htm0000644000175000017500000000221013613360505013325 00000000000000 Tool: MAKEPG

MAKEPG.COM

 Utility used to generate .EXE (or .COM) program file out of the binary file
(xxx.BIN) using English or French language.

This program may not be used in some versions of FBB software !!!
This program needs a .BIN-file (like WFBB.BIN) to convert to an .EXE or .COM
file.  If a BIN-file does not exist, the program will only be in english
version (as a .COM or .EXE file).

 The syntax is of the type:

 MAKEPG program FR
  To generate a program in French

 MAKEPG program GB
  To generate a program in English.

 MAKEPG can transform the following programs :
  SERV.BIN     -> SERV.EXE
  MAINTINF.BIN -> MAINTINF.COM
  EPURMESS.BIN -> EPURMESS.COM
  EPURWP.BIN   -> EPURWP.COM






This page was last updated 

fbb-7.0.10/doc/html/Makefile.am0000644000175000017500000000341613613360505013024 00000000000000docdir = $(datadir)/doc/@PACKAGE@/html doc_DATA = docackno.htm docfwcom.htm doctraje.htm fmt_afro.htm\ fmtetat.htm fmtmess.htm fmtrunfb.htm fmtyappl.htm toolfv.htm\ docappen.htm docfwpro.htm doctrick.htm fmtappel.htm fmtfbbio.htm\ fmtmulti.htm fmtsatel.htm fpk232.htm toolinst.htm docbbs.htm\ docgate.htm docvaria.htm fmtbbs.htm fmtfbcm.htm fmtnewdo.htm\ fmtsat.htm ftfpcx.htm toolisda.htm docconf.htm docgloss.htm\ docwild.htm fmtbeaco.htm fmtfilfi.htm fmtoptio.htm fmtserv.htm\ ftlock.htm toollgst.htm docconts.htm doc.htm docwp.htm\ fmtconfi.htm fmtforwa.htm fmtpassw.htm fmtswapp.htm ftpe1chl.htm\ toolminf.htm doccopyr.htm doclined.htm fbpq.htm fmtcron.htm\ fmtheard.htm fmtpg.htm fmttelne.htm fttfwin.htm toolmkpg.htm\ doccstat.htm docmined.htm fdrsi.htm fmtdirme.htm fmtinf.htm\ fmtphnmo.htm fmttheme.htm tlfbb_zm.htm toolmrej.htm docdocut.htm\ docmisc.htm finittnc.htm fmtdriv.htm fmtinit.htm fmtport.htm\ fmttpsta.htm tllinux.htm toolsatu.htm docedit.htm docnomen.htm\ fkam.htm fmtdsz.htm fmtlang.htm fmtprote.htm fmttxt.htm\ tlxfbbc.htm toolsetu.htm docfbbd.htm docproc.htm fmnewdoc.htm\ fmtems.htm fmtlog.htm fmtredis.htm fmtunpro.htm toolclea.htm\ toolslee.htm docfeatu.htm docqthlo.htm fmstatis.htm fmtepurm.htm\ fmtmail.htm fmtrejec.htm fmtwfbid.htm toolclus.htm toolview.htm\ docfirst.htm docrecme.htm fmtack.htm fmterror.htm fmtmaint.htm\ fmtreqcf.htm fmtwpsys.htm toolcut.htm docform.htm docserv.htm\ fmt_afax.htm fmtess.htm fmtmemo.htm fmtreqdi.htm fmtxfbb.htm\ toolepum.htm docfunck.htm docsysop.htm fmt_afne.htm fmtesska.htm\ fmtmesfi.htm fmtreqfi.htm fmtyapex.htm toolepwp.htm EXTRA_DIST = $(doc_DATA) fbb-7.0.10/doc/html/fmtsatel.htm0000644000175000017500000000476513613360505013331 00000000000000 FORMAT of SATEL.DAT

SATEL.DAT

SATEL.DAT file (\FBB\SYSTEM\SAT).

 This binary file holds the information on the satellite data base of the
BBS. This file is very important and must not be edited or changed otherwise
the list of the satellites could be lost. This file can only be opened for
reading.

 It is organized with records, each record containing information on a
satellite. Never modify this file while the BBS is running.

 Structure of one record (C language) :

typedef struct {

  char   sat_name[18];  /* 18  Name of the satellite           */
  int    year        ;  /* 2   Year of reference               */
  double day         ;  /* 8   Day of reference                */
  int    month       ;  /* 2   Month of reference              */
  int    hour        ;  /* 2   Hour of reference               */
  int    minute      ;  /* 2   Minute of reference             */
  int    second      ;  /* 2   Second of reference             */
  double inclination ;  /* 8   Inclination                     */
  double raan        ;  /* 8   R.A.A.N.                        */
  double excentricity;  /* 8   Excentricity                    */
  double a_perigee   ;  /* 8   Argument of perigee             */
  double mean_anomaly;  /* 8   Mean anomaly                    */
  double a           ;  /* 8   must be 0.0                     */
  double mean_motion ;  /* 8   mean motion                     */
  double dec_rate    ;  /* 8   Decay rate                      */
  long   revolution  ;  /* 4   Epoch revolution                */
  double frequency   ;  /* 8   Frequency for doppler computing */
  double v           ;  /* 8   must be 0.0                     */
  int    step        ;  /* 2   Step of processing (minutes)    */
  long   last_upd    ;  /* 4   Date of last update             */
  long   catalog     ;  /* 4   NASA Catalog Number             */
  int    free[4]     ;  /* 8   Unused                          */

} satel              ;  /* 138 bytes : lenght of one record    */

In C language, all strings are ended with a NULL (00 hex) character.








This page was last updated 

fbb-7.0.10/doc/html/docmisc.htm0000644000175000017500000000362513613360505013125 00000000000000 Miscellaneous tools (menu)

MISCELLANEOUS TOOLS .

 A set of tools is available to the SysOp. These tools are for manual or
automatic maintenance. In most cases, these tools should be handled with
caution, the process can be dangerous for the files.

 Avoid using those tools while the server is in operation (the F9 command, as
for an  example, in DosFBB),  because  the  modification  of  some  files  duri
operation can yield unpredictable corruptions.

Here is a list of the available tools:

FBBSETUP.EXE 
INSTWFBB.COM
INSTALL.SH
EPURMESS.COM 
EPURWP.COM 
LOGSTAT.EXE
SATUPDAT.EXE
SLEEP.COM 
MAKEPG.COM 
SETUSER.COM
CLEANUP.COM
MAINTINF.COM
CUT.COM 
FV.COM
ISDAY.COM
CLR_USER.COM

For LinFBB:
EPURMESS (works as EPURMESS.COM)
EPURWP   (works as EPURWP.COM)
FBB_VIEW (works as FV.COM, but takes no parametres)
FBB_ZM
XFBBC
FBB_VIEW







This page was last updated 

fbb-7.0.10/doc/html/fmtlang.htm0000644000175000017500000000447313613360505013136 00000000000000 FORMAT of LANGUE.SYS

LANGUE.SYS

LANGUE.SYS (\FBB\SYSTEM).

 This file is in the SYSTEM-directory. You do not need to change this file
for the first startups.

 First there are 3 numbers. The text in the file explains how to use them.

 Next there is a list of all available languages. These names must be the
same names as used in the .TXT and .HLP files in the directory called LANG.
So, there must be an ENGLISH.TXT and ENGLISH.HLP there, if ENGLISH is in
LANGUE.SYS file.

 After some comment-lines, there is a long list of prefixes, and the
corresponding number of language that each user will be presented with for
his first connect. The user himself, can change language later with OL-
command in the BBS.

 Remember, only the "Number in PC at the time" decides how much memory the
languages will use. All languages will be available anyway, but if more then
(in this case) 4 are in use at the same time, the BBS will swap the less used
language to disk, and load a new one from disk.

 #
 # File that decides what language each user will use in the first
 # connect. He can change language himself later...
 # All prefixes not listed here, will receive language no 1 (english).
 # 3 parametres :
 # How many languages - How many in PC at the time - Console-language.
 #
 17 4 1
 #
 ENGLISH
 NORSK
 NORSK8
 FRANCAIS
 SVENSKA
 SVENSKA8
 DANSK
 DANSK8
 SUOMI
 PORTUGUE
 ITALIANO
 DEUTSCH
 CATALA
 ESPAGNOL
 NEDERLAN
 RUSSE
 HRVATSKI
 #
 # 1 : English
 # 2 : Norwegian (7-bits)
 # 3 : Norwegian 8-bit
 # 4 : French
 # 5 : Swedish (7-bits)
 # 6 : Swedish 8-bit
 # 7 : Danish
 # 8 : Danish 8-bit
 # 9 : Finnish
 # 10: Portugues
 # 11: Italian
 # 12: German
 # 13: Catalan
 # 14: Spanish
 # 15: Dutch
 # 16: Russian
 # 17: Croatian
 #
 CT* 10
 CU* 10
 C3* 13
 DU* 1
 D* 12
 EI* 1
 E* 14
 F* 4
 9A* 17

 etc. etc.








This page was last updated 

fbb-7.0.10/doc/html/ftlock.htm0000644000175000017500000000320113613360505012754 00000000000000 LOCK-files (Appendix 31)

LOCK-files (.LCK)

(Appendix 31).

Added lock files when importing and exporting mail (same filename, extension added or replaced = "lck")

This means that while FBB is using MAIL.IN a file named MAIL.LCK exists.
In the same way, if a file named MAIL.LCK exists, FBB will delay MAIL.IN
This is to avoid conflicts between applications.


MAIL.LCK is not imported, it is only a (empty) temporary file which is used
as a flag.

When FBB imports MAIL.IN it does :

if MAIL.LCK exists
then begin
    do not import MAIL.IN
    if MAIL.LCK is older than one hour
    then begin
        delete (if possible) MAIL.LCK
    end
end
else begin
    create MAIL.LCK
    import MAIL.IN
    delete MAIL.LCK
end

this is checked every minute until MAIL.LCK no longer exist.

When FBB exports LA6CU.OUT, it does :

if LA6CU.LCK exists
then begin
    do not export LA6CU.OUT
    if LA6CU.LCK is older than one hour
    then begin
        delete (if possible) LA6CU.LCK
    end
end
else begin
    create LA6CU.LCK
    export LA6CU.OUT
    delete LA6CU.LCK
end

Another application should do the same to avoid conflicts.

Lock-files are deleted (if possible) after 1 hour.





This page was last updated 

fbb-7.0.10/doc/html/toolslee.htm0000644000175000017500000000133513613360505013326 00000000000000 Tool: SLEEP

SLEEP.COM

 Utility which spends the time (in seconds specified as argument) while doing
nothing. It can be interrupted by a Ctrl-C, and allows interruption of a
Batch file running.

 The syntax to call it is of the type :

 SLEEP nn

 nn is the number of seconds to wait.







This page was last updated 

fbb-7.0.10/doc/html/fmtinit.htm0000644000175000017500000003671713613360505013166 00000000000000 FORMAT of INIT.SRV

INIT.SRV


INIT.SRV (\FBB).


 This file is the next file that FBB looks into during startup. This file
will be found in the main FBB-directory. All basic data is collected from
this file. Use your standard ASCII-editor to edit the following lines:
(all lines starting with # are comments)

In WinFBB, INIT.SRV is created or updated with a small program called
INSTWFBB.COM.  This program may also be run inside WinFBB, when WinFBB is
running, by clicking on Config at the top of the screen.

In LinFBB, INIT.SRV is created or updated with a small program called
INSTALL.SH.

In DosFBB, INIT.SRV is created or updated with a small program called
FBBSETUP.EXE.


This program is organized as pages of menus, and you can edit or change any
topic in your configuration. It is no longer necessary to edit the INIT.SRV
file manually.

 The version of the software is now indicated in the first comment line. This
will allow further automatic updates.


 # FBB7.00
 #
 # Callsign and H-address (Do not include SSID !)
 LA1B.#BRG.NOR.EU
 #
 # SSID for the BBS
 0
 #
 # Qra locator
 JP20RH
 #
 # Qth (variable $c)
 Bergen
 #


 In the above lines you must replace the callsign and H-address with your own
BBS-call and H-address. You also must replace the SSID, that is the number
after the callsign. In LA1B-6, the 6 is the SSID. If you do not want any
SSID, type 0 here. You also must replace the QRA-locator with your own
locator (ask some other ham for help on this, if you don't know the BBSs QRA-
locator. Do NOT use the value from this example-file ! You also must replace
the QTH (don't make it too long...). If the QTH-name is short, you might add
the QRA-locator here too, like I have done.

 Next we have some filenames and path-names. These filenames and paths are
the same as used in the installation-procedure. If you did no changes in this
during installation, you will not need to change any of these now. 
Note the syntax, and note that directory-names MUST end with a \


 # Directory for files used by the BBS
 C:\fbb\system\
 #
 # Directory for messages
 C:\fbb\MAIL\
 #
 # Directory for binary-messages
 C:\FBB\BINMAIL\
 #
 # Directory for users DOS
 # Up to 8 drives may be specified, starting with drive A:
 # In this example drive A and B are not used, and therefore replaced
 # by a * each.
 *,*,C:\fbb\users\,*,*,*,*,*
 #
 # Directory for Yapp-files
 C:\fbb\users\yapp\
 #
 # Directory for DOCS
 C:\FBB\DOCS\
 #

 That was not so difficult ?

 Next, check the first-name of sysop, and the callsign of sysop.  Here are
MINE :

 # First-name of sysop
 Per
 #
 # Sysops callsign
 LA6CU
 #

 In the following line you CAN (not necessary) replace the ***** with a
callsign. If you do, that callsign will receive a copy of all SYSOP-messages
that arrives. You might want to put your own callsign there.
You may also include more than one callsign, separated by space.

 # Callsign (and route if needed) that shall have copy of messages
 # addressed to SYSOP
 # (*** for no copy, FD1CDC@FD1CDC.FMLR.FRA.EU if route)
 *****
 #

 No need to change this:

 # Path and filename for import-file
 \FBB\MAIL.in
 #

 Here you must first write the code for the kind of monitor you use, and then
you must have a number for how many minutes you want before the screen should
go blank, after no activity on the keyboard. In this example I have a CGA-
monitor, and my screen will go blank after 5 minutes since I last touched the
keyboard.

 # Type video:0=CGA, 1=EGA, 2=VGA Time before screen-blank.
 #
 0 5
 #

 Complete log gives you a log-file for every week. If you write NO here, no
log-file will be made. The log-file will appear in the directory named LOG.
Direct video uses fast BIOS-calls if you answer OK. If you plan to use
Desqview or Windows (with DosFBB, that is..), you must change it to NO. 
Indication of channels will normally be OK (that means that monitored 
information on screen will be more complete, with callsign of user before
every frame from each user, etc).


 # Complete log (OK or NO)
 OK
 #
 # Direct video (OK or NO)
 OK
 #
 # Indication of channels
 OK
 #

 Next we have Test Mode (NO - OK). If you type OK, the BBS will start, but
will not access the TNC(s). Use this the first times, to make sure that
everything works fine. When you are sure that all is well, connect the TNC(s)
and change this to NO. Restart the FBB, and now the TNCs will be used, as
normal.

 # Test-Mode (NO - OK)
 OK
 #

 Forward type FBB is faster and more efficient than standard MBL-type
forward. Use this whenever possible (OK). If you type NO, FBB-type forward
will not be allowed.  You may also use a parametre after OK/YES from this
list (add the ones you want):
  1  : A space is mandatory before the @ in a send message command
  2  : The length of the fields of a hierarchical address is not 
       tested to be 6 characters
  4  : The header line of a message is not truncated to the space before
       the 79th character
  8  : Header MBL/RLI
  16 : If there is no BBS field, the callsign of the BBS is sent to the PMS
  32 : Deletes the DATA messages sent to SYSOP
  64 : Don't use the BID recovered from headers and use a new one
  128: Accepts forwarding only from pre-declared BBS
  256: WP Messages are not held.
  512: XForwarding protocol has priority on FBB protocol.
 1024: Generation of an alternate BID like F6FBB-12345 (for dual BBS site)
 2048: Checksum unvalidated on XFwd.
 4096: Test of callsigns is less strict.  Allows all "callsign" as long as
       they have one figure (0-9) anywhere in the callsign.

 # Use (when possible) forward type FBB
 OK
 #

(or, you may include a numer, like     OK 2048     or whatever..)

 The same goes for compressed forward. Compressed forward
is very much faster, and should always be used. 
Parametre after "use compressed forwarding" give the options between 
compressed protocols :
1 = FBB compressed forwarding
2 = XFWD compressed forwarding
"OK 3"    allow both FBB and XFWD.

 # Use (when possible) compressed forward
 OK 3
 #

 Hroute update validation. If you type OK, the HROUTE look-up will be
validated. This takes some tens KB of memory. A route without hierarchical
extension will be changed to hierarchical route if found in the HROUTE.SYS
database. This  database  is  automatically  updated  while  receiving  
headers.

 # HROUTE look-up and database update validation
 OK
 #

 Information query. This ensures that the user will give his information.
This will be helpful for the update of the white pages database. If "OK",
the user will prompted until he answers to the queries.

 # User MUST give Name, HomeBBS, Qth and ZIPcode
 OK
 #

 Next we have 'Masque'. This is a default value that is given to all new
users when they log on the BBS for the FIRST TIME. Select the things you want
for all new users, and the values for them. If you f.ex. want all new users
to get Paging, and be in Guest mode, add 32 and 64, and put the result 96 in
the file. If you want none of the things listed here, put in a 0. The "see-
all_mail" mask will be active only if the user has the "read-all-messages"
security code (see behind).

 # First connection mask.
 # 0   : disable mask.
 # 1   : Excluded.
 # 2   : Local.
 # 4   : Expert.
 # 8   : Sysop.
 # 16  : BBS.
 # 32  : Pagination on
 # 64  : Guest.
 # 128 : Modem.
 # 256 : List/read all personal messages
 # 512 : Request for unproto beacon-lists allowed
 # 1024: Get list of new messages at each connect
 # Add up the values for your choices.
 1568
 #

 Next we have 'Security-codes'. Here we give 3 values. The first
 says what ALL users are allowed to do. The next says what sysops
 are allowed to do when they connect the BBS, and the third says
 what a sysop is allowed to do after he has successfully performed
 the SYS-command. The same applies here as above; choose the
 values you want and add them up.

 # Security-codes.
 # All users can:
 # 1  : Read all messages, including all personal messages.
 # 2  : Kill all messages.
 # 4  : Send SYS-command.
 # 8  : Use remote-sysop commands (edit, forward etc).
 # 16 : Edit labels in YAPP, FBBDOS, DOC.
 # 32 : Can delete files in YAPP and FBBDOS.
 # 64 : Have access to all gateways.
 # 128: Run dos-programs (command DOS in FBBDOS).
 # 256: Have access to the entire hard-disk.
 # 512: Have access to command /A (stop BBS) and /R (reboot PC).
 #
 # All: Sysop: Sysop after successful SYS-command:
   0    127    1023
#

Next we have warning-messages to sysop (mask):

 # 1   : Less than 1MB in disk
 # 2   : Error in system file (FORWARD, BBS, REJECT...)
 # 4   : Server error/warning
 # 8   : Ping-Pong warning
 # 16  : No-route warning
 # 32  : No NTS warning
 # 64  : Message file not found
 # 128 : Error in proposal
 # 256 : Message rejected in remote BBS
 # 512 : Message held in remote BBS
1023

 Next we have the time for cleanup of messages. This should be done in a low-
traffic hour, as the BBS is completely shut down during cleanup. Type also
the timeout-values you want, the default values here should be OK. Put also
in the number of hours (+ or -) between the PCs local-time and UTC.

 # Time (hour) for cleanup of messages
 # (Forced disconnection of all links at housekeeping time+15 min.)
 02
 #
 #
 # Time-out for normal use (minutes) and during forward (minutes)
 15 5
 #

 Max download-size (pr period) for Yapp and via modem, in kbytes.  0 0 will
disable it
 #
 100 500
 #

 # Hours +/- in relation to UTC
 0
 #

 Type how many callsigns you want (maximum) in each mail-beacon (variable
$Q). If you precede the number by a B, also bulletins to local users (type BN
or BY) will be broadcast in the mail-beacon. Like this:

 # Number of callsigns in mail-beacon
 B20
 #

 Number of lines in scroll-buffer may be changed. Just remember that they use
a lot of memory (each line takes 160 bytes of memory, but can be in high
memory), so I advice you to use these values:

 # Number of lines in scroll-buffer
 # User Console Monitoring
 1000    1000     1000
 #

 Leave this one alone:

 # Text for forward-header (variables OK), appears LAST in the R:line.
 # Please do not change the contents and the order of the fields except
 # the FBB$E field which is only an information and can be removed.
 # $c is the QTH as declared before in this file.
 [$c] FBB$E $$:$R
 #

 Next you must decide how many BIDs to keep. 
For WinFBB and LinFBB:  Normally you will have enough memory.  So you may
use the max. However, I found 10000 to be a good value.
For DosFBB: Depending on how much memory you have.  3000 is a good value,
but 10000 is better (hi).  

 # How many BIDs are saved (32000 max)
 3000
 #

 Leave the next one alone. This one means that bulletins that are older 
than (in this case) 30 days, will not be forwarded again from my BBS, and
will go directly to X-status. Be aware: a too low value here will cause 
problems for other BBSs that you forward to..

 # Lifetime for bulletins. Number of days from message is written
 30
 #

You should answer 1 for memory-cache, followed by the list of topics you 
want to load into memory. The BBS will do these operations very 
much faster.

 #
 # Use memory-cache ? 0=No, 1=Yes (preferred).
 # and optional list of topics to put in memory-cache
 #
 # Topics : BID = Bulletins or messages identifiers
 #          MSG = Message lists
 #          HIE = Hierarchical information
 #          SCR = Screen buffers
 #          WPG = White Pages database
 #          REJ = Reject/hold information
 #          FWD = Forwarding information
 #
 1 BID MSG WPG HIE SCR REJ FWD
 #

 List of routes to send WP update messages. First, keep this line blank until
you have a WP network available, then give the route(s) to send your updates.


 # List of routes to send WP messages
 #
 LA1B LA6CU
 #

 Zip code of the BBS. Give the post code area where is the BBS. Mandatory.

 # ZipCode of the BBS
 #
 31120
 #

 Here you will give the parameters allowing the list of messages in unproto
mode. This list can be interpreted by some terminal softwares (as TPK) and
greatly reduce the traffic on the local frequency.
 The first parameter is the maximum backward number. If a unproto user asks a
list which is lower than this number backward, he will be limited to this
parameter (IE: if the current message number is 20000 and a user asks the
list of the message 15000, he will be then limited to the 19500 if the
backward number is 500).
 The second parameter is the speed of the unproto updates given in seconds.
The frames will be sent with this period.
 The third parametre(s) have this meaning:
A = ACK messages
V = transit private messages
P = end-user private mail
M = subject is replaced by stars in private mail
    (Bulletins are always displayed)
Any unauthorized message will be unproto like
12345 #

 #
 500 5 VPA
 #

 Leave this lines alone, unless you are absolutely sure you want to change
it:

 # DRSI and TFPC interrupt (Hexadecimal, default FF and FE)
FF FE

 Then you have two optional programs of batches which are called at the end
of the initialization, and just before shutdown. If you don't need them, keep
these lines empty.


 #
 # BBS-UP program (default empty)

 #
 # BBS-DW program (default empty)

 #

 You can change these colours if you like:

 # Colour on texts :
 #
 # Black      : 0      Dark grey     : 8
 # Blue       : 1      Light blue    : 9
 # Green      : 2      Light green   : 10
 # Cyan       : 3      Light cyan    : 11
 # Red        : 4      Light red     : 12
 # Magenta    : 5      Light magenta : 13
 # Brown      : 6      Yellow        : 14
 # Light grey : 7      White         : 15
 #
 #
 # COULEUR FONDS
 #
 # Status (top)
 1
 # Bandeau (middle)
 7
 # Text (bottom)
 0
 # Menus
 4
 #
 # Colour of characters
 #
 # Status (top)
 7
 # Bandeau (middle)
 1
 # Menus
 14
 # Text sent
 10
 # Text received
 12
 # UI (Headers)
 15
 # UI (traffic)
 7
 # Console
 14
 # Beacon
 6
 # Channel-marking
 11
 #

 You may change these lines if you like. These are the servers that are
normally available in most FBB-BBSs, and they are automatically installed for
you from the diskettes. So you can leave them alone. Or you can disable them
with a # in front of each of these lines.

 Two built-in servers already exist, but you MUST declare them in this file
to make them available. As they are built-in, the program-name MUST be
replaced with stars.

 -----------
 # List of "servers" :
 #
 # To Program-name Description
 #
 REQCFG ****** Request configuration
 WP     ****** WP server
 REQDIR REQDIR Request directory-listings from other BBSs.
 REQFIL REQFIL Request files from other BBSs.
 NEWDOC NEWDOC Upgrade files under DOCS.
 ------
 #
 # End of file
 #

 Ok. That was the INIT.SRV file. This file is VERY important, so check and
double-check to make sure that you have it all OK.  The best way to check
it, is by using INSTWFBB for WinFBB, INSTALL.SH for LinFBB or 
FBBSETUP for DosFBB.







This page was last updated 

fbb-7.0.10/doc/html/toollgst.htm0000644000175000017500000001601713613360505013352 00000000000000 Tool: LOGSTAT

LOGSTAT.EXE

 Statistical analysis software for the FBBLOG file written by FC1MVP.

 The configuration file for this software is in the text file LOGFBB.CNF,
which should be located in the same directory.

 LOGFBB.CNF file layout :

 This file is made of several lines indicating:

 - BBS Callsign
 - the name of the SysOp port, a comment.
 - The abbreviated name of the 1st port, a comment.
 - The abbreviated name of the 2nd port, a comment.
 - and so on until the last port (8 ports maximum).
 - Three stars (***) at the beginning of the line means the end of the ports.
 - The BIOS screen access option.

 The BBS callsign must have 6 characters maximum. It will be truncated should
it be longer.

 The abbreviated port name may have up to 10 characters, it is recommended to
limit at 4 (ex VHF1 or HF2).

 A comma separates the abbreviated name from the comment which follows it,
without any space. The comment may have 10 characters too (frequency).

 At the end of the comment, it is possible to add a comment which is internal
to the CNF file, and which will not be used elsewhere, using the ":" as a
separation.

 If the BIOS line has a NON at the beginning, the screen access will be
direct. The word OUI means that the screen access is made via the BIOS. The
direct access improves the processing speed by 50 percent but is careless
with DesqView.

 Example of LOGFBB.CNF file:

 F6FBB : BBS name.
 SYSOP,at keyboard : port name @ , comment.
 VHF, 144.675 : Port A , comment.
 VHF, 145.275 : Port B , comment.
 UHF, 430.675 : Port C , comment.
 HF, 21.107 : Port D , comment.
 SHF, 1299,675 : Port E , comment.
 MODEM, Telefone : Port F , comment.
 *** End of ports definition.
 NON : Screen access through BIOS (OUI) or
 Direct (NON).

 Software limitations :

 The software is able to handle a log file within the following limits:

 - Maximum number of days : 35, or 5 weeks if you chain 5 log files.

 - Maximum number of channels: 50

  - Maximum number of ports : 8+1, corresponding to ports A to H handled by
the BBS and the SysOp keyboard "port".

 - Maximum nr of callsigns : 300 (This is not the number of the call signs
known by the BBS, but the number of calls which were used the BBS during the
log period.

 In case an overflow occurs, the mention AUTRES for the callsign and 99 for
the day will be displayed in the corresponding areas.

 Regarding the forward efficiency, only the stations which have actually
forwarded will be given a value, the others will be mentioned "nc".

Usage :

 On the same diskette (or the same disk) there should be at least the program
LOGSTAT.EXE, the config file LOGFBB.CNF and enough disk free space for the
result files to be created. The log file may stay on another diskette.

 For the startup you should type in LOGSTAT FBBLOG.nn (nn is the number of
the week) or A:FBBLOG.nn (if the file is located on A:)

 The results are recorded into the files LOG.@, LOG.A ... LOG.T being the
total of the logs.

Archiving :

 A suggestion: you should better archive your FBBLOG.nn file rather than the
LOG.x files. You should ZIP them (or ARC or LZH) with the name LOG990nn.ZIP
(.ARC or .LZH) with 990 standing for 1990 (000 will be for 2000...) and nn is
the number of the week.

Log structure :

 The number of resulting files created is equal to the number of ports of the
BBS plus 2. The 2 supplementary files correspond to the console port and the
sum of the various ports as being the total result.

 The first log, named LOG.@ corresponds to the SysOp log (console), the last
one, named LOG.T is the summation of the ports. The files LOG.A to LOG.H are
the logs of the various ports.

 Obviously, if a port has not been used, the corresponding file will not be
created.

 For each LOG.x file, you find in the following order:

 - Diary of the connections per day (y-axix) and the time (x-axix) with the
daily total at the end of the line and the hourly total at the bottom of each
column.

 - The total connection time: it is the sum of the connection times of each
user. For the LOG.T file, the total connection time per channel will also be
given.

 - Mean time per connection : this is the total connection time divided by
the number of connections.

 - Mean time per user : total connection time divided by the number of users.

 - Number of killed messages : self explanatory.

 - Number of read messages : idem.

 - Number of users.

 - A matrix of forwarded messages per day (y-axix) and per hour (x-axix) is
made like before. This matrix will not appear if there has not been at least
one forward on this port.

 - Number of forwarded messages: number of messages sent to another BBS or
PMS.

 - Number of messages received in forward: number of messages transmitted by
other BBS in forward.

 - Number of messages received in back-forward: number of messages received
from another BBS when forwarding towards it.

 - Number of messages refused as already received.

 - An array giving the number and the size of the messages received from or
sent to another BBS and the efficiency in Bits/s (Max 1200 !).

 The BBS's are sorted by alphanumeric order, and the efficiency indication
appears for callsigns having conducted only forwarding operations. This
matrix will not appear unless there has been at least one BBS forwarded.

 - A matrix of the main functions utilized, with on the y-axix the callsigns
sorted by alphabetical order, and on the x-axis the total time of connections
in minutes, the number of connections, and the various functions used (see
the comment following the array).

 In the LOG.T file, the X.F column (forced disconnection entered by the
SysOp) is replaced by the number of killing commands. At the end of each
column is the compound sum.

Log of a specific station.

 - The LOGCALL program yields generation of a log for a specific station

 The principle of operation is the same as for LOGSTAT, except that a
supplementary calling parameter is required to define the station.

 LOGCALL FBBLOG.33 FE1ZZZ

 The generated file will be of the same format as the FBBLOG, but it will
enclose only the lines specific to the callsign. The name of the file will
match the format FE1ZZZ.LOG, if the requested callsign is FE1ZZZ.

 While executing LOGSTAT FE1ZZZ.LOG, you will have the statistics related to
that station (in the LOG.A, LOG.B,...).

 If you specify the SSID, you will create a log corresponding only to the
callsign and the specified SSID. Ex:

 LOGCALL FBBLOG.33 FE1ZZZ-2

 Editing the file FE1ZZZ.LOG will allow you to display all the commands sent
by that station.






This page was last updated 

fbb-7.0.10/doc/html/toolclea.htm0000644000175000017500000000147113613360505013303 00000000000000 Tool: CLEANUP

CLEANUP.COM

 Utility killing all messages files unused and not defined in DIRMES.SYS.
This program should be run in the SYSTEM directory.

 The syntax is of the type :

 CLEANUP mail_directory

 Be careful when using this utility. If another directory than MAIL or
BINMAIL is specified, it should delete all the files of the directory.






This page was last updated 

fbb-7.0.10/doc/html/docrecme.htm0000644000175000017500000000533413613360505013264 00000000000000 Recording a message (Appendix 7)

Recording a message.

(Appendix 7)

 A message can be left by a user or within a forwarding connection. The
recording mechanism is always the same.

 The recording command is always like :

 Sx desti @ bbs < exped $ ident + filename

 Only recipient field is mandatory, all other fields are optional.

 Appending a filename is a possibility reserved to the sysop. The name must
be complete, including logic unit and complete path (C:\FBB\SYSTEM\TEST.TXT).

 When receiving the command line, a first test checks if a route exists when
a route has been specified, or if the message must be automatically routed
when no route was specified.

 The title of the message is then asked to the user.

 If the title is a missing, the message is canceled and the user returns to
the main menu.

 The text of the message is then asked to the user.

 The software checks possible preamble lines. These lines give information
on the previous BBS having routed this message. They all begin by R: on first
column. The BBS callsign is given behind the @ character within the preamble
line. All adjacent BBS mentioned in this preamble will be included in the
"already forwarded" list, and will not be concerned by this message. This
list specific to each message can be displayed with the $ or FN command
followed by the message number.

 When receiving a /EX in first column, or a Ctrl Z, a message number is then
assigned, The BID (or MID if private) and the list of adjacent BBS concerned
by this message are created. All these information are sent to the user when
acknowledging the message.

 In case of disconnection before the /EX or Ctrl Z, the whole message will be
lost, and the texts already stored are deleted.

 All information about the message (sender, recipient, route, MID, title,
etc...) are stored in the DIRMES.SYS file. The text of the message is stored
in a sub-directory of the MAIL directory. The sub-directory is MAILn where n
is the last digit of the message number. The name of the file corresponds to
the message number 123 is M_000123.MES, the number is 6 digits wide, in this
case it is in the sub-directory MAIL3.

 The message number uses a long integer (32 bits), the number boundary is
very far (more than 4 billions !).







This page was last updated 

fbb-7.0.10/doc/html/fmt_afro.htm0000644000175000017500000001400113613360505013267 00000000000000 Drivers and phone-modem

Async port drivers and telephone modem.

You may need several external drivers for your BBS.  

For WinFBB:
FBBCOMM.DRV
BPQ

For LinFBB:
AF_AX25 domain socket  
AF_NETROM domain socket
AF_ROSE domain socket  
It is necessary to compile the Linux Kernel with SLIP (serial line).

For DosFBB:
ESS.COM 
ESSKAM.COM
FBBIOS.COM 
BPQ
TFPCX/TFPCR

Installation of a TELEPHONE MODEM. 


FBBCOMM.DRV:  (Only for WinFBB)

The port-driver FBBCOMM.DRV is installed in Windows during the installation-
process of WinFBB.  

FBBCOMM.DRV is automatically installed in your Windows as you install WinFBB
from the diskette.  So there is nothing for you to do.  The driver is 
automatically installed into your SYSTEM.INI in the [boot] section as 
comm.drv=fbbcomm.drv.  If in doubt, you may want to check this.


ESS.COM:       (Only for DosFBB)

 ESS is an async port driver optimized for FBB software. It can drive either
TNC2/PK232/clones or KAM.

 This small device driver is loaded as resident at the beginning of the
machine initialization (TSR).

 One ESS handles one serial line and makes use of one IRQ.

 The COM number, the address of the serial interface and the IRQ number are
given as parameters appended to the command line. The address should be given
as a FOUR digit hex number.

 Example : Install ESS for COM1 at hex 03F8 and using IRQ 4 :
 ESS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus ESS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device in the machine. On a PC the IRQ's can not usually be
shared.

 Should there be more than one port to handle, several ESS can be cascaded.
The IRQ should be different for each ESS, except for the case in which the
interrupt sharing is supported by the serial card used.

 Example :

 ESS 1 03F8 4
 ESS 2 02F8 3

 This sequence will load ESS's for COM1 and COM2.

 ESS accommodates also the muxing arrangement of serial ports.

 Version 1.08 of ESS-driver (included with DosFBB distribution)
 must be used with the MUX ! 


ESSKAM.COM:    (Only for DosFBB)

ESSKAM works exactly as ESS.COM, but only for Kantronics Kam TNCs.


FBBIOS.COM:    (Only for DosFBB)

 FBBIOS is a serial line driver dedicated to the usage of a PSTN modem.
Binary as well as ASCII file transfer are supported with the XMODEM protocol.

 FBBIOS handles one serial line, one IRQ is required. The COM number, the
address of the serial interface and the IRQ number are given as parameters
appended to the command line, the address should be specified in FOUR hex
digits.

 Example : Install FBBIOS for COM1 at hex 03F8 and using IRQ 4 :
 FBBIOS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus FBBIOS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device.

 On a PC the IRQ's can not usually be shared.

 If the modem in use is at the HAYES standard, FBBIOS can modify the line
speed according to the one of the incoming call connection. In this case the
parameter 'A' should be appended to the command line to activate this
feature. This is not true with some buffered modems using a junction with a
settled speed.

 Example : FBBIOS 1 03F8 4 A

 Upon receipt of the string CONNECT 1200 or CONNECT 2400, the driver will
adjust its speed to the incoming call.

 From version 1.30, FBBIOS.COM can run up to 56 KBauds. Be sure that your
computer is fast enough !


AF_AX25 domain socket    (More in appendix 23)
  AF_NETROM domain socket  (More in appendix 23)
  AF_ROSE domain socket    (More in appendix 23)
  (Only for LinFBB)

Standard kernel AF_AX25, AF_NETROM and AF_ROSE sockets
AX.25, NET/ROM and ROSE protocol are built into the Linux kernel.

I recommend to use these interfaces, because it will give you
more flexibility to build a system with many futures..






This page was last updated 

fbb-7.0.10/doc/html/docqthlo.htm0000644000175000017500000000326113613360505013315 00000000000000 QTH-locator server

QTH-locator server.

 The QTH locator is made of 2 letters, 2 figures, and 2 letters yielding the
geographical coordinates of a station. You can translate the QTH locator into
Longitude/Latitude or vice-versa, compute the distance and azimuth between two
QTH  locator  or  compute  your  Log-Sheets  for  contests  
(adding together distances).


Q : Converts one QTH Locator into Longitude and Latitude. The West longitude
    and North latitude are given in degrees minutes, or grades.

D : Distance and Azimuth computation between two QTH Locators.
    Computation of the distance and azimuth between two QTH Locators. The
    distance is given in Kilometers and the azimuth in degrees.

C : Computation of the distance and azimuth between two QTH Locators. 
    The distance is given in Kilometers and the azimuth in degrees.

L : Converts the Longitude and Latitude into QTH Locator. The west longitude
    and north latitude can be given in degrees, degrees minutes,
    or grades.

F : Switches back to the Server main menu.
B : Quit and Disconnect.







This page was last updated 

fbb-7.0.10/doc/html/docbbs.htm0000644000175000017500000003406313613360505012740 00000000000000 BBS commands

BBS COMMANDS.


Here is an overview of what the BBS-commands do:

? :
 Reading the help file. Type  ?[COMMAND]  to obtain help on a basic
command.

> :

 "Break" between channels. Type   > [CALLSIGN] [TEXT]  to send a text to a
connected callsign on another channel. The BBS will advice you that the text
has been delivered. This text cannot be longer than one line.
This command is not allowed in read-only mode.

= :
 Connection between two channels. Type  = [CALLSIGN] to get connected to a
callsign on another channel. The callsign can be connected only if it is not
busy in a command; the BBS should be idle (waiting for a command). If the
callsign is not available, you may either wait or you may cancel your 
request. The callsign currently busy in forwarding tasks cannot be 
connected. Use Ctrl-Z to leave this mode.
This command is not allowed in read-only mode.

! : Provide a short and minimal information on the BBS usage.

% : Use this command to see the status of all channels right now.

A : Abort the BBS output at any time.
    When reading messages with paging, the commands N and C are available, too.
    Use N to skip the reading of the rest of current message, and start on the
    next message.
    Use C to read the rest of the message(s) without paging. 

B or Bye :
     Disconnects the BBS.  Note that the "last listed" parametre is updated.
    When the user does a "hard disconnect", the last-listed parametre is
    NOT updated.

C : Enters the conference mode, multiconnection. 
CW: Shows a list of the callsigns involved in the current conference.

D :
 Invokes the FBBDOS, or receives a file from the BBS if the command is followed
by a file name.

F : Switches to Server mode, and access to special commands.

G : Accesses the Gateway mode, if gateway is allowed in the BBS.

H : Shows short help.  For help with specific commands, see the ? command.

I :
 Information about this BBS. This command displays the file FRANCAIS.INF (or
another language depending upon the configuration and the language attributed
to the involved channel).

I callsign :
 Gives the information on callsign taken from the white pages database.
Callsign can include wildcards.

ID : Shows how many records there are in the WP database.

I@ bbs : Gives the users of BBS found in the  WP database.

IH route :
 Gives the users of the hierarchical route area from  WP database 
(wildcards allowed).

IZ Zip :
 Gives the users of the ZIP code area from WP database (wildcards are
allowed).

J-commands list the callsigns heard by or connected on the BBS.
JK : Shows the last 20 connected callsigns.
JA : Connected callsigns on port A.
JB : Connected callsigns on port B, etc...
J1 : Heard callsigns on port A.
J2 : Heard callsigns on port B, etc...

K-commands delete messages sent by you or to you.
K msg# : Deletes a message identified by its number.
KM     : Deletes all the messages addressed to you, that you don't yet 
         read. The messages not read will not be deleted.

L : Lists the new messages since the last usage of this command.

LA : List messages with status A.

LB : Lists bulletins.

LC [mask] : 
 List the messages which "TO" filed matches with mask. * (star) allows to
list all the messages and should be the default value. Type "LC *" to see
all messages. LC alone gives the current mask. Mask is recorded for each
user while disconnecting.

LD> YYMMDD : Lists the messages received after the specified date.

LD< YYMMDD : Lists the messages received before the specified date.

LE : List messages that could not be forwarded.

LF : List FORWARDED messages.  

LH : List HELD messages.

LK : List KILLED messages.      

LM : Lists the messages TO YOU.

LN : Lists the NEW messages TO YOU.

LP : List PRIVATE messages.    

LU : Lists all unread messages to/from the user.

LX : List messages with status X.

LY : List messages that have been read (status Y).

LL 10: Lists the last 10 messages.

LR : Equivalent to L but the messages are listed in reverse order.

LS text : 
 Searches for a text in the messages titles. Usage of wildcards is allowed.

LT : List Traffic (for NTS-messages).

L$ : List bulletins with status $.

L< Callsign :
 Lists the message originated from [Callsign]. The wildcards are allowed.

L> Callsign :
 Lists the messages destinated to [Callsign]. Wildcards are allowed.

L@ [BBS] :
 Lists the messages VIA BBS if specified. L@ alone lists the message without
route. The wildcards are allowed.

L msg#- : Lists all messages, starting from msg#

L msg#-msg# : Lists messages between the given numbers.

M msg# File :
 Transfers the text of the message msg# to the file File. This file will be
placed in the directory USERS or from the root in case of a SYSOP user.

MH msg# File : Identical, but the format is the R command.

MV msg# File : Identical, but the format is the V command.

MA msg# File :
 Transfers the text of the message msg# to the file File. This file will be
placed in the directory USERS or from the root in case of a SYSOP user. The
message is appended to the existing file.

MHA msg# File :
 Identical, but the format is the R command. The message is appended to the
file.

MVA msg# File :
 Identical, but the format is the V command. The message is appended to the
file.

N : Enters or modifies the name (max 12 characters allowed).

NH :
 Enters or modifies the Home BBS. A point deletes the current Home BBS.

NL : Enters or modifies the QRA locator.

NP : Modifies the password for the access via telephone modem.

NQ : Enters or modifies the city (Qth).

NZ : Enters or modifies the Zip Code.

O : Displays the setting of various options.

OL : Lists the available languages.

OL number : Selects a language.

ON :  Shows the number-base for messages.  See also ON number below.

ON number :
 Defines the number of the thousand base for the messages. Example: ON 37
defines number 37000 as being the base for numbering the messages. Then the
command R 25 will cause the message 37025 to be read, although R 36025 will
actually read the message nr 36025.

OP : Validates or disables the scrolling of pages.

OP nbr of lines : Initializes the page scrolling

OR :
 Validates or disables the ability to list all messages, if the user has 
access to the whole list of messages by default (See security code 256 of
INIT.SRV).

PG [program]:
 PG alone gives the list of PG programs available in the BBS. If followed by
a program name gives the control to this program. The PG program can also be
called by its name. If the name is the same that an existing command, the
existing command will be replaced with the PG program.

PS : Gives the list of servers available in the BBS.

R-commands are for reading messages.  Note:
When reading messages with paging, the commands N and C are available, too.
Use N to skip the reading of the rest of current message, and start on the
next message.
Use C to read the rest of the message(s) without paging. 

R msg# msg# : Reads the messages by their numbers.

RM : Reads all the messages to you.

RN : Reads all the NEW messages to you.

RU : Read all unread messages to/from you.

R> callsign : Read all messages to a callsign.

R< callsign : Read all messages from a callsign.

S[type] callsign :
 Sends a message or a bulletin. If the type is not specified, it will be
processed as a private, provided the destination callsign is a valid one,
otherwise it will be considered as a bulletin.

SP callsign : Sends a private message.

S callsign @ BBSCALLSIGN :
 Sends  a  message  to  a  station  AT  another  BBS  through forward.
BBSCALLSIGN  can  be  an  address  of  hierarchical  type,  for example
F6FBB.FRA.EU. Type "SB ALL" to send a bulletin addressed to ALL. The
message must be terminated by a Ctl Z or /EX followed by a return. Warning:
the /EX must be in the first column.

SC Msg# Callsign @ BBSCALLSIGN :
 Copies a message or bulletin to the specified callsign. Such a copy will
always be of the "personal" type.

SR [Msg# [title]] :
 Replies to a message already read or formerly suppressed, or to a message
matching the specified number. If the title is not stated, it will be the
title of the read message, with the mention "Re:" placed ahead.

T :
 Pages the SysOp. Should the SysOp not be available within a minute, you
will be advised accordingly and automatically returned to the normal BBS
menu.

TH : Gives access to the themes-zone.  Lists messages by themes, as setup
     in the file THEMES.SYS.  Available commands in this zone, are
     H (list themes)
     L (list messages in current theme)
     R msg# (read message in current theme)
     number (change to theme#)
U :
 Uploads a file from the user to the server of the BBS. The file will be
written in the root directory of the FBBDOS. The U command is to be typed
at the BBS prompt, it is not necessary to go to FBBDOS first.

V :
 Version number of this BBS software. It gives also the number of active
messages, and the next message number.

V msg# msg# :
 Reads the messages by their numbers, including the headers.

VM : Reads all the messages TO you, including the headers.

VN : Reads all the NEW messages TO you, including the headers.

W :
 Lists the files which are within the user directory. This command can be
followed by a mask specifying search criteria or a directory name; in the
latter case, the directory contents will be listed.

X :
 Toggles "normal" or "expert" status. "Normal" grants the extended menus,
"expert" provides only minimal information.

Y :
 Binary transfer program using the YAPP protocol. As a user, you should also
have the YAPP protocol available your end, in order to be able to transfer
binary data.

YD File : Downloads a file FROM the BBS TO you.

YI [mask] : Lists the available binary files, and their description.

YN [mask] : Lists the NEW binary files since your last connection.

YU File :
 Uploads a binary file from you TO the BBS. You cannot replace or
modify an already existing file.

YW [mask] : Lists the available binary files.

YZ Filename : Deletes the specified filename in the YAPP directory.

Z Filename : Deletes the specified filename in the user directory.






This page was last updated 

fbb-7.0.10/doc/html/tlfbb_zm.htm0000644000175000017500000000167013613360505013301 00000000000000 FBB_ZM

FBB_ZM

(Only for LinFBB)

Documentation for FBB_ZM

This utility is for sending and receiving
files with ZMODEM , YMODEM or XMODEM protocol.

Receive file(s): fbb_zm [ rz | rb | rx ]

where:
 rz = Receive file with ZMODEM
 rb = Receive file with YMODEM
 rx = Receive file with XMODEM

Sending file(s): fbb_zm [ sz | sb | sx ] file(s)...

where:
 sz = Send file with ZMODEM
 sb = Send file with YMODEM
 sx = Send file with XMODEM








This page was last updated 

fbb-7.0.10/doc/html/toolepum.htm0000644000175000017500000001060613613360505013345 00000000000000 Tool: EPURMESS

EPURMESS.COM

EPURMESS is a tool which allows for modification of messages: status,

removal, or archiving. This tool is called every night by the BBS in order to
maintain the message list as a function of the time.

 The EPURMESS configuration is made by the text file EPURMESS.INI. The
parameters which are contained are given as a suggestion, and can be edited
later if needed, to suit the targeted archiving and the mass of messages and
bulletins received.

 EPURMESS searches the current directory for its EPURMESS.INI initialization
file. In that file, it will find out all the parameters for processing, as
well as the file name for the report EPURMESS.RES (this file name can be
changed in the EPURMESS.INI file).

 At the beginning of the process, EPURMESS first copies DIRMES.SYS into
DIRMES.OLD to keep an archive trace of the previous file, then creates
DIRMES.NEW, in which the processing will take place. At the end of the
process,  DIRMES.NEW  will  be  copied  into  DIRMES.SYS.  A  report of the
processing will be written in the EPURMESS.RES file.

 If the last update of the DIRMES.SYS file has been carried out more than 24
hours ago, EPURMESS will not make its process, in order to avoid any loss of
data due to a possible clock error in the system. It will report the error in
the EPURMESS.RES file. In such a case, after the reason of the error has been
detected, it will be necessary to suppress the EPURMESS.RES report file, in
order to re-enable the processing.

 The ARCHIVE line has two digits, the first one applies to private messages
and the second to bulletins. The '1' digit validate the archiving while the
'0' will suppress the messages once and for all.

 It is possible to specify origins, destinations or routing for which the
obsolete time (X status) are different from the default values. These
particular cases are specified at the end of the file with the form of
supplementary lines. Each line specifies a particular case.

 The line should begin with the character which specifies the field to be
tested, then the content of the field and then the number of days before the
status X is given.

 Ex :
 > ALL 1

 The messages for ALL will be valid only one day.

 Example of EPURMESS.INI file:


# File for deciding messages' lifetime..
#
# Directory for messages
\FBB\MAIL\
#
# Directory for binary-messages
\FBB\BINMAIL\
#
# Directory for "killed" messages
\fbb\OLDMAIL\
#
# The file DIRMES.SYS (database-file)
\fbb\system\DIRMES.SYS
#
# Old database-file (backup)
\fbb\system\DIRMES.OLD
#
# New database-file (after EPURMESS (cleanup))
\fbb\system\DIRMES.NEW
#
# Result of cleanup is put into this file:
\FBB\EPURMESS.RES
#
# Personal  Bulletins (0=kill 1=archive in oldmail)
0 0
#
# Parametres in days:
#
# PARAMETRES FOR PERSONAL MESSAGES:
#
# PN -> PX (days after message is written)
30
#
# PY -> PX (days after changed to Y)
7
#
# PF -> PK (days after changed to F)
7
#
# PX -> PK (days after changed to X)
0
#
# PK -> PA (days after changed to K)
0
#
# PARAMETRES FOR BULLETINS
#
# BN -> BX (days after the message is written)
7
#
# B$ -> BX (days after the message is written)
7
#
# BY -> BX (days after changed to Y)
7
#
# BX -> BK (days after changed to X)
14
#
# BF -> BX (days after message is written)
14
#
# BK -> BA (days after changed to K)
0
#
# Automatic generated return-messages for non-forwarded messages.
# Each line may be max 255 characters long.  Disable with only a 0.
#
# Timeout for valid forward-path (number of days + text, end with $W)
21 This message could not be forwarded, due to bad link.$W
#
# Unknown routing or wrong H-address (number of days + text, end with $W)
2 This message could not be forwarded, due to bad callsign or bad route.$W
#
# Max number of lines in a returned message:
10
------
#
# List of lifetime-tests
#
# Type To    Days
#@  VEST   365
#@  LA     365
#>  LA6CU  365
#< system 0
#
# End of this file.
#







This page was last updated 

fbb-7.0.10/doc/html/fkam.htm0000644000175000017500000000360213613360505012415 00000000000000 Kantronics KAM (Appendix 4)

Kantronics KAM in host-mode.

(Appendix 4)

 If you plan to use a KAM with this software, you must make some changes.

For WinFBB:
 Use interface 6 in PORT.SYS.

For DosFBB:
 Before you start the BBS, you must load the RS232 driver.  You must use 
ESSKAM or ESS (ESS must be version 1.10 or higher). Do not use another 
driver such as COMBIOS or MBBIOS.
 Run it like this:
 ESSKAM 1             (Com1, Address and IRQ = defaults)
 ESSKAM 1 03F8 4      (Com1, Address=03F8Hex, IRQ4)

 The KAM must be in the right baudrate, and in hostmode. You put it into
hostmode with these commands:
 INTF HOST
 PERM

 There is a special format for INITTNCx.SYS. For HF, use this:

 UNPROTO MAIL/
 MONITOR ON/
 MCOM ON/
 MCON ON/
 MRESP ON/
 PID ON/
 RETRY 15/
 RESPTIM 0/
 FRACK 2/
 CHECK 30/
 HID OFF/

 For VHF use this:

 UNPROTO /MAIL
 MONITOR /ON
 MCOM /OFF
 MCON /ON
 MRESP /ON
 PID /ON
 RETRY /8
 CHECK /30
 HID /OFF

 As you can see, the position of the "/" is very important for HF/VHF !

 In PORT.SYS you must use 1 for VHF and 2 for HF in MultCh. You must also use
K in "Type host-mode".

 #
 # Same number of lines as number of TNCs.
 #
 #TNC NbCh Com MultCh Pacl Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
 1    4    1   1      230  4     1     10     30/60   UKYW 144.675
 2    1    1   2      80   1     1     6      15/60   UKYW HF
 #






This page was last updated 

fbb-7.0.10/doc/html/docwp.htm0000644000175000017500000002414113613360505012614 00000000000000 White Pages

White Pages.

Database and server.

DESCRIPTION.
UPDATE REQUESTS.
DATABASE DESCRIPTION.
DATABASE MANAGER.
EPURWP AND UPDATE MESSAGES.
WP SERVER REQUESTS.


Description.

 The White Pages implementation in FBB software has been based upon the W0RLI
model (many thanks to Hank for his work). I've tried to maintain a high
degree of compatibility whilst making further development to my own criteria.

 I shall try to explain how FBB White Pages works.

I have probably mis-understood some features of W0RLI's specifications but I
hope that this will not greatly  affect the compatibility.

 First of all, why do we need White Pages?

 White pages has some interesting features. Not least :

- A dynamic database containing users Name, zip code, HomeBBS and QTH (as
well as other fields).
- Automatic addressing/routing of mail to the HomeBBS of the destination
callsign.
- A White Pages server for remote interrogation of the database.

 The database information is updated, firstly from the information given by
users when they exercise the N, NH, NQ and NZ features at their home (or
another WP equipped) BBS; and secondly, from information contained within the
messages headers as they traverse the Network.

 The database is dynamic, it is changing constantly, and it updates itself in
real time. Either as soon as a line of a message header is received when in
ASCII forwarding mode, or when a complete message is decoded in compressed
forwarding mode; or else when a user disconnects from the BBS (this is to
prevent multiple updates being generated during a session).

 So, the database can hold many callsigns. In fact it maintains a list of all
the callsigns seen from all individuals sending messages as well has all of
the BBS's seen in the forwarding paths. More than 10,000 valid records is not
impossible today, and this will surely increase as the number of packet radio
users grows with each day. This will allow user to send messages to other
users around the world without necessarily having to be concerned to find
their full Hierarchical Address, the old principle of the user typing:

BBS PROMPT >
SP K6VAZ @ KM6WU.#CENCA.CA.USA.NOAM

should now be replaced by the user entering:

BBS PROMPT >
SP KM6VAZ

The BBS will add the HA and send the response:

BBS PROMPT >
SP K6VAZ
WP ROUTING @KM6WU.#CENCA.CA.USA.NOAM ADDED
TITLE ?

 If the routing destination HA is not recorded in the database then the user
will be advised and prompted to enter the address manually.

 Another capability of FBB White Pages is the automatic sending of update
messages to other BBS's. These messages are generated every night during
House-Keeping and are a listing of the additions and modifications made to
the database during that day. These messages are sent addressed both to and
from WP.

 When passing through or terminating at another White Pages equipped BBS, the
message will automatically update the 'local' WP database at that BBS. This
feature MUST BE USED WITH CARE, as updates can generate a lot of traffic and
the Network must be able to support it.

*** It's not be a good idea to send these update messages on HF ! ***

 A built-in White Pages server (WP) will provide information from the
database in response to a remote request. This server is described in
paragraph xx.

 All files used by White Pages are in the FBB\SYSTEM\WP subdirectory.

Trace for WP updates (for debugging etc):
in the \windows\winfbb.ini file, add the following line in the main section :
TraceWp=1
You can replace 1 with 2 or 3. 3 gives the maximum information.
A file WP.DBG will be created in the WP directory.



UPDATE REQUESTS.

 The  database  receives  information  from  three  sources.  The  s
indicated on each line of the update message as a suffix to the callsign:-

 - The /U suffix denotes that the information in this line of the   update is
User-Generated as is therefore assumed to be CORRECT. This information is
collected by the BBS whenever the User responds to the N, NH, NQ or NZ
commands. The date associated with the information is the date when the User
disconnects that session.

 - The /G suffix denotes that the information in this line has been gathered
by examining the header of a message to GUESS at which BBS the sender is
registered. The HomeBBS of the User is assumed to be the BBS shown in the
first R: header line. The date associated with this information is the date
shown on this R: header line.

 - The /I suffix denotes information about forwarding BBS's taken from the R:
header lines. This information can consist of the HA (the Hierarchical
Address), the QTH (within brackets) and the zip code (following the Z:). The
date of this information is again taken from the R: header line of the BBS in
question.

 When the BBS is idle the Database Manager is called and the update
information detailed above is processed.


DATABASE DESCRIPTION.

 The database  is  composed  of  individual  records.  Each  record 
following components :

- Callsign and Name.
- Active information.
- Temporary information.

 The active and temporary information components are identical and each
includes the following fields:

- Date of the information
- Hierarchical Address   (one word)
- Zip code          (one word)
- Qth               (one or more words)

 Only the Active information is used for addressing/routing and database
requests.


DATABASE MANAGER.

 This process freshens the database, following receipt of the new or changed
information detailed above.

 The update subroutine will first look for an entry in the database for the
callsign which matches the received information. If it does not exist then a
completely new record will be created in the database and the information be
used to fill what fields it can, in both the active and the temporary
components. The date will be then changed to the one associated with the
update information.

 If the record does already exist, then the unknown fields of both the
temporary and active fields will be filled in, and those fields already known
in the temporary part will be replaced by the new information if the date new
information is younger than that already on file. The date will then be
adjusted such that it is consistent with the updated information.

 If the new information is of the /U category, then the current fields will
be replaced by the new information in both the primary and secondary (Active
and Temporary) parts of the record, as this information has been input
directly from the user. If the information was of another category then only
the secondary (Temporary) part of the record will be updated, so the Active
or primary record will remain unchanged at this time.

 If a field is changed, a flag giving the update request type is then
validated. If the /U flag is already validated, it will not be replaced. This
flag will be used in case the WP update messages are validated.


EPURWP AND UPDATE MESSAGES.

 EPURWP is a maintenance program for the White Pages database which should be
run during each House-Keeping cycle.

 The program conducts a validity check on each of the entries, and discards
any "unwanted" records (in the case of an invalid callsign for example).

 The program also checks the date of the last update of the temporary part of
each record. If this date is older than a pre-defined number of days (given
as a parameter, default 40 days) then the temporary part is considered as
stable, and then the known fields will be transferred to the Primary or
Active part, which is then used to answer all addressing/server requests.

 This process ensures that the database is tolerant of users sending messages
from mailboxes other than their normal HomeBBS. Once the Active or primary
part of the record is set, then the temporary (or secondary) part can be
updated/changed many times. Only once this temporary field has remained
unchanged for 40 days, or the user exercises any of the "Nx" options at his
new HomeBBs will the Active or Primary record be changed.

 If the changes to the database are validated, then the record is marked with
an update flag and a line will be appended to the file MESS.WP

 Each line of the outgoing WP update messages looks like :

On 930123 FD1CDC/U @ F6FBB.FMLR.FRA.EU zip 31240 Claude Saint Jean

 Any unknown fields are replaced by "?" like :

On 930123 FD1CDC/U @ F6FBB.FMLR.FRA.EU zip ? ? Saint Jean

 The U character is the update type.


WP SERVER REQUESTS.

 FBB software has an internal built-in WP server.

 The format of the WP server requests are as shown below :

BBS PROMPT >
SP WP @ F6FBB
Title of message
WP Request (does not matter)
Text of message

F6FBB ?
EA3* ?

^Z (or /EX)

 The server will answer to the request with a private message, addressed to
the sender, and routed to the BBS according to the first R: header line of
the incoming request.

 The reply message is restricted to a maximum of 100 lines, as the use of
wildcards in the request could generate a unacceptably long replies.






This page was last updated 

fbb-7.0.10/doc/html/fmtfbcm.htm0000644000175000017500000000203613613360505013115 00000000000000 FBBCOMM.DRV

FBBCOMM.DRV.

FBBCOMM.DRV:  (Only for WinFBB)

The port-driver FBBCOMM.DRV is installed in Windows during the installation-
process of WinFBB.  

FBBCOMM.DRV is automatically installed in your Windows as you install WinFBB
from the diskette.  So there is nothing for you to do.  The driver is 
automatically installed into your SYSTEM.INI in the [boot] section as 
comm.drv=fbbcomm.drv.  If in doubt, you may want to check this.






This page was last updated 

fbb-7.0.10/doc/html/fmtreqfi.htm0000644000175000017500000000303513613360505013314 00000000000000 REQFIL-server

REQFIL server.

 REQFIL server allows to send back the ascii file requested to the originator
of the message.

 The message sent to REQFIL has a well defined syntax. The standard command
line of message is utilized. The message should be of the private type and
addressed to the BBS which we want to ask.

 SP REQFIL @ bbs-destination

 The title of the message contains two information, the name of the
requested file and the @ sign followed by the return BBS, that is to say
yours. The return message will be addressed to the originator of the request
to the return bbs.

 filename @ bbs-return

 The text of the message is not necessary, its content will not be taken into
account by the service.

 Example :

 F6FBB BBS >
 SP REQFIL @ F6ABJ.FRA.EU
 Title of message :
 DEMOS\ESSAI.TXT @ F6FBB.FMLR.FRA.EU
 Text of message :
 /EX

 This example makes the assumption that DEMO is a sub-directory of the USERS
directory.

 The answer of the remote mailbox will be of the form :

 SP F6FBB @ F6FBB.FMLR.FRA.EU < F6ABJ
 Req File: DEMOS/ESSAI.TXT
 Contents of ESSAI.TXT file
 ...
 /EX






This page was last updated 

fbb-7.0.10/doc/html/fmtphnmo.htm0000644000175000017500000004724613613360505013343 00000000000000 Telephone-modem (Appendix 20)

Telephone-modem.

(Appendix 20)

 The FBB software allows the connection of a telephone modem on a serial
port.

This section is split into these parts:
Driver
Type of modem
Protocol
Wiring for external modem
Usage
Example of PORT.SYS for DosFBB
Example of PORT.SYS for WinFBB
Example of PORT.SYS for LinFBB
Example of INITTNCx.SYS for modem
Example of FORWARD.SYS

Driver:

The modem must be declared in PORT.SYS.

In WinFBB the necessary driver is in FBBCOMM.DRV.  This driver replaces
the original COMM.DRV supplied by WIndows.  

In DosFBB it is necessary to use the FBBIOS.COM program. This driver 
performs BBS to Modem interfacing. It is therefore necessary to load FBBIOS
prior to BBS start up. A line FBBIOS will be added ahead of APPEL.BAT file.
See below an example of the APPEL.BAT file.
Of course, the FBBIOS used will have to match the serial port on which the
modem is to be connected (address and IRQ).

In LinFBB it is necessary to compile the Linux Kernel with SLIP 
(serial line).

The modem-driver will modify the RS232 speed according to the CONNECT info
received from the modem :

 CONNECT 1200 set the driver to 1200 Baud.
 CONNECT 2400 set the driver to 2400 Baud.

 The driver is reset to the default speed rate (specified in PORT.SYS) at
disconnect.

 At connect, the text ; "xxxx BBS. Phone Access" is sent by default. This can
be modified by creating a file MODEM.ENT in the SYSTEM directory.

 You can specify in the PORT.SYS file that you accept connections, even if
the user is not registered. In this case, the connection will be "read-only",
the user has only a read only-access, he cannot download files or write
messages, except to the sysop.

 When a non-registered user is connected, he will be signified that he only
has a "read only access", and will be prompted to go on. If he answers "Y",
he will go to the BBS menu, else he will be asked again for a callsign.


Type of modem:

 Various experiments have been carried out with several different kinds of
(external, or internal cards) modems. If possible, modems at 14.400 or
better 28.800 bps should be used; the modem speed is to be declared in
PORT.SYS. Some modems can work different speeds, with an internal
speed conversion between the modem and the computer. For example, the modem
can transmit and receive on the telephone line at 14400 bps and talk to the
PC at 19200 bps.

 If the modem uses the HAYES protocol, the INITTNCx.SYS file must hold the
correct HAYES init lines for the modem.


Protocol:

 The configuration used is 1 start bit, 8 data bits, 0 parity, 1 stop bit,
that is to say 10 bits words during the transmission.

 The Minitel standard is not supported (7 bits, even parity).

 The software being parametered by default in 8 bits, it was not possible to
modify this protocol, as the binary file transfers are carried out on 8 bits.

 NB.: FBBIOS/FBBCOMM.DRV handles XON/XOFF protocol during the transmissions.

Wiring for external modems:

 The modem must be able to tell the BBS that a call has been detected with
the remote modem carrier detection. This is the reason why all the RS232
signals are used by the BBS. The RS232 cable has to be wired up pin to pin
with no inversion: pins 2, 3, 4, 5, 6, 7, 8, 20, and 22 of the DB25
connector.


Usage:

 BBS users are not authorized to connect the BBS through a modem as per the
default settings.

 The SysOp must declare the modem users. To do it, perform a user edition (EU
call) and put M (for Modem) then W pass_word. A password made of the three
last letters of the callsign can be attributed for the first connect. Then
the user will be able to change it through the NP command. The authorized
callsigns can be listed by the DM command.

 When a modem call occurs, once the modulations have been detected, the modem
advises the BBS that a connection is effective on the telephone line. Then
the BBS asks for the caller's call sign and password.

 The user is granted three tries before being disconnected. If everything is
all right, the user can access the same commands like connected on a radio
channel, he will have to disconnect using the B command.

 The log file is maintained for the connections through the modem channel.
Keep in mind to add a line in the LOGFBB.CNF file for the modem calls to be
processed in the stats analysis by LOGSTAT.

For WinFBB:
FBBCOMM.DRV is already installed when Windows is started.  So there is no
more driver to install for the modem.

For LinFBB:
Make sure you have compiled the Linux kernel with SLIP (serial line),
or if you compiled SLIP as module you must load this.

For DosFBB:
 Example of APPEL.BAT with FBBIOS for a modem connected to COM3/IRQ4 :
 echo off
 break off
 echo Press ^C to interrupt !
 sleep 3
 fbbios 3 03E8 4
 serv %1
 etc........


 Example of PORT.SYS file with 3 serial port used:
 COM1 for a TNC, COM2 for a TNC, COM3 for the modem.

Example for DosFBB:

 FBBIOS will have been previously configured for COM3 (3E8, IRQ 4).

# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
3      3
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (Hex) Baud
1    1         3F8           9600
2    1         2F8           9600
3    3         3E8           1200
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
1    5    1   1      230   2      1      10   10/60   UDW  144.675
2    4    2   1      250   3      2       5   12/30  UDYW  430.675
3    1    3   1      128   2      0       5   00/60    UM  MODEM
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
1    1   LA1B-1        B
#
# End of file.
#


Same example for WinFBB:

 FBBCOMM.DRV is already loaded by Windows.

# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
3      3
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (Hex) Baud
1    6         3F8           9600
2    6         2F8           9600
3    6         3E8           1200
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
1    5    1   1      230   2      1      10   10/60   UDW  144.675
2    4    2   1      250   3      2       5   12/30  UDYW  430.675
3    1    3   1      128   2      0       5   00/60    UM  MODEM
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
1    1   LA1B-1        B
#
# End of file.
#


Same example for LinFBB:
 Example of PORT.SYS file with 3 serial port used:
 COM1 (/dev/cua0) for a TNC, COM2 (/dev/cua1) for a TNC,
 COM3 (/dev/cua2) for the modem.

# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
3      3
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (Hex) Baud
1    9         /dev/cua0        9600
2    9         /dev/cua1        9600
3    9         /dev/cua2        1200
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
1    5    1   1      230   2      1      10   10/60   UDW  144.675
2    4    2   1      250   3      2       5   12/30  UDYW  430.675
3    1    3   1      128   2      0       5   00/60    UM  MODEM
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
1    1   LA1B-1        B
#
# End of file.
#


Example of INITTNCx.SYS file for HAYES modem :

 #
 ATZ
 ATS0=1

Example of  FORWARD.SYS  file  to  forward  via  modem.  A  protocol with
correction (like MNP) must be used to avoid any modifications of texts. The
HAYES command ATDT dials the line, and when the connection is established,
the callsign (preceded with a "." to avoid echoing) is sent twice and then
the password. The callsign is sent twice in case of a problem the first time.
^M is the <return> variable.

 A LA1B
   #
   P C                                <-- Modem port.
   #
   C C F6FBB ATDT19~~~12345678^M      <-- Connects F6FBB using HAYES.
   V .F6FBB^M~~~.F6FBB^M~~~PASSWORD^M <--sends callsigns and password.
   #
   B LA1B
   F LA6CU
   #
 ------

 In the PORT.SYS file, the number of forward channels for the TNC (modem)
must be 1.






This page was last updated 

fbb-7.0.10/doc/html/docgate.htm0000644000175000017500000000274113613360505013110 00000000000000 Gateway commands

GATEWAY COMMANDS.


B : Exit the Gateway
K : Enters Converse mode.
C : Connect.
D : Disconnect.
H : Help
J : Lists the 20 last stations heard on the port.
P : Link from one port to another.

Once the selection of an authorized port has been made, a channel will be
granted, depending upon availability. This channel will use the users own
callsign. Switching to converse mode is automatic when the corresponding
station is connected; switching back to command mode takes place on a
disconnection, or if the Esc character or a > is sent in the first column.

Switching to converse mode can also be made with the command K. 

The C command must be followed by the destination callsign, and optionnaly
by the letter V followed by a string of digipeater callsigns.  Like:
C Destination call V repeat1 repeat2 ...






This page was last updated 

fbb-7.0.10/doc/html/fmtfbbio.htm0000644000175000017500000000417113613360505013271 00000000000000 FBBIOS.COM

FBBIOS.COM.

FBBIOS.COM:    (Only for DosFBB)

 FBBIOS is a serial line driver dedicated to the usage of a PSTN modem.
Binary as well as ASCII file transfer are supported with the XMODEM protocol.

 FBBIOS handles one serial line, one IRQ is required. The COM number, the
address of the serial interface and the IRQ number are given as parameters
appended to the command line, the address should be specified in FOUR hex
digits.

 Example : Install FBBIOS for COM1 at hex 03F8 and using IRQ 4 :
 FBBIOS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus FBBIOS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device.

 On a PC the IRQ's can not usually be shared.

 If the modem in use is at the HAYES standard, FBBIOS can modify the line
speed according to the one of the incoming call connection. In this case the
parameter 'A' should be appended to the command line to activate this
feature. This is not true with some buffered modems using a junction with a
settled speed.

 Example : FBBIOS 1 03F8 4 A

 Upon receipt of the string CONNECT 1200 or CONNECT 2400, the driver will
adjust its speed to the incoming call.

 From version 1.30, FBBIOS.COM can run up to 56 KBauds. Be sure that your
computer is fast enough !






This page was last updated 

fbb-7.0.10/doc/html/fmtinf.htm0000644000175000017500000000556413613360505012773 00000000000000 FORMAT of INF.SYS

INF.SYS

INF.SYS file (\FBB\SYSTEM).

 This binary file holds the information on all users of the BBS. This file
is very important and must not be edited or changed otherwise the list of the
users could be lost. This file can only be opened for reading.

 It is organized with records, each record containing information on a user.
Never modify this file while the BBS is running.

 Structure of one record (C language) :

#define uchar unsigned char

typedef struct {        /* Callsign structure used in info  */

  char callsign[7]   ;
  char ssid          ;

} indicat            ;

typedef struct {

  indicat  indic     ;  /* 8   Callsign                     */
  indicat  relai[8]  ;  /* 64  Digis path                   */
  long     lastmes   ;  /* 4   Last L number                */
  long     nbcon     ;  /* 4   Number of connexions         */
  long     hcon      ;  /* 4   Last connexion date          */
  long     lastyap   ;  /* 4   Last YN date                 */
  unsigned flags     ;  /* 2   Flags                        */
  unsigned on_base   ;  /* 2   ON Base number               */
  uchar    nbl       ;  /* 1   Lines paging                 */
  uchar    lang      ;  /* 1   Language                     */
  long     newbanner ;  /* 4   Date of new banner (lang.NEW)*/
  ushort   download  ;  /* 2   Download size in KB          */
  char     free[20]  ;  /* 20  Reserved                     */
  char     thema     ;  /* 1   Current thema selection      */
  char     nom[18]   ;  /* 18  1st Name                     */
  char     prenom[13];  /* 13  Christian name               */
  char     adres[61] ;  /* 61  Address                      */
  char     ville[31] ;  /* 31  City                         */
  char     teld[13]  ;  /* 13  home phone                   */
  char     telp[13]  ;  /* 13  job phone                    */
  char     home[41]  ;  /* 41  home BBS                     */
  char     qra[7]    ;  /* 7   Qth Locator                  */
  char     priv[13]  ;  /* 13  PRIV directory               */
  char     filtre[7] ;  /* 7   LC choice filter             */
  char     pass[13]  ;  /* 13  Password                     */
  char     zip[9]    ;  /* 9   Zipcode                      */

} info               ;  /* 360 bytes = lenght of one record */

Dates are given as the number of seconds since january 1st, 1970 00:00.

In C language, all strings are ended with a NULL (00 hex) character.






This page was last updated 

fbb-7.0.10/doc/html/fmtmail.htm0000644000175000017500000000274213613360505013134 00000000000000 MAIL.IN file (appendix 22)

MAIL.IN

(Appendix 22)

This file is used for importing messages directly to the BBS.  FBB checks 
every minute for the existence of this file (filename and path may be
changed in INIT.SRV, but the default is \FBB\MAIL.IN).  If the file exists,
the messages in the file will be imported directly into the BBS.

The format of each message is identical to the format of any message 
normally sent to the BBS.  Example of short MAIL.IN with 2 messages:

SP F6FBB < LA6CU                        (S-line)
Testmessage                             (Title)  
This is only a test                     (Message)
/EX                                     (/EX) 
SB ALL @ EU < LA6CU $12345ABCD
Test Message
This is just another test
/EX
  
Some servers include a #-sign between each message to force the
from-bbs to become the callsign of this BBS.  This is still alowed, but
should maybe not be necessary.

After the file has been processed (the messages imported) the file is 
automatically deleted.





This page was last updated 

fbb-7.0.10/doc/html/toolepwp.htm0000644000175000017500000000210313613360505013343 00000000000000 Tool: EPURWP

EPURWP.COM

EPURWP is a tool which allows updates and modifications of the 
white pages database.

Two optional parameters may follow.  

The first will specify how many days will go by before a data is valid. 
If the temporary part of the record has not changed during this time, 
it will be considered as stable and transferred to the primary (used) part.

The second parametre states how many days will go by before the record is
deleted from the database.  This is how many days go by with no updates
or refreshes of this user's data.  






This page was last updated 

fbb-7.0.10/doc/html/ftfpcx.htm0000644000175000017500000000672413613360505013001 00000000000000 TFPCX (Appendix 25 )

TheFirmware (TF).

(Appendix 25).

TFPCX / TFPCR / TFKISS (Hostmode KISS-driver).


It is possible to link FBB to a TheNetNode or similar systems running on a
separat PC with a simple 0-modem cable.
For this TF-KISS, TFPCR or TFPCX can be used as com-driver, and the link
must be defined as a KISSLINK in the nodesystem.

Another possibility is to use the driver with tnc's in kiss-mode etc..
The only restriction is that baycom modem do not work, but SCC cards do work.

It must be called with the same interrupt as stated in INIT.SRV as
TFPC-interrupt, or OxFD by default (if the INIT.SRV does not specify it).
It can be used with DosFBB or WinFBB running under WIN3.xx or WIN95.

IMPORTANT : TFPCX, TFPCR or TFKISS always must be called before starting WINDOWS and/or FBB.
Better add the call into your AUTOEXEC.BAT with a line like this (example using TFKISS) :

        TFKISS -I:FD -B:9600
       
Comport 1 is default, but other ports as well as other parameters can be 
specified (look in your manual).
Place the driver itself in your \FBB\BIN directory.
In PORT.SYS you must use 5 in INTERFACE, and D in type host mode.
The interface behaves in many ways as WA8DED hostmode.

If you intend to use higher speed than 9600 baud you must use UART 16550
in your serial ports and PCs not slower than 386 40 MHz.
Otherwise you probably will get errors during binary transfer or forward.

Example of PORT.SYS:

# FBB7.00
#
#Ports TNCs
1      1
#
#Com Interface Address (device)   Baud
1         5      3F8              9600
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
0    0     0    0       0    0     0     0    00/01    ----- File-fwd.
1   10     1    1     236    7     4    30    00/15     UDLY VHF/UHF/SHF
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#



Example of INITTNC1.SYS:

I OZ7BOX        # Set callsign
M IUS           # Monitor I, U and S-frames - only necessary with UNPROTO function active
@T2 150         # T2 timer settings
W 10            # Slottime
P 255           # P-persistance
O 7             # Maxframe
Y 10            # Number of channels

Other parameters can be set - look in your manual.
Parameters can also be set with  F7 - TNC commands.

If you have outgoing on more than one channel at the time, you have to use
SSID's in your forward connects for each channel.
With hostmode SSID's can be set for a channel using the L-command (send tnc-
command) together with the I-command (hostmode tnc-command - SET CALLSIGN).

Examples (only part of the connect strings showed) :

Forward to the first call:

L I OZ7BOX-10   # Use SSID -10 as your outgoing call
C C ...         # The connect strings

Forward to the second call:

L I OZ7BOX-9    # Use SSID -9 as your outgoing call
C C ...         # The connect strings

etc....

SSID's from -0 to -15 can be used, but NOT SSID's already in use.







This page was last updated 

fbb-7.0.10/doc/html/fmtack.htm0000644000175000017500000000355613613360505012754 00000000000000 Format of ACK-messages (Appendix 11)

Format of ACK-messages.

(Appendix 11)

 The ACK messages on receiving have a simple and compact format. The aim is
to have a message as short as possible in order to avoid an unnecessary usage
of the network.

 The title of the message is the title of the original message with a leading
"ACK:". Example :

 ACK:Title of the original message.

 These ACK messages are true messages strictly speaking. They carry the
origin, the destination, the route and the MID but they are of a particular
type, the type A (private are of type P, bulletins of type B, etc...). This
difference allows the routing of these messages without the lines "R:". This
is done again with the aim of avoiding an excessive load by data which are of
no use in this case.

 To keep the compatibility with the existing forwarding protocol, the type of
these messages is changed to P (private) if the receiving BBS of the
forwarding does not know the type of ACK messages (specified in the SID [FBB-
5.12-ABFHM$] by the letter A). In this case, the ack message will continue on
its route as a private message.

 The ACK messages are of the following form :
 ACK:Message test. <-- Title of message
 Msg FD1CDC@F6FBB - 22-dec 17:28z <-- Text of message

 It tells that the message that you had sent to FD1CDC at F6FBB and whose
title is "Message test" has been received in the BBS F6FBB on 22 dec at 12:28
GMT.







This page was last updated 

fbb-7.0.10/doc/html/ftpe1chl.htm0000644000175000017500000003651213613360505013213 00000000000000 Using FBB with PE1CHL NET and the BPQ Hostmode Emulator (Appendix 27)

          Using FBB with PE1CHL NET and the BPQ Hostmode Emulator
 (Appendix 27)

PE1CHL NET and FBB work together under DESQview (or other Multi-Tasker's) with the "G8BPQ Hostmode Emulator" package. The setup is very similar to the method for using the regular BPQ code. Setup your .SYS files in the same and  read the appendix on using BPQ mode as well for details.

 

The following differences should noted.

 

In INITTNCx.SYS,  monitoring is available but you may prefer to use the more comprehensive monitoring within NET instead.

 

In FORWARD.SYS,  "C C SWITCH"  will connect the BBS to the NET/ROM in NET, after this point the syntax is specific to NET and the options are :-

A LA2D
   #
   P B
   #
   C C SWITCH       Connect to the switch (Net/Rom in NET)
   V P 70cm         Select the "70cm" port
   C LA2D           Connect LA2D on the port we have just defined
   #
   B LA2D
   F LA2D
   #
 ---------

Alternately, you could predefine the downlink to LA2D in AUTOEXEC.NET with the command :-

     netrom downlink LA2D 70cm

You would then omit the "port select" line in the above example and the "downlink" would be selected by NET on whatever port you have predefined. This could be any valid NET portname, whether it is an Ethernet or AX/IP encapsulated portname or just another regular port.

 

Setting up the G8BPQ Hostmode Emulator with FBB

 

You must edit and use BPQCFG.TXT from the G8BPQEMU package and compile it with BPQCFG.EXE which should result in a 3072 byte BPQCFG.BIN file.

 

You should load G8BPQ.COM (from the emulator) from AUTOEXEC.BAT and this can be loaded high with your favourite memory manager.

You will need to exercise the usual tricks to get the maximum memory from each DESQview window. NET should be started first, to setup the G8BPQ Emulator port mappings, so that Unproto (for TPK users) broadcasts are setup before FBB is booted.

 

In the autoexec.net file, the emulator will need to be started and the port mapping setup. You should choose port names that differ from the internal names of FBB or BPQ types to avoid confusion, an example is given below.

       FREQ      USAGE    NET-PORT   BPQ-PORT    FBB-PORT

       RS232    38400bd      A1         1           A
       432.675   4800bd      70f        2           B
       432.675   1200bd      70s        3           C
       144.625   1200bd      2ms        4           D
       144.625   4800bd      2mf        5           E
       70.3125   1200bd      4m         6           F
       50.650    1200bd      6m         7           G
       Exp.     76800bd      exp        8           H

Then you would use the following in autoexec.net :-

    ax25 start g8bpq
    g8bpq ports A1 70f 70s 2ms 2mf 4m 6m exp

This will then map all the above ports to FBB and UI broadcasts will be available on those ports. If you want only selected ports, you could have an INITTNCx.SYS for them and specify if you want UI broadcasts or not. Alternately, an easier method is to specify only those ports you want to map to UI broadcasts as in the above example for NET and only ports setup this way will broadcast UI frames, ports not specified will not broadcast.

 

DESQview Window Management

 

The object is to get the maximum memory for FBB and this will always be available in the first DV window. The trick here is to open a dummy window first, as a place holder (a regular DOS one will do fine). Now you should start NET (which will automatically open in window 2) and once this has booted, you will need to switch to the 1st window, close it and then boot FBB. This will release the place holder and give the 1st DV window slot to FBB.

A script that does this automatically is called DESQVIEW.DVS and should be made with the script  tools (see DV manual) from this ASCII file :-

{Learn {Shift-F12} "!Startup"}          Name the startup script
obd{Enter}                              Open BIG DOS Window
{DESQ}ont                               Open NET window
{Delay 5}                               Wait 5 seconds
{DESQ}s1                                Switch to the 1st window
{DESQ}cy                                Close that window
{DESQ}ofb                               Open FBB window
{Finish}                                End of script

This assumes you have the following two letter assignments for windows in DESQview :-

    BD = Big DOS
    NT = PE1CHL NET
    FB = FBB

Note there is a delay of 5 seconds to allow NET to boot fully before switching windows and starting FBB, this may need adjusting to suit the speed of your machine.

You will need to make some .PIF files for NET and FBB and the following examples will give you a good starting point :-

You will also set your DMPI allocation for FBB here too. Make sure you allocate at least 2048KB, otherwise FBB may load it's own and waste memory.

 

Setting up PIF file options in DESQview for FBB and NET
                               Standard Options

 Program Name............: FBB 7.00b41

 Keys to Use on Open Menu: FB                         Memory Size (in K): 536

 Program...: c:\FBB\APPEL.BAT

 Parameters:

 Directory.: C:\FBB

 Options:
                  Writes text directly to screen.......: [Y]
                  Displays graphics information........: [Y]
                  Virtualize text/graphics (Y,N,T).....: [N]
                  Uses serial ports (Y,N,1,2)..........: [N]
                  Requires floppy diskette.............: [N]


                              Advanced Options

System Memory (in K).......:   0     Maximum Program Memory Size (in K): 600

Script Buffer Size.......:  1000     Maximum EMS/XMS/VCPI/DPMI (in K):  2048

Text Pages: 4               Graphics Pages: 1         Initial Video Mode:

Window Position:
   Maximum Height:  25       Starting Height:  25       Starting Row...:   0
   Maximum Width.:  80       Starting Width.:  80       Starting Column:   0

                               Shared Program
Pathname..:
Data......:

Close on exit (Y,N,blank)......: [ ]  Uses its own colors..............: [Y]
Allow Close Window command.....: [Y]  Runs in background (Y,N,blank)...: [Y]
Uses math coprocessor..........: [Y]  Keyboard conflict (0-F)..........: [0]
Share CPU when foreground......: [Y]  Share EGA when foreground/zoomed.: [N]
Can be swapped out (Y,N,blank).: [N]  Protection level (0-3)...........: [0]


                              Standard Options

Program Name............: NET

Keys to Use on Open Menu: NT                         Memory Size (in K): 230

Program...: net.bat

Parameters:

Directory.: C:\

Options:
                 Writes text directly to screen.......: [Y]
                 Displays graphics information........: [N]
                 Virtualize text/graphics (Y,N,T).....: [Y]
                 Uses serial ports (Y,N,1,2)..........: [N]
                 Requires floppy diskette.............: [N]


                              Advanced Options

System Memory (in K).......:   0     Maximum Program Memory Size (in K): 700

Script Buffer Size.......:  1000     Maximum EMS/XMS/VCPI/DPMI (in K):

Text Pages: 1               Graphics Pages: 0         Initial Video Mode:

Window Position:
   Maximum Height:  50       Starting Height:  50       Starting Row...:   0
   Maximum Width.:  80       Starting Width.:  80       Starting Column:   0

                               Shared Program
Pathname..:
Data......:

Close on exit (Y,N,blank)......: [Y]  Uses its own colors..............: [Y]
Allow Close Window command.....: [N]  Runs in background (Y,N,blank)...: [Y]
Uses math coprocessor..........: [Y]  Keyboard conflict (0-F)..........: [0]
Share CPU when foreground......: [Y]  Share EGA when foreground/zoomed.: [N]
Can be swapped out (Y,N,blank).: [N]  Protection level (0-3)...........: [0]

 

 Adjusting memory size window for NET

 

1. Open the NET window and then check from the command line to see how much memory is available in NET with the "mem" command.

2. Close NET and allocate another 10KB to the window repeat step 1.

 

When the amount of free memory does NOT increase, you have reached the maximum and should backoff until you reach the exact point where the free memory starts to drop and add a few KB to that value. (Note this may need adjusting as you upgrade to new NET releases).

 

Adjusting memory size window for FBB

 

1. Open FBB with a large value, say 600KB and reduce in 10KB increments until APPEL.BAT starts to run. Cancel  and close the window.

2. Increase the memory by 1KB and repeat step 1 until APPEL.BAT will no longer run then back it off to the previous value.

 

BPQ type Ethernet frames

 

As with the regular BPQ switch, NET can be setup to handle BPQ ethernet frame mapping. This is achieved through the normal packet driver (for your card) and you need to attach this mapping BEFORE any other mappings to the packet driver in AUTOEXEC.NET :-

    attach packet 0x60 g8bpq bpq 8 256 GB7OSP-14 ff:ff:ff:ff:ff:ff
    attach packet 0x60 0 eth0 8 1500 anytype

 





This page was last updated 

fbb-7.0.10/doc/html/docfwcom.htm0000644000175000017500000001043713613360505013304 00000000000000 Compressed forward (Appendix 10)

Compressed forward.

(Appendix 10)

FBB has 2 kinds of compressed forward:
Compressed forward FBB.
XFWD Compressed forward.


Extension to the protocol. Compressed forward FBB.


 The protocol utilized for the transfer of ascii files compressed is an
extension to the existing protocol. The compressed forward is validated by
the presence of the letter B in the SID [FBB-5.12-BFHM$]. The transfer of
compressed files can only take place under FBB protocol. The presence of the
letter B in the SID without the F letter will remain without effect.

 The only difference as regard to the standard protocol is the submit line.
It can specify the type of data contained in the compressed message. FA means
that the transfer will be an ascii compressed message. FB means that the
message will be a binary compressed file (this last possibility is not yet
implemented in the version 5.12).

 The submission of an ascii message will be in the form :
 FA P FC1CDC F6ABJ F6AXV 24754_F6FBB 345

 The submission of a binary file will be in the form :
 FB P FC1CDC F6ABJ F6AXV 24754_F6FBB 345

 The transferred data are of a specific format. The transfer will be done in
binary mode. This last one is derived of the YAPP protocol which is very
reliable. All transfer is made of a header, a block of data, an end of
message and a checksum. Each transfer is equivalent to the transfer of one
message of the standard protocol and shall not be followed by a control Z,
the end of file specifier is defined in another way.

 Format of header for an ascii compressed message (submission FA) :

 <SOH> 1 byte = 01 hex
 Length of the header 1 byte = Length from the title,
                               including the two <NUL> characters.
 Title of the message 1 to 80 bytes
 <NUL> 1 byte = 00 hex
 Offset 1 to 6 bytes
 <NUL> 1 byte = 00 hex

 Format of header for a binary compressed file (submission FB) :

 <SOH> 1 byte = 01 hex
 Length of the header 1 byte = Length from the filename,
                               including the two <NUL> characters.
 Name of the file 1 to 80 bytes
 <NUL> 1 byte = 00 hex
 Offset 1 to 6 bytes
 <NUL> 1 byte = 00 hex

 As to follow the french regulation, the title of the message or the file
name are transmitted in ascii, not compressed.

 The offset is also transmitted in ascii and specifies the offset at which
the data should be inserted in the file (in case of a fragmented file). In
the version 5.12, this parameter is not utilized and is always equal to zero.

 A data block contains from one to 256 bytes. It begins by two bytes which
specify the format.

 Data block format :

 <STX> 1 byte = 02 hex
 Number of data 1 byte = 00 to ff hex. (00 if length = 256 bytes).

  Data bytes 1 to 256 bytes

 The last data block is followed by the end of file specifier and the
checksum.

 End of file specifier format :

 <EOT> 1 byte = 04 hex
 Checksum 1 byte = 00 a ff hex

 The checksum is equal to the sum of all the data bytes of the transmitted
file, modulo 256 (8 bits) and then two's complemented.

 The checking of the checksum is very simple :

 The sum of the data from the file and the checksum received modulo 256
(anded with FF) shall be equal to zero.

 In case of a checksum error, the message or the file is not taken to account
and the system issues a disconnect request after having sent the comment :

 *** Checksum error

Extension to the protocol. XFWD compressed forward.

 X forwarding Protocol is implemented.  
 XForwarding now supports re-routing and swapping.
 Binary forwarding via telephone modem (FBB or XFWD)






This page was last updated 

fbb-7.0.10/doc/html/toolisda.htm0000644000175000017500000000206413613360505013316 00000000000000 Tool: ISDAY

ISDAY.COM

ISDAY is a small program to use if you want some program to run only
on specific days.

Format : ISDAY [/Nmday] [/Dday] [/Mmonth] [/H]

mday  = day of the month,  1 to 31
day   = day in the week,   0=sunday .. 6=saturday
month = month in the year, 1=january .. 12=december
All parameters are anded.

Each parameter can be specified as a value, or as an interval
like "1,3,12-22", that is the first, third and 12th to 22nd

ISDAY exits with ERRORLEVEL 0 if parameters match else with ERRORLEVEL 1

Example :

ISDAY /D0-2
IF ERRORLEVEL 1 GOTO LABEL
PROGRAM TO RUN ON SUNDAYS, MONDAYS and TUESDAYS
:LABEL
...







This page was last updated 

fbb-7.0.10/doc/html/fmttpsta.htm0000644000175000017500000000267313613360505013350 00000000000000 FORMAT of TPSTAT.SYS

TPSTAT.SYS

TPSTAT.SYS (\FBB\SYSTEM)

This file holds the statistics of the rubrics. Deleting it will 
restart these statistics from scratch. Do not delete the file
while the BBS is running. You will be prompted to create it
when booting the software.

The file is organized as 21 records.

Each record is a long integer holding the number of seconds used
for the current record. Each record correspond to the level 
(first number of the three numbers of the status bar).

record 0  : Server menu
record 1  : Message (sending or receiving)
record 2  : Qra locator
record 3  : Statistics
record 4  : Documentations
record 5  : Nomenclature
record 6  : Trajectography
record 7  : Unused
record 8  : Sending bin message
record 9  : FbbDOS menu
record 10 : Gateway
record 11 : Modem
record 12 : Binary transfer
record 13 : X forwaring
record 14 : Mailbox usage
record 15 : Forwarding
record 16 : Console chat
record 17 : YAPP
record 18 : Conference
record 19 : Editor
record 20 : Themas area





This page was last updated 

fbb-7.0.10/doc/html/toolminf.htm0000644000175000017500000000161013613360505013323 00000000000000 Tool: MAINTINF

MAINTINF.COM

 Utility maintaining the INF.SYS file. The INF.SYS file holds the users'
database. In case of problem in INF.SYS file, goto the SYSTEM directory and
run MAINTINF followed by a number of months. The records of  users not
connected within this number of months will be deleted and these users will
be asked as for a new connection. The number 0 will not delete any record and
only check the INF.SYS file.






This page was last updated 

fbb-7.0.10/doc/html/tlxfbbc.htm0000644000175000017500000000320013613360505013115 00000000000000 XFBBC.TXT

 

XFBBC

XFBBC is a tool that allows to talk with LinFBB deamon.

Main features are:

- remote connection to the xfbbd console
- remote display of the trafic
- remote display of the monitoring

The command line is:

xfbbC [-c | -m channel] [-h hostname] [-p port] [-i mycall] [-w password]

without parameter, xfbbC defaults to "xfbbC -m 0"

Command line options:

-c : console connection. In this case, a callsign and a password must be
     provided. To provide them, you can use either command line options or
     environment variables.

-m channel : monitoring request. 
    channel may be 
      * 0  : traffic activity of all channels is displayed.
      * n  : traffic activity of the channel "n" is displayed
      * -1 : monitoring of all ports

-h : hostname of xfbbd (default localhost)

-p : socket port for the communication to xfbbd (default 1525)

-i : callsign for the console connection

-w : password for the console connection. The password must be the exact
     string corresponding to the callsign as defined in the passwd.sys file of
     xfbbd.

some environment variables may default the command lines options :

-h : XFBBC_HOST
-p : XFBBC_PORT
-i : XFBBC_CALL
-w : XFBBC_PASS






This page was last updated 

fbb-7.0.10/doc/html/docedit.htm0000644000175000017500000000744213613360505013120 00000000000000 Appendix 1 Line editor

How to use the line-editor.

(Appendix 1)

 The FBBDOS offers a small line editor allowing the process of ASCII 
files.  It can help the remote SysOp to maintain the system files of 
the software.

 The commands are straightforward, and for better efficiency, they can
be chained on a single line.

Here are the available commands:


? : Shows all commands that can be used in the editor.

A : Adds a line after the current line.  The text for the new line
    shall follow the letter A.  If more commands are to follow after
    the text, the text must be ended with a "/" before next command.  If 
    the sign "/" itself is to used in the text, a "\" must be written 
    just before the "/".  If again the "\" is to be used inside the text
    as a valid character, it must be written twice ("\\").  
    The pointer will be at the start of the new line.
      
B : Go to start of file.
   
E : Go to end of file.

F : Search for the first occurrence of a character (or string of 
    characters) in the file.  The search starts at the current line.
    The string of characters must be ended with a "/" if more commands
    are chained (se the paragraph on the A-command).
       
I : Insert a line before the current line.  Read about ending with a
    "/" in the paragraph on the A-command.

K : Delete the number of lines that are stated just before the letter K.
    Example:  3K
    If no number is used, then 1 line is deleted.
       
L : Move a number of lines from the current line.  The number can be 
    negative to move towards the start of the file.
    Examples:  5L   -10L
       
N : Toggle line-numbering on/off.

P : Show a number of lines from the current line.  Example 8P.  This
    will show 8 lines, starting with the current line.
       
R : Search and replace.  Search for a string of characters and replace it
    with a new one.  Example:  RALL/ALLE  will replace all ALL with ALLE
    from the current line to the end of the file.  
       
S : Save file.

Q : Exit the editor without saving the file.


Examples::


    "EDIT>B5L10P" sets pointer at start of file.  Move 5 lines down, and
                  show 10 lines from there.
                  
    "EDIT>B4L6K-2L1OP" sets the pointer to the start of file.  Move down
                  4 lines.  Delete 6 lines.  Move back 2 lines, and show
                  10 lines.
                     
    "EDIT>BFBonjour/K-2L5P" sets the pointer to the start of file,
                  searches for "Bonjour", deletes the line containing
                  "Bonjour",  moves back 2 lines and shows 5 lines.
                     
    "EDIT>BFBonjour/IC'est une nouvelle ligne avec un \/ dedans/-1L3P"
                  sets the pointer to start of file.   Searches for
                  "Bonjour", inserts the new line.  The new line also
                  contains the character "/".  Goes back 1 line and
                  shows 3 lines.
                     
    "EDIT>SQ"     save file and quit the editor.
       





This page was last updated 


fbb-7.0.10/doc/html/fmtreqcf.htm0000644000175000017500000000463213613360505013312 00000000000000 REQCFG-server

REQCFG server.

 REQCFG server allows to send back the current configuration of the software.

 The message sent to REQCFG has a well defined syntax. The text of the
message is not used. The message should be of the private type and addressed
to the BBS which we want to ask.

 SP REQCFG @ bbs-destination

 The title of the message contains the @ sign followed by the return BBS,
that is to say yours. The return message will be addressed to the originator
of the request to the return bbs.

 @ bbs-return

 The text of the message is not necessary, its content will not be taken into
account by the service.

 Example :

 F6FBB BBS >
 SP REQCFG @ FD1CDC.FMLR.FRA.EU
 Title of message :
 @ F6FBB.FMLR.FRA.EU
 Text of message :
 /EX

 The answer of the remote mailbox will be of the form :

SP F6FBB @ F6FBB.FMLR.FRA.EU < F6ABJ
ReqCfg V 1.2 (C) F6FBB 1992 - BBS F6FBB


Software F6FBB Version 5.15 compiled on Feb 07 1993

Mem Us:14620  Mem Ok:148288  Bid:30000  Ports:4  Ch:12  FBB Ok  BIN Ok

Available volumes : C: D: E:

EMS V4.0

     MSG : 29 pages (464 KB)
     BID : 17 pages (272 KB)
     HIE : No
     FWD :  1 pages ( 16 KB)
     REJ :  1 pages ( 16 KB)
     OVR : 11 pages (176 KB)
     SCR : 45 pages (720 KB)
     WPG :  5 pages ( 80 KB)
   Total : 109 pages (1744 KB)

Languages

       1 : ENGLISH
       2 : FRANCAIS
       3 : ESPAGNOL
       4 : ITALIANO
       5 : NEDERLAN
       6 : DEUTSCH
       7 : CATALA
       8 : NORSK
       9 : PORTUGUE
      10 : DANSK
      11 : SVENSK
      12 : HRVATSKI
      13 : FRANC8

Servers

  REQDIR : Request directory-listings
  REQFIL : Request ASCII-files
  NEWDOC : Add to documentation
  REQCFG : Request configuration from BBS
  AUTO7P : 7plus server
  7PSERV : Server for 7PLUS files
   MULTI : Multi-addresses

Port Interface Emulat. Ch Mode  Frequency
1    DRSI      WA8DED  9  UYWL  NODE
2    ESS/COM.  KAM     1  GYW   15M/20M
3    FBBIOS    FBBIOS  1  UYM   MODEM
4    ESS/COM.  KAM     1  GYW   HF-PSK







This page was last updated 

fbb-7.0.10/doc/html/fmtetat.htm0000644000175000017500000000137613613360505013151 00000000000000 FORMAT of ETAT.SYS

ETAT.SYS

ETAT.SYS (\FBB\SYSTEM)

This binary file holds informations concerning the state 
of the BBS. The callsign is the last user of the /A or /R
(Stop or Reset) command, and the date this command was issued.


LA6CU -2
Reset demande par LA6CU- le Tor 19/08/93 22:58



This page was last updated
fbb-7.0.10/doc/html/fpk232.htm0000644000175000017500000000602313613360505012506 00000000000000 PK-232 (Appendix 2)

PK-232 in host-mode.

(Appendix 2)


 If you plan to use a PK-232 with this software, you must make some changes.
First, check again PORT.SYS. You must have a P in "Type host mode". For
example:

 #
 #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
 1    7    1   1      230   4     1     10     30/60   UPYW 433.650
 2    1    3   1      80    2     1     5      17/30   GPW  15/20m
 #

 Example of INITTNCx.SYS for PK-232:

 UNMAIL v LA7QR   means Unproto MAIL v LA7QR
 RY10               "   Retry 10
 MN6                "   Monitor 6
 MC6                "   Mcon 6

 Example of MAINTx.SYS for PK-232:

 UR1
 CTBBS ($c) was shut down for service $d $T.

 PK-232 host-mode commands (from F6AIW) :

 8B 8BITCONV AU AAB      AB ABAUD    AG ACHG     AA ACRDISP
 AK ACRPACK  AT ACRRTTY  AE ADDRESS  AD ADELAY   AI ALFDISP
 AP ALFPACK  AR ALFRTTY  AL ALIST    AM AMTOR    AC ARQ
 AO ARQTMO   AS ASCII    AY ASPECT   AW AWLEN    AV AX25L2V2
 AX AXDELAY  AH AXHANG   BA BAUDOT   BE BEACON   BI BITINV
 BK BKONDEL  BT BTEXT    CL CANLINE  CP CANPAC   CX CASEDISP
 CU CBELL    CC CCITT    CF CFROM    CB CHCALL   CD CHDOUBLE
 CH CHSWITCH CK CHECK    CQ CMDTIME  CM CMSG     CI CODE
 CN COMMAND  CE CONMODE  CO CONNECT  CY CONPERM  CG CONSTAMP
 CI CPACTIME CR CRADD    CT CTEXT    CW CWID     DS DAYSTAMP
 DA DAYTIME  DC DCDCONN  DL DELETE   DF DFROM    DI DISCONNE
 DW DWAIT    EA EAS      EC ECHO     ES ESCAPE   FA FAX
 FN FAXNEG   FE FEC      FL FLOW     FR FRACK    FS FSPEED
 FU FULLDUP  GR GRAPHICS HB HBAUD    HD HEADERLN HI HID
 HO HOST     HP HPOLL    ID ID       IL ILFPACK  IO IO
 JU JUSTIFY  KI KISS     LR LEFTRITE LO LOCK     MX MAXFRAME
 MB MBX      MC MCON     MD MDIGI    MM MEMORY   MI MFILTER
 MF MFROM    MH MHEARD   MN MONITOR  MO MORSE    MP MSPEED
 MR MRPT     MS MSTAMP   MT MTO      MA MYALIAS  ML MYCALL
 MG MYSELCAL MK MYALTCAL NE NEWMODE  NO NOMODE   NR NUCR
 NF NULF     NU NULLS    OK OK       OP OPMODE   PA PACKET
 PL PACLEN   PT PACTIME  PR PARITY   PS PASS     PX PASSALL
 PE PERSIST  PP PPERSIST PC PRCON    PF PRFAX    PO PROUT
 PY PRTYPE   RW RAWHDLC  RB RBAUD    RC RCVE     RE RECEIVE
 RX RXREV    RD REDISPLA RL RELINK   RS RESET    RP RESPTIME
 RT RESTART  RY RETRY    RF RFEC     SE SELFEC   SP SENDPAC
 SI SIGNAL   SL SLOTTIME SQ SQUELCH  SR SRXALL   ST START
 SO STOP     TB TBAUD    TC TCLEAR   TM TIME     TR TRACE
 TW TRFLOW   TI TRIES    TD TXDELAY  TF TXFLOW   TX TXREV
 UN UNPROTO  UR USERS    US USOS     VH VHF      WI WIDESHFT
 WO WORDOUT  WR WRU      XW XFLOW    XM XMIT     XO XMITOK
 XF XOFF     XN XON






This page was last updated 

fbb-7.0.10/doc/html/docfeatu.htm0000644000175000017500000002661413613360505013301 00000000000000 FEATURES

FEATURES.

- This software is available for Dos, Windows and Linux.  Most features and
  operations are identical to all versions.  Where there are differences, 
  they are clearly marked in the manual with DosFBB, WinFBB and LinFBB (for
  Linux).  There are two LinFBB-versions for Linux:
  a windowing version (using X11 windowing system and MOTIF toolkit).
  a daemon version. The daemon version has no interface and works alone in
  background (like works an anti-virus, hi...). So the compter may be used
  for any application while the BBS is running.

- The usage of this software is very close to the one made by WA7MBL, whose
  commands have been kept. It has also a set of specific and original
  supplementary commands.

- The code does not work on XT.
  Works on AT286 and UP with at least 2MB of memory.
  Code uses up to 16MB of memory.

- Multiconnections: up to 50 simultaneous channels on 8 TNC (4 or 8 channels
  per TNC depending on the software used).

- Multiplexing: this software supports usage of an external MUX and supports
  also extension boards in the case of a hardware configuration having more
  than 2 ports. The MUX connects 4 TNC on 1 serial port, either com1 or com2.
  Printed board is available from the ATEPRA association, (ATEPRA, 23 rue de
  Provins, 77520 MONS EN MONTOIS - FRANCE).

The software operates:
- with any TNC2 or clone fitted with the special 27256 eprom containing the
  WA8DED firmware, or TF4/TF8, with a Z80 clock of 2.5 or, better, 4.9 MHz.
- with a PK232 in Host-Mode (but TFPK software, WA8DED hostmode for PK232
  works better !).
- with a G8BPQ node.
- With a KAM hostmode.
- With TFPCX/TFPCR/TFKISS and tnc's in kiss-mode or a kisslink to a 
  nodesystem.

- Standard BBS: It has many BBS-commands identical to the BBSs by WA7MBL 
  or W0RLI. It has also server functions (computation of satellite orbits, 
  callbook, and operator customizable chapters, gateway to an other 
  channel, the users being able to chat together in real time on the same
  or different channels, etc...).

- Forwarding: With other BBSs of WA7MBL type or compatible, BIDS management
  (up to 32000 bids, depending on a parameter, are saved in a separate file),
  a BID is automatically generated if the user does not give one. Private 
  message works with the management of MID. The messages are suppressed 
  automatically after a delay which can be user defined. This is true for
  bulletins and personal mail.

- The forwarding is optimized between BBSs using FBB protocol type. It is
  more efficient on a VHF/UHF network. This kind of forwarding can be disabled
  by configuration.

- The compressed forwarding allows the reduction by a factor of about 40-50%
  the quantity of data to exchange in big messages. The messages are protected
  by checksums, so the transfer is made error-free.

- X forwarding Protocol is also implemented.  XForwarding now supports 
  re-routing and swapping.  Checksum is implemented in the X-forwarding.

- The forwarding is simultaneous on the various ports regardless if they are
  incoming or outgoing. There might be several forwardings outgoing per port
  which number is set by parameter. The number of incoming forwarding is a
  function of the available channels. The time and the period of forward can
  be set separately on each port.

- Hierarchical routing is supported.

- The ping-pong phenomenon is automatically detected and an information is
  given to the sysop by a system message.

- Messages and bulletins for SYSOP may be duplicated for one or more 
  destination-call which can be defined by configuration.

- A detailed log of the BBS activity is maintained and a statistic analysis
  program, written by FC1MVP, is also available.

- Binary transfer is supported with the usage of the YAPP protocol of WA7MBL.
  An extension to this protocol has been made, including the automatic 
  restart and the checksum, should a stop occur or a disconnection take 
  place during the transfer. This extension to the protocol works with the 
  TPK, packet terminal program written by FC1EBN.

- Gateway between connected stations or with another port.

- Conference within the limits of the available ports and channels.

- Language: At the first connection, the connect language is attributed to
  the user, depending of the callsign.

- Remote SYSOP operation is supported and the housekeeping of the BBS
  messages, mail and old mail is done each and every night at low activity
  period which can be parametered, and is done automatically.

- DosFBB works under DesqView.

- Unproto beacons may be sent on any port and via any path (more than one
  per port, if wanted) for each arrived message.  Users may be validated 
  to be allowed to ask for resync of unproto-beacons to update their 
  internal messages-list without connecting the BBS.  This feature is 
  used by TPK  and some other modern terminal-programs.

- Modem in WinFBB support XMODEM, YMODEM and ZMODEM upload and download
  with the DSZ shareware. 

- Modem in LinFBB support XMODEM, YMODEM and ZMODEM upload and download
  with the utility ´fbb_zm´ that is included in the LinFBB package. 

- Modem in DosFBB support XMODEM, YMODEM and ZMODEM download.  
  Needs a recent version of FBBIOS.  Upload is supported only for XMODEM.

- langname.NEW works as langname.ENT, but is sent only ONCE to  each 
  user (at the first connection after the file has been updated).

- Max KB for download in modem and yapp port may be set in INIT.SRV

- Only one simultaneous forward for a station is allowed.

- ACK-messages show only the first R:line (if passed through FBBs).

- Too long callsigns in routing are rejected (asked by G1NNB)

- 3 extensions to the version 1 of FBB protocol:
  1: Reject messages from being forwarded to the BBS.
  2: Receive messages, but hold them for sysop before release.
  3: Reject message-proposals with wrong format.
  In the first 2 cases a message may be sent to sysop to advice him of the
  problem (this is parametred in INIT.SRV file).

- No more than 1 message from one callsign in each proposal block. If more,
  the other messages are delayed to the next proposal blocks. This avoid long
  lists of message from the same sender. May be disabled with the letter D in
  the T line of FORWARD.SYS

- Oldmail has a format compatible with import.

- Information about the number of free buffers in the TNC in the status line.
  Maximum buffers per channel is divided by two if the number of free buffers
  is going too low.

- New feature for FORWARD.SYS for sending of 7+ messages:
  New line J in FORWARD.SYS :  (data means 7+)
  J 0 : no data sent
  J 1 : data is sent (default)
  J 2 : personal data is sent
  J 3 : only data is sent (exclusive)

- Forced disconnection of all links at housekeeping time+15 min.

- Binary transfer protocol Autobin (used in GP, SP TurboPacket, etc...)
  Commands are BGET and BPUT.

- Full screen editor usable to send or reply messages. 
  In DosFBB validated with AltF6.
  Always used in WinFBB.

- Command "WHERE file" in FBBDOS (to find one or more files in FBBDOS)
  Wildcards are accepted.

- Command TH -> access to the thematic zone. The file THEMES.SYS is configuring
  this zone.

- FBBIOS40 (and up) should work with 16550 FIFO chips (for DosFBB).

- Server REDIST is included.  Used to redirect personal message as bulletin.

- System files are checked after local editing.

- Implementation of the VXD interface of the BPQ code.

- All program run from FORWARD.SYS are synchronous.

- Filters accepted as DLL (much faster...).  Both for WinFBB and  DosFBB (!!).

- Ethernet/tcp-ip implementation. Needs the WINSOCK.DLL Microsoft library.

- Information on a connected station. Double click on the callsign line 
  of the connected stations give the info (WinFBB).

- Uploaded file via modem is validated and set to the user.

- F_FILTER validated for filtering of uploaded files.
  The F_FILTER may also be created as a DLL.  Both for WinFBB and 
  DosFBB (!!). The filter must be installed in the path (\FBB\BIN) of Dos.

- Every connected channel is bufferized. The connection is visible while
  double-clicking on the user in the list (WinFBB).

- BBS forwarding is not allowed on a GUEST port if the BBS is not declared.

- Two DLLs have been developed to be called from FORWARD.SYS (WinFBB):
    ICOM.DLL uses the same parameters as ICOM.COM
    PROGTX.DLL sends a binary file to a tx through a serial com
      format : PROGTX [options] filename
      options : /C2     = COM2 (default COM1)
                /A02F8  = Com address is 02F8 (excludes /C OPTION)
                /B9600  = Baud rate is 9600 Bauds (default 1200)

- A hold-message is not recorded in the list, only saved as a file. 
  So no unproto list or other is sent.

- New programs INSTWFBB for WinFBB and FBBSETUP for DosFBB to configure 
  the software.  In LinFBB there is a small INSTALL.SH script that does
  part of the job for LinFBB.

- Binary forwarding via telephone modem (FBB or XFWD)

- WinFBB: The configuration may be called from the Config menu. Updates
  are made without rebooting the software (after saving the config).

- Blocking DOS commands (EDIT, ...) is killed after 60 seconds.

- Messages or files are not accepted if disk free is less than 100K.

- Telnet interface is working as modem interface except that password is
  mandatory.

- WinFBB: Servers can be made as DLLs provided they are fast enough (no 
  multitasking during a DLL activity).

- WinFBB: Selection of zone in the channel windows. Accept copy (=Ctrl Ins)
  to clipboard and print. Menu is activated with the right button of the 
  mouse inside the text window.

- Selection of a word (left double click) or a list of characters (Ctrl left
  double click).

- Sysop-command HO puts a message in the hold list.

- ReadOnly access if there is no password defined (modem/telnet port)

- MD ("Message Digest") password system. This password is based on a public
  key. The 10 digits are never the same and the answer is also never the 
  same. So it is not possible to find the original password from the answer.

- Both WinFBB and DosFBB use protected mode (DPMI).  

- Swapping is now using hierarchy. For instance :
  @ F6FBB.FRA.EU @ F6FBB.FMLR.FRA.EU
	Only the first full address will be swapped to the other
  @ F6FBB @ F6FBB.FMLR.FRA.EU
	All F6FBB addresses will be swapped to the other

- WinFBB32 is a 32-bit version of WinFBB.  For use with Windows NT and
  Windows95.  Can NOT be used with Windows 3.x !

- W32 : TfWin32.DLL interface validated.  Only WinFBB 32-bit!






This page was last updated 

fbb-7.0.10/doc/html/fmtconfi.htm0000644000175000017500000001564613613360505013317 00000000000000 Connection filtering (Appendix 15)

Connections filtering.

(Appendix 15)

FBB software allows filtering on connection. Filtering is not done by the

BBS software but by external programs developed by users.

 When the BBS starts, the C_FILTER does not really need to be there.  But at
the first connect it must exist.  If it does not exist at THAT time, it will
not be checked again.  So if a C_FILTER is added after that, the BBS must be
rebooted for the filter to take effect.

 Connection filter may be interactive and allows to incorporate some features
like dedicated information for predefined callsigns, password filtering,
etc...

 The C_FILTER program must be found by the PATH of MsDos. Its extension can
be COM or EXE, and it must be little and fast as multitasking is stopped
during the activity of this program. If this program is not found, it will
not be called until the BBS is rebooted.

 The C_FILTER may also be created as a DLL.  Both for WinFBB and DosFBB (!!).
The filter must be installed in the path (\FBB\BIN) of Dos.

 When receiving the connection, the C_FILTER program (if found) is called
with some arguments including a level number. This number is incremented each
time the program is called in the same connection session. The first time the
level number will be 0.

 The line arguments given to the C_FILTER program are :

- Callsign (format as F6FBB-8).
- Level number (0 is the first time, up to 99).
- Flags of the user (binary number as user's mask of INIT.SRV).
- New : Flag indicating if the user is unknown in the BBS database.
- Record number of the user in INF.SYS.
- New: one more parameter before the optional text. It indicates the
  port where was connected the user.
- Received data (in one argument).


 The C_FILTER program ends with an exit value. This value is very important
and tells the BBS what to do :

 Return value (for C_FILTER):
 0 : Connection is accepted
 1 : C_FILTER will called again, level is incremented
 2 : Connection is refused, user is disconnected
 3 : Connection is accepted, but in read-only mode
 4 : Connection is accepted, but messages will be hold.
 100 and up
   : C_FILTER will called again, next level is equal to the return value.




Example of C_FILTERs.  First C_FILTER.EXE, next C_FILTER.DLL:

Example C_FILTER.EXE:

/*
 * C_FILTER.C
 *
 * Connection filter for FBB BBS software. (C) F6FBB 1991.
 *
 */

#include <stdio.h>

/*
 * Connexion filter called for each connection.
 * All datas sent to stdout will be sent to the user.
 *
 * Filter is called with some arguments on the command line :
 * C_FILTER CallSign Level Flags New Record ReceivedData....
 *
 * The return value tells the BBS if C_FILTER must be called again or not
 * 0 if the BBS can go on,
 * 1 if the C_FILTER must be called again
 * 2 if the user must be disconnected.
 *
 * Callsign is in the FORM CALLSIGN-SSID (F6FBB-0).
 *
 * The first time C_FILTER is called Level=0, and then will be incremented
 * each time it is called for the same connection.
 *
 * Flags give the flags of the user (MGPBSXLE) in a bit field. as defined
 * in the INIT.SRV user's mask. (0x80=Modem, 0x40=Guest, etc...)
 *
 * If New=1, then this is the first connection of the user on the BBS.
 * Record is the record number in the INF.SYS file.
 *
 * All other arguments are the words sent by the user
 * (password for instance).
 *
 * The number of arguments is variable and depends of the number of words
 * in the answer of the user.
 *
 */


/*
 * This is only a little example to test the system. It will be called
 * four times and will give the list of arguments.
 *
 * The fourth time, the hand will be given back to the BBS.
 */

main(int ac, char **av)
{
  int i;
  int level = atoi(av[2]);            /* Get level from argument list  */
                                      /* and transform it to integer   */

  if (level == 0) {                   /* Is level equal to 0 ?         */
    printf("Connection line :\n");    /* This is the first call        */
    for (i = 0 ; i < ac ; i++)        /* List line arguments           */
    printf("%s ", av[i]);
    putchar('\n');
    return(1);                        /* C_FILTER must be called again */
  }
  else {
    printf("Following line  :\n");    /* These are other lines         */
    for (i = 0 ; i < ac ; i++)        /* List line arguments           */
      printf("%s ", av[i]);
    putchar('\n');
    if (level == 4)                   /* Is it the last time ?         */
      return(0);                      /* Yes, go on BBS                */
    else
      return(1);                      /* No, call once more C_FILTER   */
  }
}


Next example, C_FILTER.DLL:

#define STRICT
#include <stdio.h>
#include <windows.h>

/*
 *    Code (C) F6FBB 1995-1996
 *
 *  C_FILTER example
 *
 *  svc_main is the only exported function. It must exist as WFBB will
 *  look for it. All filters are in the same format. If not NULL,
 *  r_buf allow to give a direct text back to the BBS
 * The size of the buffer is given by the parameter len.
 *
 *  Answers may also go to stdout (slower...).
 *
 *  This code is only an example and was not fully tested. It could
 *  give problems as I am not an expert !
 *
 * The used compiler is a Borland C++ 4.5
 *
 *  The DLL is not linked with the code, but checked and loaded when
 *  needed by WFBB.
 *
 * This is an example of the C_FILTER.DEF file :
 *
 *  LIBRARY        C_FILTER
 *  DESCRIPTION    'C_FILTER DLL for FBB'
 *  EXETYPE        WINDOWS
 *  CODE           PRELOAD MOVEABLE DISCARDABLE
 *  DATA           PRELOAD MOVEABLE SINGLE
 *  HEAPSIZE       1024
 *
 *
 * Parameters are (for C_FILTER):
 * ac[0] : The name of the filter (C_FILTER)
 * ac[1] : The callsign and SSID
 * ac[2] : Level number (from 0)
 * ac[3] : Flags
 * ac[4] : Boolean for new user
 * ac[5] : Recordnumber in INF.SYS
 * ac[6] : Port number
 * ac[7] : Optionnal Command received
 * r_buf : The buffer to put an answer
 * len   : The size of the answer buffer
 *
 * Return value (for C_FILTER):
 * 0 : Connection is accepted
 * 1 : C_FILTER will called again, level is incremented
 * 2 : Connection is refused, user is disconnected
 * 3 : Connection is accepted, but in read-only mode
 * 4 : Connection is accepted, but messages will be hold.
 * 100 and up
 *   : C_FILTER will called again, next level is equal to the return value.
 *
 */

int _export FAR PASCAL svc_main (int ac, char FAR ** av, char FAR * r_buf, int len)
{
	if (len > 20)
	{
		sprintf (r_buf, "Inside the C_FILTER\r");
	}
	return (0);
}




This page was last updated 

fbb-7.0.10/doc/html/docackno.htm0000644000175000017500000000314313613360505013260 00000000000000 F6FBB Pages : FBB

Acknowledgments

I would like to particularly thank Patrick F5GHV who was my first "official" beta-tester.

I also must thank Per LA6CU, who helps me from many years to set up this software, debugging and documentation, as well as Claude F1CDC, the"dumb individual", who, with his advices and criticism (often vitriolic!), has given his support in this task.

I would like to thank, as well, all the beta-test team and all the programmers for the development of applications and complementary tools for this software. Such a support made me free of these tasks, very often ingrate.

I thank again all the SYSOPS and users who are confident in the product, and cooperate, thanks to their comments and suggestions, in improving this BBS software package.

I would like, at the end, to thank WA8DED for the excellent piece of software, the Host-Mode for the TNC, and also NORD><LINK for the additions made to it.

 

Page last updated on 17 november 1996

fbb-7.0.10/doc/html/fmt_afax.htm0000644000175000017500000001400113613360505013257 00000000000000 Drivers and phone-modem

Async port drivers and telephone modem.

You may need several external drivers for your BBS.  

For WinFBB:
FBBCOMM.DRV
BPQ

For LinFBB:
AF_AX25 domain socket  
AF_NETROM domain socket
AF_ROSE domain socket  
It is necessary to compile the Linux Kernel with SLIP (serial line).

For DosFBB:
ESS.COM 
ESSKAM.COM
FBBIOS.COM 
BPQ
TFPCX/TFPCR

Installation of a TELEPHONE MODEM. 


FBBCOMM.DRV:  (Only for WinFBB)

The port-driver FBBCOMM.DRV is installed in Windows during the installation-
process of WinFBB.  

FBBCOMM.DRV is automatically installed in your Windows as you install WinFBB
from the diskette.  So there is nothing for you to do.  The driver is 
automatically installed into your SYSTEM.INI in the [boot] section as 
comm.drv=fbbcomm.drv.  If in doubt, you may want to check this.


ESS.COM:       (Only for DosFBB)

 ESS is an async port driver optimized for FBB software. It can drive either
TNC2/PK232/clones or KAM.

 This small device driver is loaded as resident at the beginning of the
machine initialization (TSR).

 One ESS handles one serial line and makes use of one IRQ.

 The COM number, the address of the serial interface and the IRQ number are
given as parameters appended to the command line. The address should be given
as a FOUR digit hex number.

 Example : Install ESS for COM1 at hex 03F8 and using IRQ 4 :
 ESS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus ESS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device in the machine. On a PC the IRQ's can not usually be
shared.

 Should there be more than one port to handle, several ESS can be cascaded.
The IRQ should be different for each ESS, except for the case in which the
interrupt sharing is supported by the serial card used.

 Example :

 ESS 1 03F8 4
 ESS 2 02F8 3

 This sequence will load ESS's for COM1 and COM2.

 ESS accommodates also the muxing arrangement of serial ports.

 Version 1.08 of ESS-driver (included with DosFBB distribution)
 must be used with the MUX ! 


ESSKAM.COM:    (Only for DosFBB)

ESSKAM works exactly as ESS.COM, but only for Kantronics Kam TNCs.


FBBIOS.COM:    (Only for DosFBB)

 FBBIOS is a serial line driver dedicated to the usage of a PSTN modem.
Binary as well as ASCII file transfer are supported with the XMODEM protocol.

 FBBIOS handles one serial line, one IRQ is required. The COM number, the
address of the serial interface and the IRQ number are given as parameters
appended to the command line, the address should be specified in FOUR hex
digits.

 Example : Install FBBIOS for COM1 at hex 03F8 and using IRQ 4 :
 FBBIOS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus FBBIOS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device.

 On a PC the IRQ's can not usually be shared.

 If the modem in use is at the HAYES standard, FBBIOS can modify the line
speed according to the one of the incoming call connection. In this case the
parameter 'A' should be appended to the command line to activate this
feature. This is not true with some buffered modems using a junction with a
settled speed.

 Example : FBBIOS 1 03F8 4 A

 Upon receipt of the string CONNECT 1200 or CONNECT 2400, the driver will
adjust its speed to the incoming call.

 From version 1.30, FBBIOS.COM can run up to 56 KBauds. Be sure that your
computer is fast enough !


AF_AX25 domain socket    (More in appendix 23)
  AF_NETROM domain socket  (More in appendix 23)
  AF_ROSE domain socket    (More in appendix 23)
  (Only for LinFBB)

Standard kernel AF_AX25, AF_NETROM and AF_ROSE sockets
AX.25, NET/ROM and ROSE protocol are built into the Linux kernel.

I recommend to use these interfaces, because it will give you
more flexibility to build a system with many futures..






This page was last updated 

fbb-7.0.10/doc/html/docwild.htm0000644000175000017500000000216313613360505013125 00000000000000 Wildcards (Appendix 12)

Wildcards.

(Appendix 12)


Replacement characters or wildcards.

 Most of the search commands or list commands and some configuration files
as well, accept replacement characters or wildcards.

 Character Replaces
 -----------------------------------------------------------------
 @         a letter
 ?         an alphanum character (letter or number)
 =         a printable character
 #         a numeral character or the # character
 *         a string of printable characters.
 &         a dot followed by printable characters. (equiv to .* )
 -----------------------------------------------------------------






This page was last updated 

fbb-7.0.10/doc/html/docmined.htm0000644000175000017500000001227313613360505013265 00000000000000 Full screen mini edit (DosFBB)

Full screen mini editor.

                 (Only for DosFBB, WinFBB has another editor)                 

 The editor is validated for answering messages, with Alt-F6.
 
 The Tiny-Edit is started with the Alt-F5 command. Normal operation of the
BBS is maintained, the editing takes place in the console window, above the
monitoring area of the display.

 Most of the text files can be edited with this editor despite of its
simplicity. The most concerning drawback is the fact that the line length can
not be longer than 79 characters. The language files (xxxx.TXT) therefore
cannot be edited.

 Tabs are not generated and are presented on the display with a special
character.

 During the editing, the usual BBS command set are no longer available, they
are replaced by the tiny-edit commands.

 Upon activation of the editor, a dialog window ask for the filename to edit.

 The default directory is the directory "SYSTEM" as defined in INIT.SRV.

 Examples: FORWARD.SYS will edit SYSTEM\FORWARD.SYS
           FWD\F6FBB will edit SYSTEM\FWD\F6FBB

 It will be necessary to specify the full path for a file outside of the
default directory root or located on another disk drive. If only the drive
name is specified, the current directory on this drive is searched for the
filename.

 Example: C:INIT.SRV will edit C:\FBB\INIT.SRV (while the current directory
is c:\FBB).

 To edit a message, one should give the message number with a leading pound
sign ('#').

 Example : #42645 will edit the message number 42645.

 In case the edited file is a compiled one (I.E. FORWARD.SYS) it will be
compiled again after the termination of tiny-edit


Function-keys :

F1  : Help windows.
F2  : The edited file is appended to the incoming mail file of the BBS
     (MAIL.IN).
F3  : Insert file.
F8  : Save current file.
F9  : Save current file and exit.
F10 : Exit Tiny-Edit without saving ! Caution : No confirmation
      requested before closure of the current edit session.

Edit Commands :

Almost all commands are available from the numeric key-pad.
Up-arrow        : The cursor moves up one line
Down-arrow      : The cursor moves to next line
Right-arrow     : The cursor moves forward one character. At the end of the
                  line it moves to the beginning of the next line.
Left-arrow      : The cursor moves backward one character position. At the
                  beginning of the line it moves back to the end of the 
                  former line.
Page-down       : The cursor moves toward the end of the current page. If it
                  is already at the end of page position, then the next page
                  will be displayed.
Page-up         : The cursor goes back to the first line of the current page.
                  If it is already at the first line, the former page will be
                  displayed.
Home            : The cursor moves to the first character of the current line.
End             : The cursor moves to the character position next after the 
                  last character of the line.
Insert          : Toggle the insert editing mode. The cursor is an underscore 
                  while in insert mode. It is a cursor block in overwrite mode.
Delete          : Erase the character at cursor position, the cursor is not 
                  moved.
Back-space      : The character preceding is deleted and the cursor moves 
                  backwards one position.
Ctl right-arrow : The cursor moves to the first character of the next word.
Ctl left-arrow  : The cursor moves to the first character of the previous
                  word.
Ctl home        : The first page of the file is displayed and the cursor 
                  moves to the first line.
Ctl end         : The last page is displayed and the cursor goes to the 
                  last line of the file.
Ctl Y           : The current line is deleted.
Ctl Q           : The current line is deleted from the cursor position up 
                  to the end.






This page was last updated 

fbb-7.0.10/doc/html/doc.htm0000644000175000017500000000631013613360505012243 00000000000000 Beta-Testers

FBB software - Documentation

These documentation pages are maintained by LA6CU.

Acknowledgments                     Copyright

Features                                     First installation

BBS commands                          Server commands

FbbDos commands                    SYSOP commands

Variables                                    Console commands

Full screen editor (DosFBB)    Misc. tools.

Drivers and phone-modem       Servers

White pages                               Glossary

File formats                               Appendix

This page was last updated

fbb-7.0.10/doc/html/fmtbbs.htm0000644000175000017500000000330513613360505012754 00000000000000 FORMAT of BBS.SYS

BBS.SYS



BBS.SYS (\FBB\SYSTEM).

 This file is in SYSTEM directory. In this file you MUST put the callsign of
every BBS you will forward directly to. There must be 80 (from 1 to 80)
lines, even if you do not use them all. The format is very critical, so do
NOT change line-arrangement !

 All the BBSs you forward to (the callsigns after A in FORWARD.SYS) must also
be in BBS.SYS. Before you start your BBS for the first time, you should
remove all not-used callsigns in BBS.SYS, and put in the file only the BBSs
that you forward to in your FORWARD.SYS. Later it is recommended that you do
NOT replace one callsign with another, as messages then will go to the wrong
BBS.

This file should speak for itself.

##########################
# BBS.SYS for FBB 7.00   #
# for LA6CU BBS by LA6CU #
##########################
#
# File containing all BBSs we forward to.
#
# Make sure that NO numbers are removed. 
#
01 LA1B
02 F6FBB
03 AMSAT
04 
05
06
07 
08 
09
10 
11 
12 
13 
14 
15 
16 
17 
18
19 
20 
21 
22 
23
24 
25
26
27 
28
29
30 
31
32
33
34
35
36
37 
38 
39 
40  
41 
42
43
44
45
46
47
48
49
50 
51 
52 
53 
54 
55
56 
57 
58 
59 
60  
61
62
63
64
65 
66 
67 
68 
69
70
71
72
73
74
75
76
77
78
79 
80







This page was last updated 

fbb-7.0.10/doc/html/fmttxt.htm0000644000175000017500000000420413613360505013024 00000000000000 FORMAT of TXT-HLP-INF-ENT-NEW

TXT, HLP, ENT, NEW, INF

(for each language)

Specific language files like
x.TXT, x.HLP, x.ENT, x.NEW, x.INF (SYSTEM\LANG).


 These various files have the names of the languages followed by the suffixes
TXT, HLP, ENT, or INF. They may content variables and are searched for in the
directory holding the files (SYSTEM\LANG).

 TXT : file which contains text used during the operation of the software.
Each line is associated to a text used by the software. The number of lines
must not be altered, except for the comment lines which are not taken into
account (lines beginning with a # in the first column).

 HLP : Help file called by the ? or H command. The help is refered to a word
following the command, (ex: ? HELP). Each help block should begin with a line
of a special format.

 ENT : Optional file displayed on the user connection, between the header and
the list of commands. The FRANCAIS.ENT file will be displayed if it exists
and if the caller uses french language.
There are also special files MODEM.ENT and TELNET.ENT for modem/telnet.

 NEW : Same as ENT above, but shown only ONCE for each user. 

 INF : File displayed when the command "I" is used. If the file does not
exist, the display of the ! command will take place.






This page was last updated 

fbb-7.0.10/doc/html/fmstatis.htm0000644000175000017500000000260213613360505013330 00000000000000 FORMAT of STATIS.DAT

STATIS.DAT


STATIS.DAT (\FBB\SYSTEM).

 This binary file holds the information on all connections. This file is
very important and must not be edited or changed otherwise the list of the
connections could be lost. This file can only be opened for reading.

 It is organized with records, each record containing information on a
connection. Never modify this file while the BBS is running.

 Structure of one record (C language) :

typedef struct {

  char  indcnx[7]    ;  /* 7   Callsign                        */
  char  port         ;  /* 1   (Port x 32) + channel           */
  long  datcnx       ;  /* 4   Date of the connection          */
  int   tpscnx       ;  /* 2   duration of the connection      */

} statis             ;  /* 14  bytes = length of one record    */

Date is given as the number of seconds since january 1st, 1970 00:00.

In C language, all strings are ended with a NULL (00 hex) character.








This page was last updated 

fbb-7.0.10/doc/html/fmtreqdi.htm0000644000175000017500000000271313613360505013314 00000000000000 REQDIR-server

REQDIR server.

 The REQDIR server sends back to origin of the special message the list of
files (total or partial) of a directory.

 The standard command line of the message is used. The message should be of
the private type and addressed to the BBS that we want to ask :

 SP REQDIR @ bbs-destination

 The title of the message contains two information, the mask of the
selection (*.EXE, *.*, etc...) and the @ sign followed the return bbs, that
is to say yours. The return message will be addressed to the sender of the
request via the return BBS. The mask can not be specified. In this case, all
the files will be listed.

 Mask @ bbs-return <- mask of the selection

 The text of the message is not necessary, its content will be ignored by the
server.

 Example :

 F6FBB BBS >
 SP REQDIR @ F6ABJ.FRA.EU
 Title of message :
 YAPP\*.ZIP @ F6FBB.FMLR.FRA.EU
 Text of message :
 /EX

 We assume with this example that YAPP is a sub-directory of the USERS
directory (this a suggested configuration).






This page was last updated 

fbb-7.0.10/doc/html/fmtwpsys.htm0000644000175000017500000000265013613360505013375 00000000000000 FORMAT of WP.SYS

WP.SYS

WP.SYS file (\FBB\SYSTEM\WP).

The WP.SYS file is composed of records. Each record is 194 bytes long.

typedef struct {
  char    callsign[7]      ;  // Callsign of the record
  char    name[13]         ;  // Name of the user
  char    free             ;  // Unused
  char    changed          ;  // Flag (U, G, I) of modification
  ushort  seen             ;  // Number of updates
  long    activ_date       ;  // Date of active part
  long    temp_date        ;  // Date of temp part
  char    activ_homebbs[41];  // Home BBS in active part
  char    temp_homebbs[41] ;  // Home BBS in temp part
  char    activ_zip[9]     ;  // Zip code in active part
  char    temp_zip[9]      ;  // Zip code in temp part
  char    activ_qth[31]    ;  // Qth in active part
  char    temp_qth[31]     ;  // Qth in temp part
} Wps;

In C language, all strings are ended with a NULL (00 hex) character.

This file should NOT be modified while the BBS software is running !







This page was last updated 

fbb-7.0.10/doc/html/fmtserv.htm0000644000175000017500000000430713613360505013170 00000000000000 Servers (menu)

Servers.

 The BBS software offers various servers which are triggered when machinable
messages are received. The number of offered servers is is without limit.

 The servers are activated when receiving a message whose destination had
been given at the end of the INIT.SRV file.


Declaration of servers at the end of INIT.SRV :

 ------
 #
 # List of servers :
 #
 # Destination  Name of program
 #
 REQDIR REQDIR.COM
 REQFIL REQFIL.COM
 NEWDOC NEWDOC.EXE
 #
 # End of file INIT.SRV
 #

 Servers are exec programs whose behaviour is explained in appendix 9. They
should be found in the directory containing the exec program SERV.EXE and the
configuration file INIT.SRV.

 When a private message is received, whose destination is defined in the
INIT.SRV file, the corresponding program to the destination is called with
the name of a temporary file on the command line. This temporary file
contains a message function of the requested server (see description of
servers below).

 At the completion of the server program, the incoming mail file is checked
to import an answer, should there be one. The message addressed to the server
is erased after this processing.  The temporary file must be erased by the
server-program.

 Various services can be developped, time available has its limits, but the
imagination has not !

REQDIR : Request directory-listing from a BBS's files-area.
REQFIL : Request an ASCII-file from a remote BBS.
NEWDOC : Update DOC-area of the BBS.
REQCFG : Request a list of the BBS's configuration.
MULTI  : Send multippel identical messages to different adressees.






This page was last updated 

fbb-7.0.10/doc/html/fmttelne.htm0000644000175000017500000002264713613360505013327 00000000000000 TELNET (appendix 24)

TELNET interface.

(Only for WinFBB and LinFBB)

The contents of this file is:
Info about Telnet interface
Example of PORT.SYS for LinFBB
Example of PORT.SYS for WinFBB
Example of FORWARD.SYS


Info about Telnet interface

Telnet is a communication tool like a terminal, but using TCP-IP. That is
you can use it on a network like the web. You MUST validate your local 
echo first.

It´s possible to use Telnet with LinFBB and WinFBB
to be used in User contacts or in Forward contacts.

The address to use may be 189C (189C hex = 6300 decimal).

But, it´s also possible to define another port address,
for example if you want Telnet access to LinFBB on port 23,
(port 23 is standard for Telnet, but 23 is also used by inetd in Linux!)
then change the ´address´ of COM2 to 17 (hex 17 = 23 decimalt)

Tip:
You may put the R letter (Read only default access) which gives a read-only
if the user is unknown or not authorized for Modem/Telnet (M Flag in EU command).


Example of PORT.SYS for LinFBB

Standard PORT.SYS with 1 TNC (COM1) with WA8DED-hostmode,
4 channels, 1 channel for outgoing forward,
and one Telnet interface listening on port 6300,
8 channels, 1 channel for outgoing forward.

# FBB7.00
# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
2      2
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
1    9         /dev/cua0          9600
2    9         189C               0
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
#           When using kernel AF_AX25 socket in Linux, MultCh is the
#           interface name (eg: ax0)
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.  Must use ESSKAM driver.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
0    0    0   0      0     0     0     0      00/01   ----  File-fwd.
1    4    1   1      230   4     1     10     30/60   UDYL  433.650
2    8    2   0      250   2     1     10     00/60   TUWR  Telnet
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#


Example of PORT.SYS for WinFBB

Standard PORT.SYS with 1 TNC (COM1) with WA8DED-hostmode,
4 channels, 1 channel for outgoing forward,
and one Telnet interface listening on port 6300,
8 channels, 1 channel for outgoing forward.

# FBB7.00
#
#
#Ports TNCs
2      2
#
# Com       : COM-number (1,2,...8)
#
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD or the same
#                 as stated in INIT.SRV, if any..
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
##
#Com Interface Adress (Hex) Baud
1    6         3F8          9600
2    7         189C         0
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
#            When using kernel AF_AX25 socket in Linux,
#            MultCh is the interface name (eg: ax0)
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode  Freq
0    0    0   0      0     0     0     0      00/01   ----  File-fwd.
1    4    1   1      230   4     1     10     30/60   UDYL  433.650
2    8    2   0      250   2     1     10     00/60   TUWR  Telnet
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
# 1    1   LA1B-1        B
#
# End of file.
#


Example of FORWARD.SYS

It´s syntax is common to both LinFBB and WinFBB.

A	SK6BA
	P A
#       C C <callsign> <ip address> <ip port>
	C C SK6BA 44.140.208.134 6300
#       V <login>$W<password>$W
	V SM6TKY$WPASSWORD$W
#
# the rest of fwd block...










This page was last updated 

fbb-7.0.10/doc/html/fbpq.htm0000644000175000017500000000704213613360505012431 00000000000000 BPQ (Appendix 3)

BPQ.

(Appendix 3)


G8BPQ-node (uses TNCs in KISS-mode, DRSI cards, etc...).

 If you plan to use BPQ-node with this software, you must make some changes.
Before you start FBB, you must load the BPQ-program.

 From version 4.05 of BPQcode, separate ports can be declared. Level 2
connections issue to the MultCh in the same order as PORTs declared in the
BPQCFG.TXT (G8BPQ distribution) file. First port corresponds to MultCh 0.
Level 4 connections (from the network) always issue to MultCh 0.

 In PORT.SYS you must use 2 in INTERFACE, and Q in type host mode. Version
4.05 or up is recommended. COM can be from 1 to 8, but will exclude existing
COMs. Choosing 8 is a good solution to keep existing COMs.  We recommend 
that you use COM 8.

 Only the INITTNCx.SYS for the 1st port must exist. You must check that there
is only one INITTNCx.SYS file for all BPQ-ports, otherwise you will have 
big problems! The parameters for other ports will be taken by default, and then
no conflict should happen between ports. If you want to define the streams 
differently on each port, you can do it with the INITTNCx.SYS file, but be sure
to give the right configuration.  INITTNCx.SYS will look like this:
A1
R0
UMAIL
M1
N1

 If paclen is equal to 0, then the default BPQ paclen of the port will be
taken, otherwise the specified paclen will overwrite the default BPQ paclen.

 If you have validated the gateway, you must configure ENABLE_LINKED=A in
BPQCFG.TXT to give to the stream the callsign of the user.


 Here is an example of PORT.SYS with BPQ-node and 2 TNCs:

 #
 #Ports TNCs
 1      2
 #
 #
 #Com Interface Address (Hex) Baud
 8    2         0            4800
 #
 #
 #TNC NbCh Com MultCh Pacl Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
 1    8    8   0      230  4     1     10     30/60   UQYW VHF
 2    1    8   1      80   1     1     5      30/60   UQYW HF
 #

 Example of INITTNCx.SYS for BPQ 4.05 (Only ONE INITTNCx.SYS) :

 A1      Number of application
 R0      Returns to node (0=No,1=Yes)
 UMAIL   Unproto MAIL
 M1      Monitor (0=No,1=YES)
 N1      Number of first stream

The parameters for other ports will be taken by default, For instance, as the
first stream of the first port is 1, the first stream of the second port will
be 9. (8 channels defined in PORT.SYS for port 1). This will be done
automatically, and the second INITTNCx.SYS should not exist.

 In FORWARD.SYS there are a few changes, here is a short example:

 A LA2D
   #
   P B
   #
   C C SWITCH       Connect first BPQ switch.
   C C 2 LA2D       Connect LA2D on port 2 of BPQ.
   #
   B LA2D
   F LA2D
   #
 ---------


For WinFBB:

If you are using WinFBB together with BPQ-code you have to copy the files

	BPQCODE.386
	BPQDLL.DLL

to the \WINDOWS\SYSTEM directory. These files are normally included in the
BPQ programpack.
After this you starts BPQ in the same way as with DOSFBB, but before starting
WINDOWS.  The best is to start BPQCODE from AUTOEXEC.BAT.

For LinFBB:

BPQ cannot be used with LinFBB....







This page was last updated 

fbb-7.0.10/doc/html/fmttheme.htm0000644000175000017500000000311613613360505013310 00000000000000 FORMAT of THEMES.SYS

THEMES.SYS

THEMES.SYS (\FBB\SYSTEM).

The file THEMES.SYS is configures the theme-zone.  The first word in 
each line is the "theme".  The rest of the words on the same line, are the
to-fields of messages that will fit in the theme.
Empty line (like the TRASH), covers all the remaining to-fields.

TRASH
COMPUTER        IBM     APPLE   MAC     AMIGA   C64     OS2     MSDOS   TRUCS   SOFTWA  UNIX    LINUX
COMMERCE        ACHAT*  VENTE*  ECH*    RECHER
SATELLITE       AMSAT   SAT*    UO22    KO23    UOSAT   PACSAT  DOVE    KEP*    SPACE
RESEAU          FPAC*   FLEX*   RMNC    THENET
DX              *DX*    VHF     UHF     HF      SHF     QSL*    EME     CONTES  PROPAG  DIPLOM  SUN
IMAGES          JPG     JPEG    GIF     IMAG*   *FAX*   SSTV
TECHNIQUE       9600    MODEM   TECHNI
TRX             YAESU   ICOM    KENWOO  ALINCO  PYE     KENW
ATV             ATV     SATTV
GAMES           JEUX    GAMES
SCOUTS          SCOUT*
DIGEST          *DIG
BBS             FBB     RLI     REBBS   MSYS    TCPIP   CLUS
TPK             TPK
ASSOCATION      REF     URC     ARRL    DARC    RASEC
EDUCATION       EDUC    ECOLE   SCHOOL







This page was last updated 

fbb-7.0.10/doc/html/fdrsi.htm0000644000175000017500000000705113613360505012610 00000000000000 DRSI-card (Appendix 5)

DRSI-card.

(Appendix 5)

 If you plan to use DRSI-card with this software, you must make some changes.
Before you start FBB, you must load the DRSI-driver that comes with the DRSI-
card. This must be TNCTSR-R or TNCTSR-L with a version-number higher or equal
to 2.1.

 The first DRSI-card (MultCh 0 and 1) must be at address 300.
 The second DRSI-card (MultCh 2 and 3) must be at address 310.
 The third DRSI-card (MultCh 4 and 5) must be at address 308.
 The fourth DRSI-card (MultCh 6 and 7) must be at address 318.

 Before installing cards in the PC, use the program CHKADDR to verify that
the addresses corresponding to the cards have a value of FF. If there is a
problem, check your configuration to find what peripheral is already using
this address. Install just one card at the time, and verify each cards
presence with CHKADDR.

 When all cards are ok, configure the driver by means of the TAILORnn program
(depending of the version). TNCTSR-S will be ok if you use only a few
channels, while TNCTSR-L should be used for big configurations, up to 32
channels.

 One problem: What DRSI calls DRSI-PORT, is what we call MultCh in FBB ! What
DRSI calls PORT, is what FBB calls port or TNC ! We always use FBB-names
here...

 Each DRSI-card works like 2 radio-ports. The first DRSI-card is always
MultCh 0 and 1, and the forth card is MultCh 6 and 7. If one radio-port is
used on HF, that port must be the second port on the card.

 All the DRSI-cards together, work like only one COM. And this COM-port does
not need to exist in the PC. You may call that port COM 7 or COM 8 and keep
free the already existing COMS.

 Baud-rate does not matter, but should be set to a standard value, to avoid
error-messages.

 Here is an example of PORT.SYS with 2 DRSI-cards (4 radios) :

 #
 #Ports TNCs
 1      4
 #

 #
 #Com Interface Address (Hex) Baud
 7    4         0            4800
 #

 #
 #TNC NbCh Com MultCh Pacl Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
 1    8    7   0      230  4     1     10     30/60   UDYW 433.650
 2    1    7   1      80   2     1     5      12/30   GDW  15/20m
 3    8    7   2      230  4     1     10     36/60   UDYW 433.650
 4    8    7   3      230  4     1     5      10/30   GDW  145.300
 #

 If you are using DRSI-card, you also must change the INITTNC1.SYS. You will
need only ONE file for all the ports.

 Example of INITTNC1.SYS that initializes 4 ports:
 MUIS
 U0
 p0 1 64 10 4 4 10 100 18000 30 2 0
 p1 1 64 10 4 1 16 100 18000 30 1 0
 p2 1 64 10 4 4 10 100 18000 30 2 0
 p3 1 64 10 4 4 10 100 18000 30 2 0




 The same goes for MAINT1.SYS, only 1 file is needed for all 4 ports, like
this:


 Y 1
 U 1 BBS ($c) was shut down for service $d $T.


 In FORWARD.SYS there is no changes. Use standard syntax.

 Well, I think that should be all (for DRSI). Oh, bye the way: DRSI cannot
limit the number of connections per radio-port. But in FBB we still can have
NbCh set to for example 1. When a station then connects to the BBS on that
radio-port, and there already is one user connected there, the BBS will send
a message to him: "Sorry, no more channels available" and disconnect him.






This page was last updated 

fbb-7.0.10/doc/html/fmtxfbb.htm0000644000175000017500000000501713613360505013131 00000000000000 Format of XFBB.SH

XFBB.SH

Only for LinFBB !

This page is under construction !


XFBB.SH (/usr/local/fbb)


This is the very first file that LinFBB will use. You will find it in 
/usr/local/fbb-directory. (or in that directory you chosen when you installed
LinFBB).  You don't really need to do any changes in this file, unless you did
some changes during the installation-process.  If you did, you must change 
the pathnames in LinFBB.SH exactly the same as you did during the installation.
This is very important ! So look for the lines that I have marked with 
an     <---      below.

This file is used to start both the deamon version and X-Windows version of 
LinFBB, to start the deamon version you should type: ./xfbb.sh -d &
in X-Windows xterm you should start LinFBB with: ./xfbb.sh

You must go to the LinFBB root directory before executing this shell
script.


#!/bin/bash
#
# Shell file to LinFBB software
#
# F6FBB 1996
#
#
# Base directory of LinFBB software
XFBBDIR=/usr/local/xfbb               <---

#
# Add local PATH
PATH=$XFBBDIR/bin:$PATH

#
# Export resource file
XAPPLRESDIR=$XFBBDIR/res

export XFBBDIR PATH XAPPLRESDIR

end_session()
{
  echo "Session of LinFBB is ended"
  exit 0;
}

maintenance()
{
  echo "Running maintenance"
  sleep 2
  $XFBBDIR/bin/epurmess > /dev/null 2>&1           <---
  $XFBBDIR/bin/epurwp 40 90 > /dev/null 2>&1       <---
}

rerun()
{
  echo "Re-running LinFBB"
  sleep 2
}

error_return()
{
  echo "Unknown return value $1"
  sleep 10
}

if [ "_$1" = "_-d" ]
then
  XFBB=xfbbd
  shift
else
  XFBB=xfbb
fi

PARAM=$*

while [ 1 ]
  do

    cd $XFBBDIR                          <---

    echo
    echo "Running LinFBB ^C to abort"
    sleep 3

    echo "Starting LinFBB ..."
    $XFBB $PARAM                         <---
    
    ret=$?
    echo
    case $ret in
      1) end_session ;;
      2) rerun;;
      3) maintenance;;
      *) error_return $ret;;
    esac
    
done








This page was last updated 

fbb-7.0.10/doc/html/fmtdsz.htm0000644000175000017500000000101713613360505013004 00000000000000 Format of DSZ.BAT

DSZ.BAT

DSZ.BAT (\FBB\BIN).

DSZ.BAT is a DOS batch file which prepares the parameters to be 
given to DSZ. DSZ mostly works using environment variables which
are set in this batch file. 

Do not change this file unless you really want to do something new !



@echo off


SET DSZLOG=%1
SET DSZPORT=%2,%3


shift
shift
shift
DSZ %1 %2 %3 %4 %5 %6 %7 %8 %9

fbb-7.0.10/doc/html/fttfwin.htm0000644000175000017500000001206313613360505013161 00000000000000 TFWIN.DLL (Appendix 30 )

TFWIN.DLL.

                           Only for WinFBB32.                               

(Appendix 30).

TFWIN.DLL.

The TFWIN.INI must be edited to match the comport configuration ie port 
speed etc. 

TFWIN.INI can also define things like txdelay for hf or highspeed ports.
It is possible to program most of the PORT specific parameters in a
INITTNCn.SYS (first TFWIN port) with "DRSI-like" P line (look at the FBB
doc for DRSI).

This is my port.sys for TfWin DLL... Think that Multch (as usual) must
match with the port number of TFWIN.INI

The TFWIN.INI is using COM1 as "port 0 (MultCh 0)"

As it is a Windows application, the com1 MUST be known (and available) from
Windows !

# FBB7.00
# File for programming of channels and TNCs.
#
# Ports : How many ports (COM1, COM2, Etc...)
# TNCs : How many TNCs and modems in use. With multiplexer
# there can be up to 4 TNCs per port.
#
#Ports TNCs
 1     1
#
#In WinFBB ONLY THESE interfaces are available:
# Interface : 2 = BPQ-node (BPQ in AA4RE-mode)
#             4 = DRSI
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD
#             6 = Windows-driver, replaces both ESS, ESSKAM and FBBIOS.
#             7 = TCP/IP.  Needs WINSOCK.DLL.  Put port-address as 17.
#                 TNC-emulation is T (see below) 
#             8 = TFWin.dll
# BEWARE: The old interface 1 and 3 will NOT be used in WinFBB.  Interface 6
#         replaces both.  (FBBCOMM.DRV).  Neither ESS nor FBBIOS can be
#         used with WinFBB !
#
#In LinFBB ONLY this interface is available:
# Interface   9 = Linux.  Can work via serial port (D),via AX25 domain
#                 socket (X) or via Telnet port (T).
#
#In DosFBB ONLY THESE interfaces are available:
# Interface : 1 = Use external COMBIOS-driver (MBBIOS, ESS etc)
#             2 = BPQ-node v 4.05 and up (BPQ in AA4RE-mode)
#             3 = Telephone-modem with FBBIOS
#             4 = DRSI card with driver
#             5 = TFPCR/TFPCX interface.  Interrupt MUST be 0xFD
#
# Address   : Address of port in hexadecimal (Needed for multiplexer).
#             In LinFBB:
#             Address is the device name (/dev/cua0).
#             Be sure you have the rights to access to the device (rw-rw-rw-).
#             When using kernel AF_AX25 socket, address is not used.
#             When using Telnet, address is the Telnet port in Hex (Hex 17 = Telnet port 23)
# Baud      : Ports baud rate. Ignored by BPQ, kernel AF_AX25 socket and Telnet.
#
# Use same number of lines as number of ports.
#
#Com Interface Address (device)   Baud
 1   8         3f8          9600
#
# TNC     : Number on TNC in use.  Use 0 for file-forward !
# NbCh    : Number of channels I want to use in the TNC.
#           Maximum available channels depend on firmware.
# Com     : Number of the COM-port. Com1, Com2 etc.
# MultCh  : Number of channel if port-multiplexer is used, otherwise 1.
#           In DRSI use values from 0 to 7, by KAM use 1/VHF and 2/HF.
#           When using kernel AF_AX25 socket in Linux, MultCh is the
#           interface name (eg: ax0)
# Paclen  : PACLEN on this TNC.
# Maxframe: The maximum nb of frames the TNC will send at a time.
# NbFwd   : Number of channels for OUTGOING forward at same time.
# MxBloc  : Size of forward-block in kb.
# M/P-Fwd : Minute of the hour for start of forward, and period
#           (how many minutes between each forward-start).
# Port mode, one of these:
#           B : BBS-mode.
#           G : "Guest"-mode.
#           U : Normal-mode.
# Type host-mode, one of these:
#           D : WA8DED
#           K : KAM hostmode.  Must use ESSKAM driver.
#           P : PK-232
#           Q : BPQ v 4.x
#           T : Ethernet/TCP-IP
#           X : AX25 domain socket (for Linux)
# Addition: One or more of these letters can be used too:
#           L : Send unproto beacon after each arriving mail.
#           M : Telephone-modem.
#           Y : Yapp allowed on this QRG.
#           W : Gateway allowed TO this QRG.
#           R : Modem port allowed in Read-only mode.
# Freq.   : Text to describe this port (max 9 characters, no space)
#
# Same number of lines as TNCs:
#
#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq
 0   0    0   0      0     0     0     0      00/01   ----  File-fwd.
 1   7    1   0      230   4     1     10     30/60   DUWY  433.650
#
# Special callsigns and modes for some channels.
#
#TNC Nbs Callsign-SSID Mode
#1    1   LA1B-1        B
#
# End of file.
#








This page was last updated 

fbb-7.0.10/doc/html/fmtems.htm0000644000175000017500000000136513613360505012776 00000000000000 EMS/XMS memory (Appendix 26)

EMS/XMS memory.

(Appendix 26)

EMS/XMS is no longer used in any version. But you need to put "1"
to allow memory cache in the BBS. It now means "memory cache" and then
allows to put the list of options which follow this line in memry to be
faster.







This page was last updated 

fbb-7.0.10/doc/html/fmterror.htm0000644000175000017500000000132313613360505013335 00000000000000 FORMAT of ERROR.SYS

ERROR.SYS

ERROR.SYS file (\FBB)

This file gives a description of the error in the BBS, as it occurs.

This file has a free format, using text. The contents are error 
reports from the software, mostly with the TNC interface.





This page was last updated 

fbb-7.0.10/doc/html/fmtnewdo.htm0000644000175000017500000000340713613360505013325 00000000000000 NEWDOC-server

NEWDOC server.

 The NEWDOC server allows a simple and fast update of the documentation
database (topic DOCS of the server). This server will create the file and
will give it a label. It will not create a directory if it doesn't exist.
Therefore it is necessary to prepare the directory tree structure before.

 A message will give a summary to the originator.

 The standard command line for messages is used. The message should be of
type private and addressed to the BBS which will be updated.

 SP NEWDOC @ bbs-destination

 The message title contains two information , the name of the file requested
followed by the label to give to the file (see the description of the topics
DOCS).

 Filename Label eventually on several words.

 The text of the message will be transferred in the documentation file.

 Example :

 F6FBB BBS >
 SP NEWDOC @ F6ABJ.FRA.EU
 Title of message :
 BBS\DOC_1.DOC This is the label of the documentation.
 Text of message :
 This is the content of the documentation.
 ....
 End of documentation.
 /EX

 This example assumes that the BBS is a subdirectory of DOCS, thus one of the
topics of the documentation.

 If the NEWDOC.SYS file is specified, the server will be limited to the
callsigns declared in this file, one callsign in each line.

 Example of NEWDOC.SYS file :

 F6FBB
 FD1CDC








This page was last updated 

fbb-7.0.10/doc/html/doccopyr.htm0000644000175000017500000000206713613360505013325 00000000000000 Copyrights

Copyright.

This software is delivered at no cost and is free of all charges. It can be freely copied or installed for any HAM-RADIO application. Any other usage for commercial, professional, or industrial purposes is forbidden.

 Despite the free sharing nature of this product, a participation to the
investment and to the mailing cost at the level of 100 FF or 20 US Dollars
(or more) would be most welcome.

 The author can be contacted by email or at the following address:

 Jean-Paul ROUBELAT
 6, rue George SAND
 31120 ROQUETTES
 FRANCE

 Email: f6fbb@f6fbb.org







This page was last updated 

fbb-7.0.10/doc/html/fmtyapex.htm0000644000175000017500000000472313613360505013341 00000000000000 Yapp-protocols extension (Appendix 19)

Extensions to YAPP-protocol.

(Appendix 19)

 These extensions are used in TPK 1.65a (and up) and FBB 5.14 and up.

HEADER extension.

 The header now carries the DATE and TIME of the file being transmitted.
[SOH] [Len] [Filename] [NUL] [File Size] [NUL] [Date] [Time] [NUL]

 The Date and Time are the values reported by DOS, coded in 4 hexadecimal
digits and are sent in ASCII (8 characters).

 The receiver has the choice of using either extended Yapp with checksum or
normal Yapp.

 The normal Yapp reply is RF, as before and the receiver can keep the date
and time information .

 The extended Yapp reply is : RT  Receive_TPK  and is coded : [ACK] [ACK]

 If the receiver reply is RT the protocol used will be what I have called
YappC for Yapp with checksum. When the sender gets this packet he MUST use
YappC.

Data Packets extension.

 If the receivers reply is RT the protocol used will be YappC. The checksum
allows detection of packets corrupted along the link, particularly on the
RS232 lines where there is no error control or correction (or it's very
poor!)

Data packets : [STX] [Len] [Data] [Checksum]

 Checksum is the sum of all data bytes anded with FF in 8 bits like Xmodem.

 If the checksum is bad then the receiver must send a Cancel and enters CW
state.

Crash Recovery.

 A new field has been added to the resume reply to tell the sender if the
receiver can use YappC or not. Resume is sent instead of RF (or RT).

 Resume reply for Yapp: (as used before by TPK and FBB)

    [NAK] [Len] [R] [NUL] [Received Length] [NUL]
            I    I                I
            I    I                +-- in ASCII as in the header
            I    +-- as Resume !
            I
            +------- len of the following bytes

Resume reply for YappC:

    [NAK] [Len] [R] [NUL] [Received Length] [NUL] [C] [NUL]
                                                   I
                 Tells sender I can use YappC -----+

 When the sender gets this packet then he must also use YappC.







This page was last updated 

fbb-7.0.10/doc/html/fmtfilfi.htm0000644000175000017500000000251013613360505013274 00000000000000 File filtering (Appendix 21)

File filtering.

(Appendix 21)

 There is a possibility to filter files that are uploaded to the BBS.  This
is done by a F_FILTER program.

 The F_FILTER may also be created as a DLL.  Both for WinFBB and DosFBB (!!).
The filter must be installed in the path (\FBB\BIN) of Dos.

 If the F_FILTER exists, the temporary file is no longer deleted by WinFBB 
(unless return value from F_FILTER is 0), the filter must decide what to do. 

 F_FILTER receives as parameter a file in which are given information such 
as asked filename and label. If F_FILTER returns 0, then the file is normally
recorded (and the temporary file is deleted), else nothing is done by FBB. 
The text returned by F_FILTER will be sent to the user. So an archive may be 
compressed, scanned, and a report may be sent to the user. This can be done 
in real time or delayed. 






This page was last updated 

fbb-7.0.10/doc/html/fmt_afne.htm0000644000175000017500000001400113613360505013251 00000000000000 Drivers and phone-modem

Async port drivers and telephone modem.

You may need several external drivers for your BBS.  

For WinFBB:
FBBCOMM.DRV
BPQ

For LinFBB:
AF_AX25 domain socket  
AF_NETROM domain socket
AF_ROSE domain socket  
It is necessary to compile the Linux Kernel with SLIP (serial line).

For DosFBB:
ESS.COM 
ESSKAM.COM
FBBIOS.COM 
BPQ
TFPCX/TFPCR

Installation of a TELEPHONE MODEM. 


FBBCOMM.DRV:  (Only for WinFBB)

The port-driver FBBCOMM.DRV is installed in Windows during the installation-
process of WinFBB.  

FBBCOMM.DRV is automatically installed in your Windows as you install WinFBB
from the diskette.  So there is nothing for you to do.  The driver is 
automatically installed into your SYSTEM.INI in the [boot] section as 
comm.drv=fbbcomm.drv.  If in doubt, you may want to check this.


ESS.COM:       (Only for DosFBB)

 ESS is an async port driver optimized for FBB software. It can drive either
TNC2/PK232/clones or KAM.

 This small device driver is loaded as resident at the beginning of the
machine initialization (TSR).

 One ESS handles one serial line and makes use of one IRQ.

 The COM number, the address of the serial interface and the IRQ number are
given as parameters appended to the command line. The address should be given
as a FOUR digit hex number.

 Example : Install ESS for COM1 at hex 03F8 and using IRQ 4 :
 ESS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus ESS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device in the machine. On a PC the IRQ's can not usually be
shared.

 Should there be more than one port to handle, several ESS can be cascaded.
The IRQ should be different for each ESS, except for the case in which the
interrupt sharing is supported by the serial card used.

 Example :

 ESS 1 03F8 4
 ESS 2 02F8 3

 This sequence will load ESS's for COM1 and COM2.

 ESS accommodates also the muxing arrangement of serial ports.

 Version 1.08 of ESS-driver (included with DosFBB distribution)
 must be used with the MUX ! 


ESSKAM.COM:    (Only for DosFBB)

ESSKAM works exactly as ESS.COM, but only for Kantronics Kam TNCs.


FBBIOS.COM:    (Only for DosFBB)

 FBBIOS is a serial line driver dedicated to the usage of a PSTN modem.
Binary as well as ASCII file transfer are supported with the XMODEM protocol.

 FBBIOS handles one serial line, one IRQ is required. The COM number, the
address of the serial interface and the IRQ number are given as parameters
appended to the command line, the address should be specified in FOUR hex
digits.

 Example : Install FBBIOS for COM1 at hex 03F8 and using IRQ 4 :
 FBBIOS 1 03F8 4

 If only the COM number is specified, the address and the IRQ will default to
the standard DOS value. Thus FBBIOS 1 would have had the same effect than the
example.

 Any address or IRQ number can be specified. Carefully check that the address
and the IRQ number match the board you intend to use, special attention
should be given to the IRQ number which should not already be used by another
peripheral device.

 On a PC the IRQ's can not usually be shared.

 If the modem in use is at the HAYES standard, FBBIOS can modify the line
speed according to the one of the incoming call connection. In this case the
parameter 'A' should be appended to the command line to activate this
feature. This is not true with some buffered modems using a junction with a
settled speed.

 Example : FBBIOS 1 03F8 4 A

 Upon receipt of the string CONNECT 1200 or CONNECT 2400, the driver will
adjust its speed to the incoming call.

 From version 1.30, FBBIOS.COM can run up to 56 KBauds. Be sure that your
computer is fast enough !


AF_AX25 domain socket    (More in appendix 23)
  AF_NETROM domain socket  (More in appendix 23)
  AF_ROSE domain socket    (More in appendix 23)
  (Only for LinFBB)

Standard kernel AF_AX25, AF_NETROM and AF_ROSE sockets
AX.25, NET/ROM and ROSE protocol are built into the Linux kernel.

I recommend to use these interfaces, because it will give you
more flexibility to build a system with many futures..






This page was last updated 

fbb-7.0.10/doc/html/finittnc.htm0000644000175000017500000000376213613360505013324 00000000000000 FORMAT of INITTNCx.SYS

INITTNCx.SYS


INITTNCx.SYS (\FBB\SYSTEM).

 This file is also in the SYSTEM-directory. When the BBS starts, it sends
some standard parametres to the TNC, like PACLEN, MAXFRAME etc. These
parametres are in PORT.SYS. But in addition to this we may send some more
parametres to each TNC. We send parametres to TNC 1 with the INITTNC1.SYS, to
TNC 2 with INITTNC2.SYS etc. Here is just one example from LA1B BBS : (you do
not need to use the same parametres)

 C MAIL v LA7QR
 U 0
 N 10
 M IU
 P 64
 T 40

 C MAIL V LA7QR means that unproto mail-beacon will be sent to MAIL via the
digipeater with callsign LA7QR. You may use just C MAIL if you do not want to
send via digipeaters. U 0 means that the TNC will not send any TNC-message to
user when he connects to the BBS. You should use this parametre.

 N 10 means that RETRY will be set to 10.

 M IU means that that all I and UI frames will be shown in monitor-windows. P
64 means a p-persistence value of 64. This is normal.

 T 40 sets a TXDELAY of 40. This value depends on Transceiver in use. So, you
can use any suitable parametres in this file. You need one file for each TNC.

 The commands sent to the TNC, are the commands described in the
documentation for the firmware you use, or in the documentation for PK*-232,
DRSI, BPQ etc.

 If you are using BPQ, DRSI, PK-232, KAM or TFPCX/TFPCR, look in the appendix
for special commands for them.






This page was last updated 

fbb-7.0.10/doc/html/fmtwfbid.htm0000644000175000017500000000270313613360505013302 00000000000000 FORMAT of WFBID.SYS

WFBID.SYS

WFBID.SYS (\FBB\SYSTEM).


 This binary file holds the last received BIDs. The number of records of this
file is defined in the INIT.SRV file. This file is very important and must
not be edited or changed otherwise the list of the messages could be lost.
This file can only be opened for reading.


 It is organized with records, each record containing information on a BID.
This is a circular file and the first record of the file contains the pointer
of the last overwritten record in the msg_number field. Never modify this
file while the BBS is running.

 Structure of one record (C language) :

typedef struct {

  char  mode         ;  /* 1   Type of message (A,B,P,T)       */
  char  fbid[13]     ;  /* 13  BID of the message              */
  long  msg_number   ;  /* 4   Number of the message           */

} bidfwd             ;  /* 18  bytes = length of one record    */

In C language, all strings are ended with a NULL (00 hex) character.






This page was last updated 

fbb-7.0.10/doc/html/fmtoptio.htm0000644000175000017500000000230413613360505013336 00000000000000 FORMAT of OPTIONS.SYS

OPTIONS.SYS

OPTIONS.SYS (\FBB\SYSTEM)

This file holds the different options of the software. Each option 
is defined as an integer (2 bytes).

struct {

int beep            ; /* 2  Connection beep validated        */
int ok_chat         ; /* 2  T command allowed                */
int ok_disp         ; /* 2  Indication of channels           */
int separe          ; /* 2  Position of the split line       */
int split           ; /* 2  DOS screen is splitted           */
int gate            ; /* 2  Gateway validated                */
int justif          ; /* 2  Justification validated          */
int upd_fwd         ; /* 2  Message list is being rescanned  */
int sed             ; /* 2  Internal screen editor validated */

};





This page was last updated 

fbb-7.0.10/doc/html/fmtmess.htm0000644000175000017500000000152413613360505013156 00000000000000 FORMAT of MESS.WP

MESS.WP

MESS.WP file (\FBB\SYSTEM\WP).

The MESS.WP file is an ascii file composed of standard WP update lines. It
has no size limit and will be sent as messages to the different routes
defined for WP updates in INIT.SRV. The outgoing messages will be truncated
to 5Kb sections if required.

This file is read at the end of the BBS start-up.







This page was last updated 

fbb-7.0.10/doc/html/toolfv.htm0000644000175000017500000000161213613360505013007 00000000000000 Tool: FV

FV.COM

FV.COM is a small program used by the BBS when a user sends the 
"View (filename)" command. 

View contents of ARC, DWC, LBR, LZH, PAK, ZIP, ZOO files.

  Usage:  FV [d:][\path\]filespec[.ext] [specs] [/p] [/b] [/w] [/r] [/c] [/x]

  Where:  /P pauses after each screenful
          /B suppresses display of d:\path
          /W for wide display
          /R update file date
          /C displays comments
          /X convert sfx to archive






This page was last updated 

fbb-7.0.10/doc/html/fmtlog.htm0000644000175000017500000000651013613360505012770 00000000000000 FORMAT of FBBLOG.nn

FBBLOG.nn

FBBLOG.nn File (\FBB\SYSTEM\LOG).

 Most of the executed commands are recorded in the file FBBLOG.nn - n is the
number of the week. This yields a weekly archive which is not of a too big
size.

 This file will be updated if the line "Complete Log" of the file INIT.SRV is
"OK".

 It is an ASCII file which is automatically created, and does not request any
special care. This single file keeps the activity record for all ports
together.

 All the lines begin with a string of figures, corresponding to the month,
day, hour, minute and second of the trace, followed by the channel number,
then the executed command.

 A stats analysis software, LOGSTAT.EXE allows the processing of the log file
(see 13.xxx).

 FBBLOG file sample :

 043004460500SI *** BBS Initialize
 043004483200SA *** BBS Online
 043004483305CB FC1NOU-0 VIA F6FNL-5
 043004483905XD
 043004484705CB FC1NOU-0 VIA F6FNL-5
 043004500905MR 64072
 043004511405XB
 043005003201CA F1EBV-14
 043005012816CC F1EBV-1 VIA FE6BEX-8 {FC1BPS-7,F1EBV-7,FF6KQK-2}
 043005020701MW 64081P F:FC1GQL T:FE1JNY@F6DEG [281] S:F6CQP
 043005022816MN B:19226_FF6KNL V:F1EBV
 043005424401M> 62893 V:F1EBV [2881]
 043005463616MN B:4759_EA6RCM V:F1EBV
 043005463616MF 62896 V:F1EBV [393]
 043005470813CC FC1HAQ-1 VIA F6FBB-7,019101
 043005481701M> 62897 V:F1EBV [872]
 043005485816MF 62897 V:F1EBV [872]
 043005510701M> 62898 V:F1EBV [815]
 043005514516MF 62898 V:F1EBV [815]
 043005522901M> 62901 V:F1EBV [398]
 043005530516MN B:26051_FC1HAQ V:F1EBV
 043005530616MF 62901 V:F1EBV [398]
 043005533313MW 64084B F:DF9WM T:ALL@EU [1161] S:Address Needed
 043005572701M> 62931 V:F1EBV [2728]
 043005580113XD
 043005584516MF 62931 V:F1EBV [2728]
 043006003012CB F6CDD-1
 043006211401XT
 043006303216CC FC1HAQ-1 VIA F6FBB-8,019101
 043006323016MF 64081 V:FC1HAQ [281]
 043006340716MF 64082 V:FC1HAQ [830]
 043006354116M< 64086B F:DK3GI T:DXNEWS@EU [953] S:BY4AA in RTTY
 043006443216M< 64089B F:OZ2FAR T:ALL@WW [1895] S:re qrt
 043006452112CB F6CDD-1
 043006465112MF 64086 V:F6CDD [953]
 043006465212MF 64087 V:F6CDD [2632]
 043006465312MF 64088 V:F6CDD [1626]
 043006465312MF 64089 V:F6CDD [1895]
 043006465412XB
 043006474016M< 64090B F:VS6XQF T:ALL@WW [1748] S:CRY FOR TR-9500
 043006490316M< 64091B F:DJ0AW T:ALL@WW [972] S:mfj-1278
 043006534816M< 64092B F:DB2OS T:KEPLER@WW [3684] S:Elements 118.
 043007002612CB F6CDD-1
 043007005516M< 64095B F:VK5CGB T:ALL@WW [1166] S:RNARS PACKET
 043007022116M< 64096B F:DF7MX T:COMMOD@EU [913] S:SUPPORT
 043007034316M< 64097B F:I1ZEU T:ALL@EU [1096] S:ID1V
 043007065416SQ *** BBS Quit


All Xx lines in log are deconnections (eXit)
XI Invalid callsign
XE Excluded callsign
XB is normal disconnection by the BBS (after a B command for instance)
XT Time-out disconnection
XF Forced disconnection (after a XI or XE)
XM Too many errors
XP Password error (modem)






This page was last updated 

fbb-7.0.10/doc/html/doctrick.htm0000644000175000017500000001044013613360505013277 00000000000000 Tricks and tips (Appendix 8)

Tricks and tips.

(Appendix 8)

 This rubric is yours, more than mine. I'll try to insert there all tricks
you will tell me.


Only for DosFBB:
Using DesqView (c).
-------------------
 There is no particular problem when using DesqView. The minimum window size
is 500 KB. You MUST use communication drivers, like ESS, COMBIOS or MBBIOS,
as the software does not dispose of the whole process time.


Communication errors displaying.
 -------------------------------
 An error counter can be displayed 
in WinFBB: after the word "Resync" on the screen
in DosFBB: just right of the date, on the first line of the screen.
If you are using TNC2 with WA8DED software, these errors can be minor, but
with PK232, error recovery is more difficult, and the system may reboot.

 With a correct operation of your system, this counter will not appear, or
exceptionally. If errors are displayed, they can result from :

 - Using DOS 4.0 or 5.0 : The keyboard driver of these versions is very slow.
You must use the ESS driver for RS232 (or COMBIOS).

 - A too hight baudrate, or RS232 defective cables. The baudrate can be
selected down to 4800 Bds. It is not a good idea to go down 4800 Bds, as the
performance of the software should be lower.

 - Change the LM324 fitting out some TNC RS232 line drivers by a TL074 or
TL084.

 - HF detection in the TNC. Errors and resynchronizations will appear when
the transmitter is running. There is no real cure, you must investigate.

 You can also use communication drivers like ESS, COMBIOS or MBBIOS if you
are not still using them.


Repeat the last message number.
--------------------------------
 The last message number displayed, read, killed, etc... can be utilized
again with the # (pound) character. This short-cut allows as for an example
to read a message after a list or to suppress it just after its reading.

 Example :

 F6FBB BBS > R 12351
 The message is displayed ...
 F6FBB BBS > K #
 Message #12351 killed.
 F6FBB BBS >


Problems with BPQ running as a Node ! (OZ1CBQ)
-------------------------------------

If you are using BPQ running as a node together with FBB you may have problems
if your node ar linked to other nodesystems as TheNet, TheNetNode, X-net,
RMNC, FlexNet, etc.

BPQ seems to have a compatibility problem with these nodesystems causing some
hangups during incoming connects via the nodesystem.
The problem starts with lowering the available buffers and at last the 
system is hanging until a reboot has been done.
Only cure for the time being is to run BPQ as a SWITCH only without nodeupdate
(NODE=0 in BPQCFG.TXT) only allowing level_2 traffic.

This brings another problem:
When FBB runs together with BPQ running as a level_2 switch, it is only 
possible to have outgoing forward on two channels at the time.
One channel using the callsign and one channel using the alias as first call
in the forwardfile.

Example 1.st outgoing forward channel:

C C SWITCH
C C 1 OZ7BOX-2    ; Callsign of the BPQ-switch
C C ....          ; Other connects

Example 2.nd outgoing forward channel:

C C SWITCH
C C 1 ESBOX       ; Alias_name of the BPQ-switch
C C ....          ; Other connects


PMS forwarding:
---------------

In INIT.SRV there is a flag 128 in the FBB-type-forward section.  If this flag
is set, only PMS-users that have been declared with the F-flag in the EU-command
(Edit User) will be able to up/download messages to/from the BBS.  The same
users should also have the U flag set (in EU-command) to enable them to send
unproto resync requests to the BBS.


Display looks wrong (Only WinFBB):
----------------------------------

If you get a wrong display of the windows of WinFBB, halt the software,
delete windows\winfbb.ini and rerun the software.









This page was last updated 

fbb-7.0.10/doc/html/fmtsat.htm0000644000175000017500000000141313613360505012773 00000000000000 FORMAT of nnnnn.SAT

nnnnn.SAT

nnnnn.SAT (\FBB\SYSTEM\SAT)
(Satellite characteristics).

 The nnnnn.SAT  files  (where  nnnnn  is  the  NASA  catalog  number for the
satellite) will be displayed when the command C will be typed from the
satellite menu. They are text files and are located in the SAT subdirectory.







This page was last updated 

fbb-7.0.10/doc/html/toolinst.htm0000644000175000017500000000552713613360505013362 00000000000000 Tool: INSTxFBB

INSTWFBB.COM (for WinFBB)

INSTALL.SH (For LinFBB)

FBBSETUP.EXE (for DosFBB)

(replaces the old INSTAFBB.COM)

INSTWFBB.COM: (Only for WinFBB)
This program is a full-screen configuration of INIT.SRV and PORT.SYS.
This program has its own program-icon, and can be started by double-
clicking that icon.  Most of the commands are self-documented. 
You must only follow the instructions.  The changes in INIT.SRV can be
done without rebooting the BBS, but changes in PORT.SYS will not affect
the BBS until after a reboot of the BBS.

INSTALL.SH: (Only for LinFBB)
This is a configuration-program for LinFBB.  It will configure the most 
important parts of the file INIT.SRV.  Mind you, you will need to check 
the rest of INIT.SRV manually, too !

FBBSETUP.EXE: (Only for DosFBB)
This program is a full-screen configuration of INIT.SRV and PORT.SYS. 
Most commands are well documented. You must only follow the instructions.
FBBSETUP will support multiple language files in same format as ENGLISH.OLH 
and ENGLISH.MNU if the DEFAULT.OLH and DEFAULT.MNU files do not exists 
(after a language is selected,  the files become the DEFAULT.XXX files).
Files normally belonging to FBBSETUP are:
FBBSETUP EXE     
ENGLISH  OLH     
ENGLISH  MNU     
DEFAULT  OLH     
DEFAULT  MNU     
The DEFAULT files may first be created after the first run of FBBSETUP.
All files will normally reside in \FBB\BIN directory.


For all the above versions:

If the INIT.SRV file does not exist, you will be prompted to create a new
one. Be sure that you are in the FBB directory when running FBBSETUP.EXE.

If the INIT.SRV is not of the right version, you will also be prompted, but
be careful, as the results could be hazardous.

The comments of the original file are not changed.







This page was last updated 

fbb-7.0.10/doc/html/toolcut.htm0000644000175000017500000000257013613360505013173 00000000000000 Tool: CUT

CUT.COM

 Utility allowing to peak a part of a file and copy or append it to another
file. The format is :

 CUT From-file To-file length offset [/A]

 To-file will have added up to length bytes of From-file, starting at offset.
If the switch /A is specified, then datas will be appended to To-file,
otherwise To-file will be replaced.

 This small utility is useful to take parts or file, or to do copy/paste
with either binary nor ascii files.

 Together with the specification of the offset in the XGET command, in case
of crash, first note the amount of datas already received (ie : 50300), save
the part of the file already received, and then ask "XGET filename 50000".
The transfer will start at offset 50000 and then you will be able to receive
the end of the file. The paste the two parts, either with COPY command or
with the CUT command. It is more secure to cut the first received part before
as the last bytes should be garbaged.







This page was last updated 

fbb-7.0.10/doc/html/docdocut.htm0000644000175000017500000000416113613360505013304 00000000000000 Documentations

DOCUMENTATION-server.

 You will find under these comments the information or documentations given
by various hams.

 The documentation is organized like the image of a tree structure whose root
is defined in INIT.SRV (C:\DOCS). The directories represent the topics and
the files represent the documentation.

 The selection of the topics or the documentation is made through numeral
command. The menu is presented with the form of one or several numbers
followed with their description (topics or documentations).

 In the case of topics, the description corresponds to the name of the MsDos
directory. This name is eleven characters long, the dot between the name and
the extension will not appear. It is possible also to simulate the space
character with an underscore character.

 In the case of documentation files, a label of 30 characters is associated
to the name of the MsDos file. The label only will be presented to the user.
To optimize the fill up of the screen, each line will contain two labels.

 In the case of a user, given the right of SYSOP, the display will be
different. One line will contain only the name of the MsDos file followed by
its label.

L: L gives the list of the documentation on the current chapter.

D: Labelling of the files is made by the command D, reserved to SYSOP, or
   automated through the NEWDOC server (See paragraph SERVERS, NEWDOC).
   Example : D BBS.DOC Documentation of the BBS.

F : Switches back to the Server main menu.
B : Quit and Disconnect.






This page was last updated 

fbb-7.0.10/doc/html/fmtdirme.htm0000644000175000017500000000465213613360505013314 00000000000000 FORMAT of DIRMES.SYS

DIRMES.SYS


DIRMES.SYS (\FBB\SYSTEM).

 This binary file holds the information on all active messages. This file is
very important and must not be edited or changed otherwise the list of the
messages could be lost. This file can only be opened for reading.

 It is organized with records, each record containing information on a
message. The first record of the file only contains the number of the last
message. Never modify this file while the BBS is running.

 Structure of one record (C language) :

 #define NBBBS 80
 #define NBMASK NBBBS/8

 typedef struct {

   char type         ;  /* 1   Type of message (A,B,P,T)       */
   char status       ;  /* 1   Status of message ($,A,F,K,N,Y) */
   long numero       ;  /* 4   Number of the message           */
   long taille       ;  /* 4   Size of message in characters   */
   long date         ;  /* 4   Date of message                 */
   char bbsf[7]      ;  /* 7   Adjacent BBS giving the message */
   char bbsv[41]     ;  /* 41  Route                           */
   char exped[7]     ;  /* 7   Destination of the message      */
   char desti[7]     ;  /* 7   To field                        */
   char bid[13]      ;  /* 13  BID or MID                      */
   char titre[61]    ;  /* 61  Title of message                */
   char free[16]     ;  /* 16  Reserved bytes                  */
   long datesd       ;  /* 4   Date of the message creation    */
   long datech       ;  /* 4   Date of last status change      */
   char fbbs[NBMASK] ;  /* 10  Mask of BBSes to forward to     */
   char forw[NBMASK] ;  /* 10  Mask of BBSes already forwarded */

} bullist            ;  /* 194 bytes = length of one record    */

 A null type of message (00 hex) invalidates the record.

 Dates are given as the number of seconds since january 1st, 1970 00:00.

 Masks are bit fields, number of bit corresponds to the number of the BBS in
the BBS.SYS file.

In C language, all strings are ended with a NULL (00 hex) character.






This page was last updated 

fbb-7.0.10/doc/html/fmtyappl.htm0000644000175000017500000000225613613360505013337 00000000000000 FORMAT of YAPPLBL.DAT

YAPPLBL.DAT

YAPPLBL.DAT (\FBB\SYSTEM).

This is a binary file which holds the informations of the FbbDOS files.
Do not edit or change this file, otherwise files of FbbDOS could be
hidden or lost.

#define LABEL_FIC 80
#define LABEL_NOM 40
#define LABEL_OWN 8

typedef struct {
	char	nomfic[LABEL_FIC] ; /* 80 Filename (virtual path of FBB)  */
	char	label[LABEL_NOM]  ; /* 40 Label of the file               */
	char	owner[LABEL_OWN]  ; /* 8  Callsign of the owner (no ssid) */
	long	index             ; /* 4  Number of uploaded file (from 1)*/
	long	date_creation     ; /* 4  date of the file creation       */
	char	free[24]          ; /* 24 unused (padded with NULL)       */
} Rlabel ;      /* 160 bytes */






This page was last updated 

fbb-7.0.10/doc/html/fmtmemo.htm0000644000175000017500000000262613613360505013150 00000000000000 FORMAT of MEMO.SYS

MEMO.SYS

MEMO.SYS (\FBB\SYSTEM).

This file was designed for DosFBB and works fine there.  See comments on use
with WinFBB at the end of this file.

 This ascii file will substitute a text when pressing CtrL-F1 to Ctrl-F10. 
This text can hold variables and is limited to 255 characters. It can 
include $W variable (CR) and then will be formatted as more than one line.

 This file will have 10 lines, the first line corresponding to Ctrl-F1, and
the last one to Ctrl-F10. If a line is not used, it must have a dot in first
column.

 Example of MEMO.SYS file :

$W$O BBS (FBB$E) in $c ($?).$W
.
.
.
.
.
.
.
$W  Vy 73. Jean-Paul, F6FBB @ F6FBB.FMLR.FRA.EU$W$W/EX$W
$W  73 Qro. Jean-Paul, F6FBB@F6FBB.FMLR.FRA.EU$W$W/EX$W

In WinFBB this does not work the same.  It works only in the editor,
and only Ctrl-F2, Ctrl-F3, Ctrl-F5 to Ctrl-F9 works.  The rest are 
captured by Windows itself.






This page was last updated 

fbb-7.0.10/doc/html/fmtswapp.htm0000644000175000017500000000333713613360505013345 00000000000000 FORMAT of SWAPP.SYS

SWAPP.SYS

SWAPP.SYS (\FBB\SYSTEM).


 This file will reside in SYSTEM-directory. This file is used for
automatically re-route messages. This file normally changes the @BBS-address,
but can also change the TO-field. You might not need so many callsigns etc.
here, but you should make one line with only your callsign after the @. In
that case the @BBS will be removed from messages to users in your own BBS.
For the first tries, it is enough to have one line starting with @, and then
your BBS-callsign. You can fill in the rest later.

##########################
# SWAPP.SYS for FBB 7.00 #
#  for LA6CU by LA6CU    #
##########################
#
# File SWAPP.SYS is used to change @BBS-adresses, to-adresses etc
# > changes to-callsign
# < changes from-callsign
# @ changes @BBS
# Combinations also allowed, like      > LA8AK @ OZ2PAC.
#
# Other possibillities (recommended) is to delete own  @BBS.  That is done
# by putting own BBS-call in first column.
#
# Swapping may use hierarchy. For instance :
# @ F6FBB.FRA.EU @ F6FBB.FMLR.FRA.EU
#	Only the first full address will be swapped to the other
# @ F6FBB @ F6FBB.FMLR.FRA.EU
#	All F6FBB addresses will be swapped to the other
#
@ LA8AK LA9K
@ LA5IV LA9K
@ LA6XXX
@ HF EU
@ WWW WW
@ HFNET WW
@ LA9WO LA9H
@ TEST






This page was last updated 

fbb-7.0.10/doc/html/docnomen.htm0000644000175000017500000000350113613360505013277 00000000000000 Nomenclature server

Callsigns-directory.

 You will find in this module the information that the users will have
accepted to leave there: name, first name, address, phone number, etc...
You will be able, as well, to update your own various information.

N : Modify your name and address.
R : Search for information about a user.
I : List the connected callsigns.
N : Modify your name and address. If the information in the file is
    erroneous, or should they have changed, you can modify them with this
    command. A space or a return as an answer to the question will not 
    modify the content. If  the  content  of  the  file  is  correct,  
    you can skip modification by replying N to the modification request.
R : Search for information about a user. If the user is known in the file,
    you will get information about him. You can concatenate the callsign
    of the user who is searched for behind the command.
    Ex.: R F6FBB will give information about F6FBB.
I : List the callsigns of the users who are connected the server. This 
    list is sorted in an alphanumeric order.

F : Switches back to the Server main menu.
B : Quit and Disconnect.





This page was last updated 

fbb-7.0.10/doc/html/toolsatu.htm0000644000175000017500000001237713613360505013362 00000000000000 Tool: SATUPDAT

SATUPDAT.EXE

 SATUPDAT.EXE will read messages from AMSAT copied via packet radio. This is
the english version of AJOURSAT.EXE. This software was developed by F6BVP.

 It extracts keplerian elements both in NASA and AMSAT formats and updates
the results into the satellites data base of the F6FBB's BBS (SATEL.DAT)

 Loading SATUPDAT without arguments will print the following message on your
screen (between lines -----):

 ------------------------------------------------------------------
 Automatic update of satellites orbital parameters for F6FBB's bbs Version
1.77e - June 1991 - Bernard Pidoux, F6BVP

Usage: SATUPDAT [file name<.txt>] </option> </option>

 Reading option:
  /a AMSAT format (default)
  /n NASA format

 Update option:
  /f merging new and old data (default)
  /u update only satellites present in the

 data base
  /s keep only satellites present in the input file

 <<767 satellites maximum>>
 ------------------------------------------------------------------

 This version 1.77e verifies checksum both for AMSAT files and NASA files.
For automatic update of keplerian elements into F6FBB's bbs just create a
virtual BBS into BBS.SYS file. Its name could be AMSAT for example.

 Then declare the following forward in the file FORWARD.SYS :

 A AMSAT
 *
 G AMSAT
 P @
 C C:\FBB\SYSTEM\SAT\AMSAT.TXT
 *
 ------

 CAUTION: The name of the disk unit and the path name should be the exact one
of your configuration.

 In order to run automatically SATUPDAT when your computer boots, you must
modify the batch file like the following example:

In WinFBB (file RUNFBB.BAT):

maint  ********************** START of MAINT script **************************
  cd %fbb%
    @echo off
    cd %fbb%\system\sat                                        
    if not exist amsat.txt goto amsatend
    satupdat amsat.txt /n > satupdat.res
    satupdat amsat.txt >> satupdat.res
    del amsat.txt
:amsatend
   cls
   echo
cd %fbb%

In LinFBB :(There is no SATUPDAT for LinFBB yet..)

In DosFBB (file APPEL.BAT):
 :direct
 if not exist c:\fbb\system\sat\amsat.txt goto appel
 cd \fbb\system\sat
 satupdat amsat /n > satupdat.res
 satupdat amsat >> satupdat.res
 del amsat.txt
 cd \fbb
 :appel
 echo Running the BBS ^C for stopping
 sleep 3
 serv -t
 if errorlevel 2 goto direct
 if errorlevel 1 goto suite
 :suite

 (Once again be careful with the disk name and directories !)

 SATUPDAT OPTIONS:

 The default extension for input file is .TXT, however you can specify
another extension.

 Both arguments after the filename in the command line are optional: the
first one indicates the reading format, either the AMSAT format or the NASA
"2-line" format. The first one is selected by default.

 The second option is for the choice of update mode. By default the program
will merge the old list with the new one (same if you select option /f). Old
data of satellites which are not present in the input file are kept as is and
the other one are updated.

 Option /u can be selected if you don't want to add new satellites to the one
already present. Only keplerian elements from known satellites are updated.
This prevents the list to grow with incoming satellites that you are not
eventually interested in.

 Option /s, on the contrary, gives you the possibility to keep only in the
data base the data from the satellites whose name is in the input file.

 This can help you to suppress old satellites from the data base.

 In all cases the program takes care of the permanent data of satellites such
as the frequency (for doppler) and the step for computing the tracking (you
must provide both manually only the first time).

 If the keplerian elements of the input file are older than the one already
present in the BBS data base, the old one are kept.

 The list is sorted by name in order to help the finding of the satellite
name when someone is connected to the BBS.

 If elements for one satellite are duplicated in the input file, the program
will look again for the newest data.

 Of course, if CRC computed by the program is not the same as the one in the
input file, the program informs you that the CRC is BAD and it does not take
the keplerian elements.

 In the batch file example given above you have certainly noticed that I call
twice the program SATUPDAT with two different format arguments. The first
time I ask the program to read the NASA format and the second time to read
the default format AMSAT. The reason is that the probability for an error to
occur in both formats for the same satellite is very small. Thus if an error
occurs in one format the program will complete the update when he will found
unaffected keplerian elements in the other format. Thanks to the recently
adopted checksum by AMSAT!







This page was last updated 

fbb-7.0.10/doc/html/doccstat.htm0000644000175000017500000000275513613360505013313 00000000000000 Connection-statistics

CONNECTIONS-statistics.

Statistical data about the operation of the Server and the Traffic Log.

O : Activity of the different groups. Percentage of usage for the 
    different activities.
G : Global statistics.
    - Number of active messages.
    - Number of connections.
    - Time of connections.
    - Peak traffic periods.
L : Lists the connections (Traffic Log). For each and every connection,
    the channel - callsign - date and time - as well as the connection
    duration are indicated. These informations are listed in reverse
    chronological order.
H : Hourly usage.
J : Daily usage.
I : Users Callsign list.
    List of the callsigns that have connected the server. This list is 
    given in alphanumeric order.

F : Switches back to the Server main menu.
B : Quit and Disconnect.






This page was last updated 

fbb-7.0.10/doc/html/fmtunpro.htm0000644000175000017500000000662313613360505013357 00000000000000 Unproto messages (Appendix 18)

Unproto message lists.

(Appendix 18)


 FBB software allows sending unproto lists of message. This is validated
separately on each port (letter L in PORT.SYS). Unproto address is FBB with
the following header :

fm F6FBB-1 to FBB ctl UI

 An unproto list line is sent on every validated port each time a message is
recorded. The line is in the form :

12345 B 2053 TEST@ALL F6FBB 920325 This is the subject

 If a message number is missing or does not exist the line will be :

12346 #

 This allows a system listening to the UI packets on a frequency to create a
list identical to the one of the BBS, and then the user will not have to
connect the BBS to know the list of messages and bulletins.

 A control can be done on the number of the messages to check if a line is
missing.

 If the remote system receives a new line, and a line is missing, it only has
to send an unproto frame addressed to the BBS callsign like this :

fm FC1EBN-3 to F6FBB-1 ctl UI
? 00002EE00E

 This will be taken in account only if the user has the U flag validated (EU
command).

 If the user has not his flag validated in the BBS, he will receive a line
like :

fm F6FBB-1 to FBB ctl UI
12200 / callsign

 In this case, the the remote software MUST stop asking unprotoes.

 The first 8 digits are the hexadecimal number of the requested start of the
list (here 00002EE0 -> 12000) and the last two digits are the sum of the four
bytes anded with FF (0E).

 The BBS will then starts sending lines from the requested number up to the
last message number.

 If the number requested seems to be too far from the current line, the BBS
can readjust the request of "callsign" while sending :

fm F6FBB-1 to FBB ctl UI
12200 ! CALLSIGN
12201 B 2040    TEST@FRA    F6FBB  920325 This is a bulletin
12202 #
12203 P 206    F6ABJ@F6ABJ  F6FBB  920325 Hello Remy.
etc...

and then starts sending lines from 12201. The remote system must change its
base number to 12201.

  If the number requested is greater than the last message received in the
BBS, the BBS will send a line like :

 12300 !!

 This indicates that the list in the remote system is up to date. The last
received message in the BBS is 12300.


 The remote system can also connect the BBS and ask for messages in binary
compressed mode using the following sequence :


     BBS                                    Remote system
--------------------------------------------------------------------------
                                            Connection request
Connection.

[FBB-5.14-ABFHM$]
Welcome in Toulouse, Gerard.
F6FBB BBS>
                                            [TPK-1.80-$]
1>
                                            F< #Msg
Binary compressed message #Msg
is sent using format described
in appendix 7
1>
                                            Disconnect.

 From TPK version 1.80 (packet communication program developed by FC1EBN),
this protocol is implemented.








This page was last updated 

fbb-7.0.10/doc/html/docconts.htm0000644000175000017500000001577413613360505013330 00000000000000 Contents of directories (Appendix 14)

Contents of the directories.

(Appendix 14)

These files and directories are mandatory. Other files may reside but will be
created by the system or by the sysop.


Directory FBB :

[BIN]         BAT, COM and EXE files.
[BINMAIL]     Compressed messages.
[DOC]         Documentation-files for the BBS.
[DOCS]        Files used for DOCS command.
[EXAMPLES.700]Backup-copy of system-files for this version.
[MAIL]        Ascii messages.
[OLDMAIL]     Archives of messages.
[PG]          COM and EXE files for PG command.
[STATS]       Statistics for the BBS.
[SYSTEM]      System files.
[USERS]       Area for users to upload/download files.
[UTIL]        Different utillities for the BBS.
DEFAULT  MNU  Configuration-file for FBBSETUP-program.  DosFBB only.
DEFAULT  OLH  Configuration-file for FBBSETUP-program.  DosFBB only.
EPURMESS INI  Init file for EPURMESS.
FBBSETUP EXE  Configure INIT.SRV and PORT.SYS.  DosFBB only.
INIT     SRV  Init file for the BBS.  
MODLABEL.EXE  Program to update old YAPPLBL.SYS from older FBB-versions. 
TF18    .ROM  Binary ROM-files for making EPROMs for TNCs for
     etc      use in HOST-mode with this BBS-software


Directory BIN :

APPEL    BAT  Batch file running the software.  For DosFBB only.
BC453RTL DLL  Part of main-program, WinFBB only.
BIDS47   DLL  Part of main-program, WinFBB only.
CLEANUP  COM  Program to clean MAIL and BINMAIL directory.
CLR_USER COM  Resets a users quota for downloaded files
CONNECT  WAV  Sound-file, sounds when a user connects.  WinFBB only.
CUT      COM  Copy/paste utility.
DSZ      BAT  DSZ software for up/download of binary files.  Only WinFBB.
DSZ      COM  DSZ software for up/download of binary files.  Only WinFBB.
DSZ      PIF  DSZ software for up/download of binary files.  Only WinFBB.
EPURMESS COM  Message processing.
EPURWP   COM  White Pages processing.
ESS      COM  RS232 driver.  Only DosFBB.
ESSKAM   COM  KAM RS232 driver. Only DosFBB.
FBBIOS   COM  MODEM driver.  Only DosFBB.
FBB_SVC  EXE  Program for starting servers.  For WinFBB only.
FBB_SVC  PIF  Program for starting servers.  For WinFBB only.
FV       COM  FV shareware used for LIST command in FbbDos.
INSTALL  EXE  Program for installing the BBS-software.  For WinFBB only.
INSTWFBB EXE  Configure INIT.SRV and PORT.SYS.  Only for WinFBB.
ISDAY    COM  Utillity for trigging certain actions as specific day.
MAINTINF COM  INF.SYS maintenance program.
MULTI    EXE  For sending multiple copies of personal messages. 
NEWDOC   COM  NEWDOC server.
OWL253A  DLL  Part of main-program, WinFBB only.
REQDIR   COM  REQDIR server.
REQFIL   COM  REQFIL server.
RUNFBB   BAT  Batch file running the software.  For WinFBB only.
RUNFBB   EXE  Batch file running the software.  For WinFBB only.
RUNFBB   PIF  Batch file running the software.  For WinFBB only.
SATUPDAT EXE  Automatic update of satellite database.
SERV     EXE  FBB software EXE file. For DosFBB only.
SETUSER  COM  set a user owner of a FbbDos file.
SLEEP    EXE  waits for some seconds.
SYSCALL  WAV  Sound-file, sounds when a user wants to "talk".  WinFBB only.
WFBB     EXE  FBB software EXE file. For WinFBB only.
WFBB     HLP  FBB software Help-file. For WinFBB only.


Directory BINMAIL :

[MAIL0]        [MAIL1]        [MAIL2]       [MAIL3]         [MAIL4]
[MAIL5]        [MAIL6]        [MAIL7]       [MAIL8]         [MAIL9]


Directory DOC :

CHANGES  DOC  Shows all changes in the software during development.  
FBBMUX   DOC  Doc for the Port Multiplexer
MULTI    DOC  Doc for sending multiple copies of personal messages.
WA8DED21 DOC  DED-host documentation.
DSZ      DOC  Doc for the DSZ-program.  Only for WinFBB.
FV       DOC  Doc for the FV-program, used with WHERE command.


Directory DOCS :

This is the section for easy-to-use documentations.  Numerical commands
for reading the docs.


Directory EXAMPLES.700 :

Backup of most of the new text-files and configuration-files for this
version of the software.


Directory MAIL :

[MAIL0]        [MAIL1]        [MAIL2]       [MAIL3]         [MAIL4]
[MAIL5]        [MAIL6]        [MAIL7]       [MAIL8]         [MAIL9]


Directory OLDMAIL :

Directory for backup of messages (bulletins and personal messages).


Directory PG :

Directory for special-made programs that the user can run.  The filename
is the command-name.


Directory STATS :

Directory for statistical programs for the BBS.
LISEZMOI DOC
LOG      DOC
LOGCALL  EXE
LOGFBB   CNF
LOGSTATF EXE
LOGSTATU EXE


Directory SYSTEM :

[FWD]         Directory for FORWARD.SYS include-files.
[LOG]         Directory for FBBLOG.nn files.
[LANG]        Directory for .TXT .HLP .ENT language files.
[SAT]         Directory for satellite files
[WP]          Directory for White pages database
BEACONn  SYS  Beacon file.
BBS      SYS  BBS callsigns
CRON     SYS  Hour work.
INITTNCn SYS  Initialization of TNC.
INITTNC  DED  Initialization of TNC, example for DED-host.
INITTNC  PK   Initialization of TNC, example for PK-232.
FORWARD  SYS  Forwarding description.
LANGUE   SYS  Language description
MAINTn   SYS  Housekeeping text.
MEMO     SYS  CtrlF0 to CtrlF9 aliases
MULTI    TXT  Configuration of languages for MULTI-server.
PASSWD   SYS  Password file.
PORT     SYS  Port description.
PROTECT  SYS  Directories protection.
REDIST   SYS  Configuration-file for the REDIST-server.
REJECT   SYS  Messages reject.
SWAPP    SYS  Swap file.
THEMES   SYS  Configuration-file for the thematic-zone.


Directory USERS :

Directory for the users to upload their own files.


Director USERS\YAPP :

Directory for users upload with YAPP-protocol and YU/YD commands.


Directory UTIL :

Directory for special utillity-programs that may be used with this BBS:
ICOM     DLL  Program for controlling ICOM-radios.
ICOM     COM  Program for controlling ICOM-radios.
M_FILTER DLL  Message-filtering example-program.
PROGTX   DLL  Program for sending commands to radios (QSY etc).






This page was last updated 

fbb-7.0.10/doc/html/fmtpg.htm0000644000175000017500000001030613613360505012613 00000000000000 PG programs (Appendix 17)

PG programs.

(Appendix 17)

PG programs development.

 PG programs are in the PG subdirectory. They are small programs allowing
interactivity with the user.

 COM or EXE programs can be called.

 PG programs must be little as the amount of memory is limited and fast
because the multitasking is stopped during its activity.

 To run a PG program and start a session, the user must type the command PG
followed by the name of the program. The PG command alone gives the content
of the PG subdirectory. The PG program is particularly developed for FBB
software but can be an interface to a standard program.

 Each time a complete line (up to the return character) is received, the PG
program is called with some arguments including a level number. This number
is incremented each time the program is called in the same PG session. The
first time the level number will be 0.

 The line arguments given to the PG program are :

- Callsign (format as F6FBB-8).
- Level number (0 is the first time, up to 99).
- Flags of the user (binary number as user's mask of INIT.SRV).
- Record number of the user in INF.SYS.
- Received data (each word is a new argument).

 The PG program ends with an exit value. This value is very important and
tells the BBS what to do :

 0 : end of session and return to the BBS menu.
 1 : the program will be called again and the level number is incremented.
 2 : the user will be disconnected.
 3 : the receive data will be sent as a BBS command and return to BBS.
 4 : the receive data will be sent as a BBS command, level incremented.
 5 : the program will be called again, but the level is not incremented.

 The data sent by the PG program to the standard output will be sent to the
user. This allows a real interactivity between the user and the PG program.

  Here is an example of a small program :

/*
 * TST_PG.C
 *
 * Little test program of "PG" command for FBB BBS software.
 *
 * (C) F6FBB 1991.
 *
 * FBB software 5.14 and up.
 *
 *
 * This program echoes to the user what he types
 * or executes a BBS command preceded by "CMD"
 * until "BYE" is received
 */

#include <stdio.h>

main(int argc, char **argv)
{
  int  i;
  int  level = atoi(argv[2]);        /* Get level from argument list   */

                                     /* and transform it to integer    */
  if (level == 0) {                  /* Is level equal to 0 ?          */
                                     /* This is the first call         */
    printf("Hello %s, type BYE when you want to stop !\n", argv[1]);
    return(1);                       /* program will be called again   */
  }
  else {
    strupr(argv[5]);                 /* Capitalise the first word      */
    if (strcmp(argv[5], "BYE") == 0) {       /* is BYE received ?      */
      printf("Ok, bye-bye\n");
      return(0);                     /* Yes, go on BBS                 */
    }
    else if (strcmp(argv[5], "CMD") == 0) {  /* is CMD received ?      */
      for (i = 6 ; i < argc ; i++)   /* List line arguments            */
      printf("%s ", argv[i]);        /* sent by user                   */
      putchar('\n');
      for (i = 6 ; i < argc ; i++)   /* List line arguments            */
        printf("%s ", argv[i]);      /* sent by user                   */
      putchar('\n');
      return(4);                     /* Yes, send command              */
    }
    else {
      printf("You told me : ");      /* These are other lines          */
      for (i = 5 ; i < argc ; i++)   /* List line arguments            */
      printf("%s ", argv[i]);        /* sent by user                   */
      putchar('\n');
      return(1);                     /* No, call again program         */
    }
  }
}










This page was last updated 

fbb-7.0.10/doc/html/fmtheard.htm0000644000175000017500000000301613613360505013270 00000000000000 FORMAT of HEARD.BIN

HEARD.BIN

HEARD.BIN (\FBB\SYSTEM)

This file holds the callsigns of stations heard on each port.

 This binary file holds the information on heard callsigns. This file 
must not be edited or changed. This file can only be opened for reading.

 It is organized with records, each record containing information on a
heard callsign. Never modify this file while the BBS is running.

 Structure of one record (C language) :

typedef struct 
{
	char	call[7]  ;  /* 7  Callsign                        */
	char	num      ;  /* 1  SSID                            */

} indicat ;

typedef struct {

  indicat  callsign  ;  /* 8   Callsign + SSID                 */
  long     first     ;  /* 4   Date of first heard             */
  long     last      ;  /* 4   Date of last heard              */
  ushort   nb        ;  /* 2   number of heards                */

} Heard              ;  /* 18  bytes = length of one record    */

Date is given as the number of seconds since january 1st, 1970 00:00.

In C language, all strings are ended with a NULL (00 hex) character.






This page was last updated 

fbb-7.0.10/doc/html/toolclus.htm0000644000175000017500000000121513613360505013341 00000000000000 Tool: CLR_USER

CLR_USER.COM

Small program to clear all users's amount of downloaded kb.  This is
used to "reset" all users, so they will again be able to download the
full quota of kilobytes from the BBS.






This page was last updated 

fbb-7.0.10/doc/html/toolsetu.htm0000644000175000017500000000134013613360505013352 00000000000000 Tool: SETUSER

SETUSER.COM

 Utility giving the property of a file to a user for further use by FBBDOS.

 The syntax is of the type:

 SETUSER callsign filename.

 The command "SETUSER F6FBB TOTO" will allow F6FBB, and him only, to modify
or delete the file TOTO.






This page was last updated 

fbb-7.0.10/doc/html/docvaria.htm0000644000175000017500000001151113613360505013265 00000000000000 Variables

Variables.

Variables definition:

 Most of the text files support usage of variables. These variables enable
text or values to be placed, depending upon the context or the channels in
use.

 These variables are defined with the $ sign, followed by a letter. The
meaning will be different if the letter is in capital or in lower case. A
second set of variables is defined with the % sign, followed by a letter.

 They can also be followed by a figure and in this case, this is a parameter
whose value is function of the context. These particular variables are used
in texts, usually as computation results. Do not use them in other places
than text files (*.TXT).

 The $ sign will have to be written $$, if it is not to be considered as a
variable. The % sign will have to be written %%.

List of the variables:

 $0 - $9 : Temporary variables.
 $A : @ BBS of the message header.
 $a : Year of the current date.
 $B : Inserts a Ctrl-G (Bell).
 $b : Zip code of the user.
 $C : Number of the next message.
 $c : City where the BBS is located.
 $D : Current date (Format : YYMMDD).
 $d : Current date (Format : DD-Dec).
 $E : Version number.
 $e : City of the connected user.
 $F : Minute of the hour for forwarding.
 $f : File appended to the message header.
 $G : Destination of the message header.
 $g : Number of gateway ports available.
 $H : Current time (Format : HH:MM).
 $h : Home BBS of the user.
 $I : First name of the connected user.
 $i : Date and time of the message header (Format MMDD/HHMM).
 $J : Date of the message header (Format YYMMDD).
 $j : Date of the message header (Format 29-Dec).
 $K : Time of the message header (Format : HH:MM).
 $k : List of the users involved in the conference.
 $L : Number of the last used message.
 $l : Filter value of LC command.
 $M : Number of the message header.
 $m : Frequency of the port in use.
 $N : Number of active messages.
 $n : Size of the message header.
 $O : BBS callsign.
 $o : SSID of the BBS.
 $P : Origin of the message header.
 $p : Number of lines of scroll page option, for the connected user
 $Q : List of the 8 callsigns which have new messages.
 $q : Base messages number of the user.
 $R : BID of the message header.
 $r : L or space character. L means that the message was locally created.
 $S : Subject of the message header.
 $s : Status of the message header.
 $T : Time of message header (Format : HH:MM).
 $t : Type of message header.
 $U : Callsign of the connected user.
 $u : Current drive in FBBDOS.
 $V : SysOp first name.
 $v : Complete route (with the hierarchical structure).
 $W : Inserts a carriage return.
 $w : Inserts an escape character.
 $X : Date of the last connection (Format : 881229).
 $x : Date of the last connection (Format : 29-Dec).
 $Y : Time of the last connection (Format : 12:30).
 $y : Year of message.
 $Z : Last message read by the user (L command).
 $z : Zip Code of the BBS.

 $* : Number of active channels.
 $= : User's current channel.
 $! : User's current port.
 $^ : Number of allowed ports.
 $? : BBS QTH-Locator.
 $% : List of the connected users.
 $: : Connection duration (Format : 12mn 05s).
 $. : Machine operation time (Format : 12mn 05s).
 $$ : Character $

 Second set of variables :
(unformatted means that text is not padded with spaces) :

 %A : @ BBS of the message header, unformatted.
 %C : Gives the number of times a message has been read.
 %d : Nb of KB downloaded to the user.
 %E : Give the version code (Linux, Dos, Windows).
 %G : Destination of the message header, unformatted.
 %i : Date and time of the message creation (Format MMDD/HHMM).
 %J : Date of the message creation (format YYMMDD).
 %j : Date of the message creation (format 29-Dec).
 %K : Time of the message creation (format HH:MM).
 %M : Number of the message, unformatted.
 %m : Maximum KB of download allowed on the port.
 %N : Gives the message number limited to the right 5 digits and
      modulo 65536. To be changed in the header definition of INIT.SRV.
 %n : Size of the message header, unformatted.
 %O : Callsign of sysop.
 %P : Origin of the message header, unformatted.
 %R : Callsign with full path (e.g. F6FBB.FMLR.FRA.EU).
 %r : = D if the message holds data (7+) else is space.
 %T : Name of the current theme.
 %t : Number of bulletins in the current theme.
 %X : Number of messages for the user.
 %x : Number of new messages for the user.

 %y : Year of the message creation.
 %% : Character %
 







This page was last updated 

fbb-7.0.10/doc/html/fmnewdoc.htm0000644000175000017500000000345013613360505013302 00000000000000 FORMAT of NEWDOC.SYS

NEWDOC.SYS

NEWDOC.SYS (\FBB\SYSTEM).

 The NEWDOC server allows a simple and fast update of the documentation
database (topic DOCS of the server). This server will create the file and
will give it a label. It will not create a directory if it doesn't exist.
Therefore it is necessary to prepare the directory tree structure before.

 A message will give a summary to the originator.

 The standard command line for messages is used. The message should be of
type private and addressed to the BBS which will be updated.

 SP NEWDOC @ bbs-destination

 The message title contains two information , the name of the file requested
followed by the label to give to the file (see the description of the topics
DOCS).

 Filename Label eventually on several words.

 The text of the message will be transferred in the documentation file.

 Example :

 F6FBB BBS >
 SP NEWDOC @ F6ABJ.FRA.EU
 Title of message :
 BBS\DOC_1.DOC This is the label of the documentation.
 Text of message :
 This is the content of the documentation.
 ....
 End of documentation.
 /EX

 This example assumes that the BBS is a subdirectory of DOCS, thus one of the
topics of the documentation.

 If the NEWDOC.SYS file is specified, the server will be limited to the
callsigns declared in this file, one callsign in each line.

 Example of NEWDOC.SYS file :

 F6FBB
 FD1CDC







This page was last updated 

fbb-7.0.10/doc/html/fmtappel.htm0000644000175000017500000000534613613360505013316 00000000000000 Format of APPEL.BAT

APPEL.BAT

Only for DosFBB !

APPEL.BAT (\FBB\BIN).

 This is the very first file that DosFBB will use. You will find it in 
\FBB\BIN-directory. You don't really need to do any changes in this file,
unless you did some changes during the installation-process.  If you did, 
you must change the pathnames in APPEL.BAT exactly the same as you did 
during the installation.
This is very important ! So look for the lines that I have marked with 
an     <---      here :


   set fbb=C:\FBB        <-- Defines the base of the FBB file system.
   echo off
   cd %fbb%                                                      <---
   break off
   echo Program will start, use ^C to interrupt within 3 seconds
   sleep 3
   serv %1
   if errorlevel 2 goto direct
   if errorlevel 1 goto suite
   goto fin
 :suite
   cls
   echo
   echo Sorting HROUTE.SYS...
   copy %fbb%\system\hroute.sys temp.$$$                         <---
   type temp.$$$ | sort | find /v "# " > %fbb%\system\hroute.sys <---
   del temp.$$$
   echo
   echo Backup of important files...
   copy %fbb%\system\dirmes.sys %fbb%\backup\dirmes.s1           <---
   copy %fbb%\system\inf.sys %fbb%\backup\inf.s1                 <---
   echo Cleaning up message-file...
   del epurmess.res
   epurmess
   echo Cleaning up white pages database...
   del epurwp.res
   epurwp
   cd %fbb%\system
   maintinf 3 /a
   copy %fbb%\system\INF.NEW %fbb%\system\INF.SYS
   del dirmes.new
   cd %fbb%
 :direct
   if not exist c:%fbb%\system\sat\amsat.txt goto appel          <---
   cd %fbb%\system\sat
   satupdat amsat.txt /n > satupdat.res
   satupdat amsat.txt >> satupdat.res
   del amsat.txt
  :appel
   cd %fbb%                                                      <---
   echo Program will start, use ^C to interrupt within 3 seconds
   sleep 3
   serv -t
   if errorlevel 2 goto direct
   if errorlevel 1 goto suite
 :fin
   echo Program is terminated..
   break on
   Echo on







This page was last updated 

fbb-7.0.10/doc/html/fmtdriv.htm0000644000175000017500000000245113613360505013153 00000000000000 Drivers and phone-modem

Async port drivers and telephone modem.

You may need several external drivers for your BBS.  

For WinFBB:
FBBCOMM.DRV
BPQ

For LinFBB:
AF_AX25 domain socket  
AF_NETROM domain socket
AF_ROSE domain socket  
It is necessary to compile the Linux Kernel with SLIP (serial line).

For DosFBB:
ESS.COM 
ESSKAM.COM
FBBIOS.COM 
BPQ
TFPCX/TFPCR

Installation of a TELEPHONE MODEM. 







This page was last updated 

fbb-7.0.10/doc/html/fmtrejec.htm0000644000175000017500000000227013613360505013276 00000000000000 FORMAT of REJECT.SYS

REJECT.SYS

REJECT.SYS (\FBB\SYSTEM).

 This file is in SYSTEM-directory. With this file it is possible to reject or
hold certain types or sizes of messages.

The first letter of each valid line specifies the action :

R = Reject     : The message will not be received.
H = Hold       : The message will be received but held until the sysop reviews.
L = Local Hold : Only messages created on this BBS will be held.

 # File for rejecting messages. They are rejected with N-BID:
 #
 # Type, from, @BBS, to, BID, maximum size:
 #
 # * and ? can be used as wildcards (as in MS-DOS)
 #
 R B TOTO  ALL    TATA  * 0
 R B *     *      VENTE * 0
 R B *     VENTE  *     * 0
 H * P1RAT *      *     * 0
 L B *     *      *     * 0






This page was last updated 

fbb-7.0.10/doc/fbb.conf.sample.in0000644000175000017500000000767213613360505013321 00000000000000# # FBB Set-up file # # default is @sysconfdir@/ax25/fbb/fbb.conf # # may be changed using the $FBBCONF environment variable # ################################################################## # # The following lines are mandatory # version = FBB@package_version@ # Callsign of BBS with hierarchical information callsign = F6FBB.FMLR.FRA.EU # SSID of BBS ssid = 1 # Qra Locator of BBS qraloc = JN03QL # Qth of BBS city = Toulouse # First name of SYSOP name = Jean-Paul # Callsign of SYSOP sysop = F6FBB ################################################################## # # Optional lines # # Callsign (and route if needed) that will have copy of SYSOP messages sysmail = F6XXX F5XXX@F6XXX.FMLR.FRA.EU # Line to send WP messages wpcalls = F1XXX # BBS-UP batch or program upbatch = # BBS-DW batch or program dwbatch = # # Servers will be searched and run in the "server" directory # # REQCFG, REDIST and WP are already built-in # # Name Filename Information server = REQDIR reqdir Directory request ################################################################## # # The rest of lines overwrites defaults. Here are the default values # # Directory of data files data = @localstatedir@/ax25/fbb # Directory of config files config = @sysconfdir@/ax25/fbb # Directory of message files messages = @localstatedir@/ax25/fbb/mail # Directory of compressed files compressed = @localstatedir@/ax25/fbb/binmail # Directory of users fbbdos = *,*,@localstatedir@/ax25/fbb/fbbdos,*,*,*,*,* # Directory of YAPP files yapp = @localstatedir@/ax25/fbb/fbbdos/yapp # Directory of documentation files docs = @localstatedir@/ax25/fbb/docs # Directory of the pg programs pg = @libdir@/fbb/pg # Directory of the filter programs fdir = @libdir@/fbb/filter # Directory of the server programs sdir = @libdir@/fbb/server # Directory of the tool programs (fbbdos, forward, cron...) tdir = @libdir@/fbb/tool # Path and filename for import file import = @localstatedir@/ax25/fbb/mail/mail.in # Full log logs = OK # Test mode test = NO # Use (when possible) forward type FBB fbbfwd = OK 160 # Use (when possible) compressed forward fbbcomp = OK 3 # Wait for informations (Name, HomeBBS, Qth, ZIP) askinfo = OK # First connection mask : # 0 : Disable # 1 : Excluded # 2 : Local # 4 : Expert # 8 : Sysop # 16 : BBS # 32 : Pagination # 64 : Guest # 128: Modem # 256: See-all-messages # 512: Unproto list asking is allowed # 1024: Liste des messages nouveaux. # 2048: mask = 3616 # Security codes. # Users can : # 1 : Read all messages, including private messages # 2 : Kill all messages # 4 : Send SYS command # 8 : Use remote sysop commands (edit, forward, etc...) # 16 : Edit labels in YAPP, FBBDOS, DOCS # 32 : Can delete files in YAPP, FBBDOS # 64 : Have access to all gateways # 128: Run DOS commands # 256: Have access to the entire hard disk # 512: Have access to commands /A (stop) and /R (Reboot) # All: Sysop: Sysop after successful SYS-command: security = 0 4 59 # WARNING messages to sysop # 1 : Less than 1MB in disk # 2 : Error in system file (FORWARD, BBS, REJECT...) # 4 : Server error/warning # 8 : Ping-Pong warning # 16 : Unknown route warning # 32 : Unknown NTS warning # 64 : Message file not found # 128: Error in proposal # 256: Message rejected in remote BBS # 512: Message held in remote BBS # warning = 255 # Time (hour) for housekeeping (cleanup of messages) housekeeping = 2 # Time-out for normal users / forward timeout = 10 20 # Download size YAPP / MODEM maxdownload = 0 0 # Hours +/- in relation with UTC localtime = 0 # Number of callsigns in mail beacon beacon = 8 # Number of lines in scroll buffers # # User Console Monitoring scroll = 1500 1500 1500 # Text for forward header (Do not change !) fwdheader = [$c] $$:$R # Number of saved BIDs maxbids = 30000 # Lifetime for bulletins (days) lifetime = 30 # Zip code of the BBS zipcode = 00000 # Number of back messages in unproto lists unprotoes = 500 5 P # # End of fbb.conf file # fbb-7.0.10/doc/fbb.sh.in0000644000175000017500000000247413613360505011521 00000000000000#! /bin/bash ### BEGIN INIT INFO # Provides: F6FBB Start-up # Required-Start: $remote_fs $syslog $network # Required-Stop: $remote_fs $syslog $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: FBB start up # Description: This script provides the start/stop control # for the FBB BBS Packet Radio BBS. ### END INIT INFO export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin base=${0##*/} link=${base#*[SK][0-9][0-9]} test $link = $base && START_FBB=yes test "$START_FBB" = yes || exit 0 test -x @sbindir@/fbb || exit 0 return="Done" case "$1" in start) echo "Starting FBB daemon " if [ -f @sysconfdir@/ax25/fbb/fbb.conf ] ; then @sbindir@/fbb -s -l /var/log/fbb.log || return=$rc_failed else echo "@sysconfdir@/ax25/fbb/fbb.conf file not found" return="Failed" fi echo " $1 $return" ;; stop) echo "Shutting down FBB script" killall -KILL fbb || return="Failed" echo "Shutting down FBB daemon" killall -KILL xfbbd || return="Failed" sleep 4 echo " $1 $return" ;; restart|reload) $0 stop && $0 start ;; status) echo -n "Checking for FBB daemon: " PID=`/bin/pidof -x xfbbd` if [ -n "$PID" ]; then echo "FBB is up" else echo "No FBB daemon" fi ;; *) echo "Usage: $0 {start|stop|status|restart}" exit 1 esac exit 0 fbb-7.0.10/missing0000755000175000017500000001533613747457127010701 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2018-03-07.03; # UTC # Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 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 . # 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 case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." 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 # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=https://www.perl.org/ flex_URL=https://github.com/westes/flex gnu_software_URL=https://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fbb-7.0.10/AUTHORS0000644000175000017500000000053613613360505010327 00000000000000Jean-Paul F6FBB is the author of this BBS project. F6FBB started BBS project in the 80's ! It was a multi task application for DOS then Windows then Linux. List of contributors and maintainers Bernard Pidoux Brian Cathryn Mataga Dave van der Locht fbb-7.0.10/depcomp0000755000175000017500000005602013747457130010644 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 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 . # 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 . 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 outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} 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" # Avoid interferences from the environment. gccflag= dashmflag= # 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 if test "$depmode" = msvc7msys; then # This is just like msvc7 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=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## 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). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - 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 -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # 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. ## 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. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then 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 ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # 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 ;; 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. set_dir_from "$object" set_base_from "$object" 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 -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then 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. set_dir_from "$object" set_base_from "$object" 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 -ne 0; then 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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_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. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool 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$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # 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 ;; #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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | 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" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | 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::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$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 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: fbb-7.0.10/config.h.in0000644000175000017500000001751213747457127011323 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `alarm' function. */ #undef HAVE_ALARM /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if your system has a working `chown' function. */ #undef HAVE_CHOWN /* Define to 1 if a SysV or X/Open compatible Curses library is present */ #undef HAVE_CURSES /* Define to 1 if library supports color (enhanced functions) */ #undef HAVE_CURSES_COLOR /* Define to 1 if library supports X/Open Enhanced functions */ #undef HAVE_CURSES_ENHANCED /* Define to 1 if is present */ #undef HAVE_CURSES_H /* Define to 1 if library supports certain obsolete features */ #undef HAVE_CURSES_OBSOLETE /* Define to 1 if you have the `dup2' function. */ #undef HAVE_DUP2 /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the `floor' function. */ #undef HAVE_FLOOR /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `gethostbyname' function. */ #undef HAVE_GETHOSTBYNAME /* Define to 1 if you have the `gettimeofday' function. */ #undef HAVE_GETTIMEOFDAY /* Define to 1 if you have the `inet_ntoa' function. */ #undef HAVE_INET_NTOA /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `m' library (-lm). */ #undef HAVE_LIBM /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the header file. */ #undef HAVE_LOCALE_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `mkdir' function. */ #undef HAVE_MKDIR /* Define to 1 if you have the `modf' function. */ #undef HAVE_MODF /* Define to 1 if the Ncurses library is present */ #undef HAVE_NCURSES /* Define to 1 if the NcursesW library is present */ #undef HAVE_NCURSESW /* Define to 1 if is present */ #undef HAVE_NCURSESW_CURSES_H /* Define to 1 if is present */ #undef HAVE_NCURSESW_H /* Define to 1 if is present */ #undef HAVE_NCURSES_CURSES_H /* Define to 1 if is present */ #undef HAVE_NCURSES_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H /* Define to 1 if you have the `perror' function. */ #undef HAVE_PERROR /* Define to 1 if you have the `pow' function. */ #undef HAVE_POW /* Define to 1 if you have the `putenv' function. */ #undef HAVE_PUTENV /* Define to 1 if your system has a GNU libc compatible `realloc' function, and to 0 otherwise. */ #undef HAVE_REALLOC /* Define to 1 if you have the `rmdir' function. */ #undef HAVE_RMDIR /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE /* Define to 1 if you have the `socket' function. */ #undef HAVE_SOCKET /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDIO_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strncasecmp' function. */ #undef HAVE_STRNCASECMP /* Define to 1 if you have the `strndup' function. */ #undef HAVE_STRNDUP /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strspn' function. */ #undef HAVE_STRSPN /* Define to 1 if you have the `strstr' function. */ #undef HAVE_STRSTR /* Define to 1 if you have the header file. */ #undef HAVE_SYSLOG_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILE_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H /* Define to 1 if you have the header file. */ #undef HAVE_TERMIOS_H /* Define to 1 if you have the `tzset' function. */ #undef HAVE_TZSET /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if you have the header file. */ #undef HAVE_VALUES_H /* Define to 1 if you have the `vfork' function. */ #undef HAVE_VFORK /* Define to 1 if you have the header file. */ #undef HAVE_VFORK_H /* Define to 1 if `fork' works. */ #undef HAVE_WORKING_FORK /* Define to 1 if `vfork' works. */ #undef HAVE_WORKING_VFORK /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Define to 1 if `lstat' dereferences a symlink specified with a trailing slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK /* 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 the major version of this package. */ #undef PACKAGE_VERSION_MAJOR /* Define to the micro version of this package. */ #undef PACKAGE_VERSION_MICRO /* Define to the minor version of this package. */ #undef PACKAGE_VERSION_MINOR /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Version number of package */ #undef VERSION /* Define to `int' if doesn't define. */ #undef gid_t /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `int' if does not define. */ #undef pid_t /* Define to rpl_realloc if the replacement function should be used. */ #undef realloc /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if doesn't define. */ #undef uid_t /* Define as `fork' if `vfork' does not work. */ #undef vfork fbb-7.0.10/src/0000755000175000017500000000000013747536101010127 500000000000000fbb-7.0.10/src/ems.c0000644000175000017500000004325213613360505011000 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Gestion de la memoire EMS/XMS * */ #include #ifdef __WIN32__ #define huge #endif #define CTRL_Z '\032' static int read_exms_record (int, unsigned, char *, unsigned, unsigned); static int realloc_bloc (int); static int select_bloc (char *); static int write_exms_record (int, unsigned, char *, unsigned, unsigned); #define EMS_VECT 0x67 #define MAX_BUFLIG 16 #define NB_BLOCK 4 #define NB_LIG (EMS_BLOC / sizeof(Ligne)) #ifdef __FBBDOS__ static Ligne *buf_ligne[MAX_BUFLIG]; #endif #define DIRMES_REC (EMS_BLOC / sizeof(bullist)) #define BID_REC (EMS_BLOC / BIDCOMP) #define WPG_REC (EMS_BLOC / sizeof(Wp)) #define REJ_REC (EMS_BLOC / sizeof(Rej_rec)) #define CHN_REC (EMS_BLOC / sizeof(Svoie)) static char *ems_ptr = NULL; Desc *desc; static FILE *dir_ptr = NULL; static int nb_dir = 0; /* Nombre de d'ouvertures DIRMES en cours */ static int exms = NO_MS; static int exms_pages = 0; /* Ecritures / Lectures de record */ void end_exms (void) { int file; int bloc; if (desc == NULL) return; for (file = 0; file < NB_EMS; file++) { for (bloc = 0; bloc < desc[file].max_bloc ; bloc++) { if (desc[file].alloc[bloc]) { free (desc[file].alloc[bloc]); desc[file].alloc[bloc] = NULL; } } } free (desc); desc = NULL; } int read_dirmes (unsigned record, bullist * pbul) { return (read_exms_record (DIRMES, record, (char *) pbul, sizeof (bullist), DIRMES_REC)); } int write_dirmes (unsigned record, bullist * pbul) { return (write_exms_record (DIRMES, record, (char *) pbul, sizeof (bullist), DIRMES_REC)); } int read_fwd (unsigned record, bullist * pbul) { return (read_exms_record (DIRMES, record, (char *) pbul, sizeof (bullist), DIRMES_REC)); } int write_fwd (unsigned record, bullist * pbul) { return (write_exms_record (DIRMES, record, (char *) pbul, sizeof (bullist), DIRMES_REC)); } int read_wp (unsigned record, Wp * wp) { return (read_exms_record (WPG, record, (char *) wp, sizeof (Wp), WPG_REC)); } int write_wp (unsigned record, Wp * wp) { return (write_exms_record (WPG, record, (char *) wp, sizeof (Wp), WPG_REC)); } int read_bid (unsigned record, char *pbul) { return (read_exms_record (WBID, record, (char *) pbul, BIDCOMP, BID_REC)); } int write_bid (unsigned record, char *pbul) { return (write_exms_record (WBID, record, (char *) pbul, BIDCOMP, BID_REC)); } int read_rej (unsigned record, Rej_rec * rej) { return (read_exms_record (REJET, record, (char *) rej, sizeof (Rej_rec), REJ_REC)); } int write_rej (unsigned record, Rej_rec * rej) { return (write_exms_record (REJET, record, (char *) rej, sizeof (Rej_rec), REJ_REC)); } static int read_exms_record (int file, unsigned record, char *ptr, unsigned size, unsigned nb_rec) { char *bloc; char *mptr; if (record >= desc[file].nb_records) { return (0); } bloc = desc[file].alloc[record / nb_rec]; if (bloc == NULL) return (0); deb_io (); select_bloc (bloc); mptr = ems_ptr + (record % nb_rec) * size; memcpy (ptr, mptr, size); fin_io (); return (size); } static int write_exms_record (int file, unsigned record, char *ptr, unsigned size, unsigned nb_rec) { char *bloc; char *mptr; int num_bloc = record / nb_rec; Desc *dsk = &desc[file]; if (record > dsk->nb_records) { return (0); } if (record == dsk->nb_records) ++(dsk->nb_records); while (num_bloc >= dsk->max_bloc) { int i; dsk->alloc = realloc(dsk->alloc, sizeof(char *) * (dsk->max_bloc+NB_BLOCK)); for (i = dsk->max_bloc ; i < dsk->max_bloc+NB_BLOCK ; i++) { dsk->alloc[i] = NULL; } dsk->max_bloc += NB_BLOCK; } bloc = dsk->alloc[num_bloc]; deb_io (); if (bloc == NULL) { if (!realloc_bloc (file)) { return (0); } bloc = dsk->alloc[num_bloc]; desc[file].size += (long) EMS_BLOC; } select_bloc (bloc); mptr = ems_ptr + (record % nb_rec) * size; memcpy (mptr, ptr, size); fin_io (); return (size); } char *new_bloc (int file) { realloc_bloc (file); desc[file].size += (long) EMS_BLOC; return (ems_ptr); } char *sel_bloc (int file, int numero) { if (desc[file].alloc[numero] != NULL) { select_bloc (desc[file].alloc[numero]); return (ems_ptr); } return (NULL); } void seek_exms_string (int file, long pos) { char *bloc; Desc *dsk = &desc[file]; dsk->pos = pos; dsk->num_bloc = (int) (pos / (long) EMS_BLOC); bloc = dsk->alloc[dsk->num_bloc]; if (bloc == NULL) return; select_bloc (bloc); dsk->nb = EMS_BLOC - (int) (pos % (long) EMS_BLOC); dsk->ptr = ems_ptr + (int) (pos % (long) EMS_BLOC); } long tell_exms_string (int file) { Desc *dsk = &desc[file]; return (dsk->pos); } int read_exms_string (int file, char *ptr) { int c; char *bloc; Desc *dsk = &desc[file]; int nbcar; char *mptr; bloc = dsk->alloc[dsk->num_bloc]; if (bloc == NULL) return (0); select_bloc (bloc); nbcar = dsk->nb; mptr = dsk->ptr; do { if (--nbcar == 0) { ++dsk->num_bloc; if (dsk->num_bloc == dsk->max_bloc) { int i; dsk->max_bloc += NB_BLOCK; dsk->alloc = realloc(dsk->alloc, sizeof(char *) * dsk->max_bloc); for (i = dsk->num_bloc ; i < dsk->max_bloc ; i++) { dsk->alloc[i] = NULL; } } bloc = dsk->alloc[dsk->num_bloc]; if (bloc == NULL) return (0); select_bloc (bloc); mptr = ems_ptr; nbcar = EMS_BLOC; } c = *mptr++; if (c == CTRL_Z) { --mptr; return (0); } *ptr++ = c; ++dsk->pos; } while (c); *ptr = '\0'; dsk->nb = nbcar; dsk->ptr = mptr; return (1); } int write_exms_string (int file, char *ptr) { int c; char *bloc; Desc *dsk = &desc[file]; int nbcar; char *mptr; bloc = dsk->alloc[dsk->num_bloc]; if (bloc == NULL) { if (!realloc_bloc (file)) return (0); bloc = dsk->alloc[dsk->num_bloc]; dsk->nb = EMS_BLOC; dsk->ptr = ems_ptr; desc[file].size += (long) EMS_BLOC; } select_bloc (bloc); nbcar = dsk->nb; mptr = dsk->ptr; do { if (--nbcar == 0) { ++dsk->num_bloc; if (dsk->num_bloc == dsk->max_bloc) { int i; dsk->max_bloc += NB_BLOCK; dsk->alloc = realloc(dsk->alloc, sizeof(char *) * dsk->max_bloc); for (i = dsk->num_bloc ; i < dsk->max_bloc ; i++) { dsk->alloc[i] = NULL; } } bloc = dsk->alloc[dsk->num_bloc]; if (bloc == NULL) { if (!realloc_bloc (file)) return (0); bloc = dsk->alloc[dsk->num_bloc]; dsk->nb = EMS_BLOC; dsk->ptr = ems_ptr; } select_bloc (bloc); mptr = ems_ptr; nbcar = EMS_BLOC; } c = *ptr++; *mptr++ = c; ++dsk->pos; } while (c); dsk->nb = nbcar; dsk->ptr = mptr; return (1); } static int select_bloc (char *bloc) { if (bloc == ems_ptr) return (1); if (bloc == NULL) return (0); deb_io (); ems_ptr = bloc; fin_io (); return (1); } static int realloc_bloc (int file) { char *mptr; ++exms_pages; mptr = ems_ptr = calloc (1, EMS_BLOC); if (mptr == NULL) { fbb_error (ERR_EXMS, "REALLOCATE: Error DPMI", 0); libere_xems (); return (0); } desc[file].alloc[desc[file].tot_bloc] = mptr; ++desc[file].tot_bloc; return (1); } void init_exms (void) { int i; int j; if (ems_aut) ems_aut = 2; desc = (Desc *) calloc (NB_EMS, sizeof (Desc)); if (desc == NULL) { ems_aut = 0; } for (i = 0; i < NB_EMS; i++) { desc[i].tot_bloc = 0; desc[i].num_bloc = 0; desc[i].nb_records = 0; desc[i].ptr = NULL; desc[i].nb = EMS_BLOC; desc[i].size = 0; desc[i].max_bloc = NB_BLOCK; desc[i].alloc = malloc(sizeof(char *) * desc[i].max_bloc); for (j = 0; j < NB_BLOCK; j++) desc[i].alloc[j] = NULL; } exms = NO_MS; if (ems_aut) { exms = XMS; exms_pages = 0; #ifdef __linux__ #ifdef ENGLISH if (!operationnel) cprintf ("%s set-up \n", typ_exms ()); #else if (!operationnel) cprintf ("initialise %s\n", typ_exms ()); #endif #else #ifdef ENGLISH if (!operationnel) cprintf ("%s set-up \r\n", typ_exms ()); #else if (!operationnel) cprintf ("initialise %s\r\n", typ_exms ()); #endif #endif } else in_exms = 0; } #ifdef __WINDOWS__ /* * Routines specifiques Windows */ static HGLOBAL hMem; static int read_xms_bloc (unsigned page) { char huge *mptr; if (page == 0xffff) return (1); mptr = GlobalLock (hMem); if (mptr == 0) { fbb_error (ERR_EXMS, "Error WIN_READ", 0); return (0); } _fmemcpy (ems_ptr, mptr + ((long) page * (long) EMS_BLOC), EMS_BLOC); GlobalUnlock (hMem); return (1); } static int write_xms_bloc (unsigned page) { char huge *mptr; if (page == 0xffff) return (1); mptr = GlobalLock (hMem); if (mptr == NULL) { fbb_error (ERR_EXMS, "Error WIN_WRITE", 0); return (0); } _fmemcpy (mptr + ((long) page * (long) EMS_BLOC), ems_ptr, EMS_BLOC); GlobalUnlock (hMem); return (1); } static int xms_ok (void) { return (1); } static int alloue_xms (void) { hMem = GlobalAlloc (GMEM_MOVEABLE, EMS_BLOC); if (hMem == NULL) { fbb_error (ERR_EXMS, "ALLOCATE: Error WIN", 0); libere_xems (); } if (hMem) exms_pages = 0; return ((hMem != NULL)); } static int realloue_xms_page (void) { DWORD nb_bytes; deb_io (); ++exms_pages; nb_bytes = (long) exms_pages *(long) EMS_BLOC; hMem = GlobalReAlloc (hMem, nb_bytes, GMEM_MOVEABLE); FbbMem (); if (hMem == NULL) { fbb_error (ERR_EXMS, "REALLOCATE: Error WIN", 0); libere_xems (); return (0); } else return (1); } #endif char *typ_exms (void) { static char s[30]; if (exms == NO_MS) sprintf (s, "No high memory"); else { #ifdef __WINDOWS__ sprintf (s, "Windows virtual paged memory"); #elif __linux__ sprintf (s, "LINUX virtual paged memory"); #else sprintf (s, "DPMI virtual paged memory"); #endif } return (s); } int nb_ems_pages (void) { return (exms_pages); } void libere_xems (void) { /* Liberer les zones allouees !! */ exms = NO_MS; in_exms = 0; } void ouvre_dir (void) { ++nb_dir; if (!EMS_MSG_OK ()) { /* Pas d'EMS, on ouvre le fichier */ if (dir_ptr == NULL) dir_ptr = ouvre_dirmes (); } } void ferme_dir (void) { if (--nb_dir == 0) { if (dir_ptr) ferme (dir_ptr, 45); dir_ptr = NULL; } } #define ECRIT 1 #define LIT 2 unsigned length_dir (void) { if (EMS_MSG_OK ()) return (desc[DIRMES].nb_records); fseek (dir_ptr, 0L, SEEK_END); return ((unsigned) (ftell (dir_ptr) / (long) sizeof (bullist))); } int read_dir (unsigned record, bullist * pbul) { if (EMS_MSG_OK ()) return (read_dirmes (record, pbul)); fseek (dir_ptr, (long) record * sizeof (bullist), SEEK_SET); return (fread (pbul, sizeof (bullist), 1, dir_ptr)); } int write_dir (unsigned record, bullist * pbul) { if (dir_ptr == NULL) dir_ptr = ouvre_dirmes (); if (EMS_MSG_OK ()) { /* if (operationnel) printf("Ecrit record %u offset %d Max %u\n", record, offset, nb_record); */ if (!write_dirmes (record, pbul)) in_exms &= (~EMS_MSG); } fseek (dir_ptr, (long) record * sizeof (bullist), SEEK_SET); return (fwrite (pbul, sizeof (bullist), 1, dir_ptr)); } /* Gestion des BIDs */ int where_exms_bid (char *bid) { char *bloc; int page; int i; int nb_bid; char *ptr = NULL; char t_bid[BIDCOMP]; memcpy (t_bid, comp_bid (bid), BIDCOMP); page = 0; nb_bid = BID_REC; for (i = 0; i < maxbbid; i++) { if (nb_bid == BID_REC) { bloc = desc[WBID].alloc[page]; select_bloc (bloc); nb_bid = 0; ptr = ems_ptr; /* dprintf("cherche dans page virtuelle %d, reelle %d\r\n", page, bloc); */ ++page; } if (strncmp (ptr, t_bid, BIDCOMP) == 0) { return (i + 1); } ptr += BIDCOMP; ++nb_bid; } return (0); } void tst_exms_bid (bullist * fb_mess, int nb, int *t_res) { int j; char *bloc; int page; int i; int nb_bid; char *ptr = NULL; char t_bid[BIDCOMP]; for (j = 0; j < nb; j++) { if ((t_res[j]) || (*fb_mess[j].bid == '\0')) continue; memcpy (t_bid, comp_bid (fb_mess[j].bid), BIDCOMP); page = 0; nb_bid = BID_REC; deb_io (); fin_io (); /* Pour laisser un peu de temps aux autres ! */ for (i = 0; i < maxbbid; i++) { if (nb_bid == BID_REC) { bloc = desc[WBID].alloc[page]; select_bloc (bloc); nb_bid = 0; ptr = ems_ptr; ++page; } if (strncmp (ptr, t_bid, BIDCOMP) == 0) { t_res[j] = 1; break; } ptr += BIDCOMP; ++nb_bid; } } } void delete_exms_bid (int pos) { int j; char *bloc; int page; int i; int nb_bid; char *ptr = NULL; page = 0; --pos; nb_bid = BID_REC; for (i = 0; i < maxbbid; i++) { if (nb_bid == BID_REC) { bloc = desc[WBID].alloc[page]; select_bloc (bloc); nb_bid = 0; ptr = ems_ptr; ++page; } if (pos == i) { for (j = 0; j < BIDCOMP; j++, *ptr++ = '\0'); break; } ptr += BIDCOMP; ++nb_bid; } } void init_exms_bid (FILE * fptr) { int i; #ifdef __FBBDOS__ int page = 0; #endif int nb_bid = BID_REC; bidfwd fwbuf; for (i = 0; i < maxbbid; i++) { if (nb_bid == BID_REC) { #if defined(__WINDOWS__) || defined(__linux__) char buf[80]; InitText (itoa (i, buf, 10)); #else cprintf ("\rPage %d", page++); #endif nb_bid = 0; } fread (&fwbuf, sizeof (bidfwd), 1, fptr); write_bid (i, comp_bid (fwbuf.fbid)); ++nb_bid; } #if defined(__WINDOWS__) || defined(__linux__) { char buf[80]; InitText (itoa (i, buf, 10)); } #else cprintf ("\rPage %d", page); #endif } #ifdef __WINDOWS__ /* Rien sous Windows */ #elif __DPMI16__ static Ligne *current_line (int bloc, int off) { unsigned offset; char *page; char *mptr; static Ligne ligne; page = desc[SCREEN].alloc[bloc]; offset = (unsigned) off *sizeof (Ligne); mptr = page; if (mptr == NULL) { fbb_error (ERR_EXMS, "Error DPMI_READ", 0); return (NULL); } memcpy (&ligne, mptr + offset, sizeof (Ligne)); return (&ligne); } Ligne *sel_scr (FScreen * screen, int lig) { int bloc; int off; lig += screen->first; off = lig % NB_LIG; bloc = lig / NB_LIG; if (EMS_SCR_OK ()) { return (current_line (bloc, off)); } else { return (&(buf_ligne[bloc][off])); } } void wr_scr (FScreen * screen, Ligne * ligne, int lig) { unsigned offset; int bloc; int off; char *page; char *mptr; if ((!EMS_SCR_OK ()) || (exms != XMS)) return; lig += screen->first; off = lig % NB_LIG; bloc = lig / NB_LIG; page = desc[SCREEN].alloc[bloc]; offset = (unsigned) off *sizeof (Ligne); mptr = page; if (mptr == NULL) { fbb_error (ERR_EXMS, "Error DPMI_WRITE", 0); return; } memcpy (mptr + offset, ligne, sizeof (Ligne)); } void alloue_screen (int nb_lignes) { int i; int nb; if (nb_lignes == 0) return; #ifdef ENGLISH cprintf ("Allocating screen buffers\r\n"); #else cprintf ("Alloue les buffers ‚cran \r\n"); #endif if (EMS_SCR_OK ()) { for (i = 0;; i++) { nb = (nb_lignes > NB_LIG) ? NB_LIG : nb_lignes; realloc_bloc (SCREEN); desc[SCREEN].size += (long) EMS_BLOC; nb_lignes -= nb; if (nb_lignes == 0) break; } } else { for (i = 0; i < MAX_BUFLIG; i++) { nb = (nb_lignes > NB_LIG) ? NB_LIG : nb_lignes; buf_ligne[i] = (Ligne *) calloc (nb, sizeof (Ligne)); nb_lignes -= nb; if (nb_lignes == 0) break; } } } #endif unsigned search_wp_record (lcall icall, int what, unsigned first_record) { unsigned record; unsigned max; char *bloc; int page; int nb_wp_page; Wp *wp = NULL; max = desc[WPG].nb_records; nb_wp_page = WPG_REC; page = 0; if (what == USR_CALL) { for (record = first_record; record < max; record++) { if (nb_wp_page == WPG_REC) { deb_io (); fin_io (); /* Pour laisser un peu de temps aux autres ! */ bloc = desc[WPG].alloc[page]; select_bloc (bloc); nb_wp_page = 0; wp = (Wp *) ems_ptr; /* dprintf("cherche dans page virtuelle %d, reelle %d\r\n", page, bloc); */ ++page; } if (wp->callsign == icall) { return (record); } ++wp; ++nb_wp_page; } } else if (what == BBS_CALL) { for (record = first_record; record < max; record++) { if (nb_wp_page == WPG_REC) { deb_io (); fin_io (); /* Pour laisser un peu de temps aux autres ! */ bloc = desc[WPG].alloc[page]; select_bloc (bloc); nb_wp_page = 0; wp = (Wp *) ems_ptr; ++page; } if ((wp->callsign == icall) && (wp->home == icall)) { return (record); } ++wp; ++nb_wp_page; } } return (0xffff); } int high_memory_type (void) { return (exms); } unsigned xms_free (void) { return (256); } void load_dirmes (void) { FILE *fptr; int page = 0; #ifdef __FBBDOS__ fen *fen_ptr; #endif bullist bull; int record = 0; if (!EMS_MSG_OK ()) return; deb_io (); #ifdef __FBBDOS__ fen_ptr = open_win (10, 5, 50, 8, INIT, "Messages"); #endif fptr = ouvre_dirmes (); while (fread (&bull, sizeof (bullist), 1, fptr)) { /* printf("Entre le %ld, record %d\n", bull.numero, record); */ if (!write_dirmes (record, &bull)) { in_exms &= (~EMS_MSG); break; } if ((record++ % DIRMES_REC) == 0) { #if defined(__WINDOWS__) || defined(__linux__) char buf[80]; sprintf (buf, "Page %d", page); InitText (buf); #else cprintf ("\rPage %d", page); #endif page++; } } ferme (fptr, 56); #ifdef __FBBDOS__ sleep_ (1); close_win (fen_ptr); #endif fin_io (); } fbb-7.0.10/src/Makefile.in0000644000175000017500000015346613747457130012137 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = : tool_PROGRAMS = clr_user$(EXEEXT) epurmess$(EXEEXT) epurwp$(EXEEXT) \ maintinf$(EXEEXT) server_PROGRAMS = reqdir$(EXEEXT) sbin_PROGRAMS = ajoursat$(EXEEXT) satdoc$(EXEEXT) satupdat$(EXEEXT) \ fbbgetconf$(EXEEXT) xfbbd$(EXEEXT) xfbbC$(EXEEXT) subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(serverdir)" \ "$(DESTDIR)$(tooldir)" PROGRAMS = $(sbin_PROGRAMS) $(server_PROGRAMS) $(tool_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libxfbbd_a_AR = $(AR) $(ARFLAGS) libxfbbd_a_LIBADD = am_libxfbbd_a_OBJECTS = arbre.$(OBJEXT) autobin.$(OBJEXT) \ balise.$(OBJEXT) bidexms.$(OBJEXT) conf.$(OBJEXT) \ console.$(OBJEXT) date.$(OBJEXT) devio.$(OBJEXT) \ dos_1.$(OBJEXT) dos_dir.$(OBJEXT) driver.$(OBJEXT) \ drv_aea.$(OBJEXT) drv_ded.$(OBJEXT) drv_hst.$(OBJEXT) \ drv_kam.$(OBJEXT) drv_mod.$(OBJEXT) drv_pop.$(OBJEXT) \ drv_sock.$(OBJEXT) drv_tcp.$(OBJEXT) edit.$(OBJEXT) \ ems.$(OBJEXT) error.$(OBJEXT) exec_pg.$(OBJEXT) \ fbb_conf.$(OBJEXT) fbb_orb.$(OBJEXT) fortify.$(OBJEXT) \ forward.$(OBJEXT) fwdovl1.$(OBJEXT) fwdovl2.$(OBJEXT) \ fwdovl3.$(OBJEXT) fwdovl4.$(OBJEXT) fwdovl5.$(OBJEXT) \ fwdovl6.$(OBJEXT) fwdovl7.$(OBJEXT) fwdutil.$(OBJEXT) \ gesfic.$(OBJEXT) ibm.$(OBJEXT) info.$(OBJEXT) init.$(OBJEXT) \ init_srv.$(OBJEXT) init_tnc.$(OBJEXT) initfwd.$(OBJEXT) \ initport.$(OBJEXT) k_tasks.$(OBJEXT) kernel.$(OBJEXT) \ lzhuf.$(OBJEXT) maint_fw.$(OBJEXT) mbl_edit.$(OBJEXT) \ mbl_expo.$(OBJEXT) mbl_impo.$(OBJEXT) mbl_kill.$(OBJEXT) \ mbl_lc.$(OBJEXT) mbl_list.$(OBJEXT) mbl_log.$(OBJEXT) \ mbl_menu.$(OBJEXT) mbl_opt.$(OBJEXT) mbl_prn.$(OBJEXT) \ mbl_read.$(OBJEXT) mbl_rev.$(OBJEXT) mbl_stat.$(OBJEXT) \ mbl_sys.$(OBJEXT) mbl_user.$(OBJEXT) mblutil.$(OBJEXT) \ md5c.$(OBJEXT) modem.$(OBJEXT) nomenc.$(OBJEXT) \ nouvfwd.$(OBJEXT) pac_crc.$(OBJEXT) pacsat.$(OBJEXT) \ qraloc.$(OBJEXT) redist.$(OBJEXT) rx25.$(OBJEXT) \ serv.$(OBJEXT) serveur.$(OBJEXT) statis.$(OBJEXT) \ themes.$(OBJEXT) tnc.$(OBJEXT) tncio.$(OBJEXT) trait.$(OBJEXT) \ trajec.$(OBJEXT) trajovl.$(OBJEXT) variable.$(OBJEXT) \ warning.$(OBJEXT) watchdog.$(OBJEXT) waveplay.$(OBJEXT) \ wp.$(OBJEXT) wp_mess.$(OBJEXT) wpserv.$(OBJEXT) xfwd.$(OBJEXT) \ xmodem.$(OBJEXT) yapp.$(OBJEXT) nodist_libxfbbd_a_OBJECTS = fbb_conf.$(OBJEXT) libxfbbd_a_OBJECTS = $(am_libxfbbd_a_OBJECTS) \ $(nodist_libxfbbd_a_OBJECTS) am_ajoursat_OBJECTS = ajoursat.$(OBJEXT) ajoursat_OBJECTS = $(am_ajoursat_OBJECTS) ajoursat_LDADD = $(LDADD) am_clr_user_OBJECTS = clr_user.$(OBJEXT) fbb_conf.$(OBJEXT) clr_user_OBJECTS = $(am_clr_user_OBJECTS) clr_user_LDADD = $(LDADD) am_epurmess_OBJECTS = epurmess.$(OBJEXT) fbb_conf.$(OBJEXT) epurmess_OBJECTS = $(am_epurmess_OBJECTS) epurmess_LDADD = $(LDADD) am_epurwp_OBJECTS = epurwp.$(OBJEXT) fbb_conf.$(OBJEXT) epurwp_OBJECTS = $(am_epurwp_OBJECTS) epurwp_LDADD = $(LDADD) am_fbbgetconf_OBJECTS = fbbgetconf.$(OBJEXT) fbb_conf.$(OBJEXT) fbbgetconf_OBJECTS = $(am_fbbgetconf_OBJECTS) fbbgetconf_LDADD = $(LDADD) am_maintinf_OBJECTS = maintinf.$(OBJEXT) fbb_conf.$(OBJEXT) maintinf_OBJECTS = $(am_maintinf_OBJECTS) maintinf_LDADD = $(LDADD) am_reqdir_OBJECTS = reqdir.$(OBJEXT) fbb_conf.$(OBJEXT) reqdir_OBJECTS = $(am_reqdir_OBJECTS) reqdir_LDADD = $(LDADD) am_satdoc_OBJECTS = satdoc.$(OBJEXT) satdoc_OBJECTS = $(am_satdoc_OBJECTS) satdoc_LDADD = $(LDADD) am_satupdat_OBJECTS = satupdat.$(OBJEXT) satupdat_OBJECTS = $(am_satupdat_OBJECTS) satupdat_LDADD = $(LDADD) am__xfbbC_SOURCES_DIST = md5c.c xfbbC.c terminal.c @HAVE_NCURSES_FALSE@am_xfbbC_OBJECTS = md5c.$(OBJEXT) xfbbC.$(OBJEXT) @HAVE_NCURSES_TRUE@am_xfbbC_OBJECTS = md5c.$(OBJEXT) \ @HAVE_NCURSES_TRUE@ terminal.$(OBJEXT) xfbbC.$(OBJEXT) xfbbC_OBJECTS = $(am_xfbbC_OBJECTS) xfbbC_DEPENDENCIES = am_xfbbd_OBJECTS = xfbbd-xfbbd.$(OBJEXT) xfbbd_OBJECTS = $(am_xfbbd_OBJECTS) am__DEPENDENCIES_1 = xfbbd_DEPENDENCIES = libxfbbd.a $(am__DEPENDENCIES_1) xfbbd_LINK = $(CCLD) $(xfbbd_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/ajoursat.Po ./$(DEPDIR)/arbre.Po \ ./$(DEPDIR)/autobin.Po ./$(DEPDIR)/balise.Po \ ./$(DEPDIR)/bidexms.Po ./$(DEPDIR)/clr_user.Po \ ./$(DEPDIR)/conf.Po ./$(DEPDIR)/console.Po ./$(DEPDIR)/date.Po \ ./$(DEPDIR)/devio.Po ./$(DEPDIR)/dos_1.Po \ ./$(DEPDIR)/dos_dir.Po ./$(DEPDIR)/driver.Po \ ./$(DEPDIR)/drv_aea.Po ./$(DEPDIR)/drv_ded.Po \ ./$(DEPDIR)/drv_hst.Po ./$(DEPDIR)/drv_kam.Po \ ./$(DEPDIR)/drv_mod.Po ./$(DEPDIR)/drv_pop.Po \ ./$(DEPDIR)/drv_sock.Po ./$(DEPDIR)/drv_tcp.Po \ ./$(DEPDIR)/edit.Po ./$(DEPDIR)/ems.Po ./$(DEPDIR)/epurmess.Po \ ./$(DEPDIR)/epurwp.Po ./$(DEPDIR)/error.Po \ ./$(DEPDIR)/exec_pg.Po ./$(DEPDIR)/fbb_conf.Po \ ./$(DEPDIR)/fbb_orb.Po ./$(DEPDIR)/fbbgetconf.Po \ ./$(DEPDIR)/fortify.Po ./$(DEPDIR)/forward.Po \ ./$(DEPDIR)/fwdovl1.Po ./$(DEPDIR)/fwdovl2.Po \ ./$(DEPDIR)/fwdovl3.Po ./$(DEPDIR)/fwdovl4.Po \ ./$(DEPDIR)/fwdovl5.Po ./$(DEPDIR)/fwdovl6.Po \ ./$(DEPDIR)/fwdovl7.Po ./$(DEPDIR)/fwdutil.Po \ ./$(DEPDIR)/gesfic.Po ./$(DEPDIR)/ibm.Po ./$(DEPDIR)/info.Po \ ./$(DEPDIR)/init.Po ./$(DEPDIR)/init_srv.Po \ ./$(DEPDIR)/init_tnc.Po ./$(DEPDIR)/initfwd.Po \ ./$(DEPDIR)/initport.Po ./$(DEPDIR)/k_tasks.Po \ ./$(DEPDIR)/kernel.Po ./$(DEPDIR)/lzhuf.Po \ ./$(DEPDIR)/maint_fw.Po ./$(DEPDIR)/maintinf.Po \ ./$(DEPDIR)/mbl_edit.Po ./$(DEPDIR)/mbl_expo.Po \ ./$(DEPDIR)/mbl_impo.Po ./$(DEPDIR)/mbl_kill.Po \ ./$(DEPDIR)/mbl_lc.Po ./$(DEPDIR)/mbl_list.Po \ ./$(DEPDIR)/mbl_log.Po ./$(DEPDIR)/mbl_menu.Po \ ./$(DEPDIR)/mbl_opt.Po ./$(DEPDIR)/mbl_prn.Po \ ./$(DEPDIR)/mbl_read.Po ./$(DEPDIR)/mbl_rev.Po \ ./$(DEPDIR)/mbl_stat.Po ./$(DEPDIR)/mbl_sys.Po \ ./$(DEPDIR)/mbl_user.Po ./$(DEPDIR)/mblutil.Po \ ./$(DEPDIR)/md5c.Po ./$(DEPDIR)/modem.Po ./$(DEPDIR)/nomenc.Po \ ./$(DEPDIR)/nouvfwd.Po ./$(DEPDIR)/pac_crc.Po \ ./$(DEPDIR)/pacsat.Po ./$(DEPDIR)/qraloc.Po \ ./$(DEPDIR)/redist.Po ./$(DEPDIR)/reqdir.Po \ ./$(DEPDIR)/rx25.Po ./$(DEPDIR)/satdoc.Po \ ./$(DEPDIR)/satupdat.Po ./$(DEPDIR)/serv.Po \ ./$(DEPDIR)/serveur.Po ./$(DEPDIR)/statis.Po \ ./$(DEPDIR)/terminal.Po ./$(DEPDIR)/themes.Po \ ./$(DEPDIR)/tnc.Po ./$(DEPDIR)/tncio.Po ./$(DEPDIR)/trait.Po \ ./$(DEPDIR)/trajec.Po ./$(DEPDIR)/trajovl.Po \ ./$(DEPDIR)/variable.Po ./$(DEPDIR)/warning.Po \ ./$(DEPDIR)/watchdog.Po ./$(DEPDIR)/waveplay.Po \ ./$(DEPDIR)/wp.Po ./$(DEPDIR)/wp_mess.Po ./$(DEPDIR)/wpserv.Po \ ./$(DEPDIR)/xfbbC.Po ./$(DEPDIR)/xfbbd-xfbbd.Po \ ./$(DEPDIR)/xfwd.Po ./$(DEPDIR)/xmodem.Po ./$(DEPDIR)/yapp.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libxfbbd_a_SOURCES) $(nodist_libxfbbd_a_SOURCES) \ $(ajoursat_SOURCES) $(clr_user_SOURCES) $(epurmess_SOURCES) \ $(epurwp_SOURCES) $(fbbgetconf_SOURCES) $(maintinf_SOURCES) \ $(reqdir_SOURCES) $(satdoc_SOURCES) $(satupdat_SOURCES) \ $(xfbbC_SOURCES) $(xfbbd_SOURCES) DIST_SOURCES = $(libxfbbd_a_SOURCES) $(ajoursat_SOURCES) \ $(clr_user_SOURCES) $(epurmess_SOURCES) $(epurwp_SOURCES) \ $(fbbgetconf_SOURCES) $(maintinf_SOURCES) $(reqdir_SOURCES) \ $(satdoc_SOURCES) $(satupdat_SOURCES) \ $(am__xfbbC_SOURCES_DIST) $(xfbbd_SOURCES) RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-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 \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir distdir-am am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = . X11 am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 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" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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@ # We need to install some of these binaries in custom locations tooldir = $(pkglibdir)/tool serverdir = $(pkglibdir)/server ajoursat_SOURCES = ajoursat.c clr_user_SOURCES = clr_user.c fbb_conf.c satdoc_SOURCES = satdoc.c satupdat_SOURCES = satupdat.c reqdir_SOURCES = reqdir.c fbb_conf.c epurwp_SOURCES = epurwp.c fbb_conf.c epurmess_SOURCES = epurmess.c fbb_conf.c fbbgetconf_SOURCES = fbbgetconf.c fbb_conf.c maintinf_SOURCES = maintinf.c fbb_conf.c # Build a convenience library, since these are all used by a couple different # programs noinst_LIBRARIES = libxfbbd.a libxfbbd_a_SOURCES = arbre.c autobin.c balise.c bidexms.c conf.c\ console.c date.c devio.c dos_1.c dos_dir.c\ driver.c drv_aea.c drv_ded.c drv_hst.c drv_kam.c\ drv_mod.c drv_pop.c drv_sock.c drv_tcp.c edit.c\ ems.c error.c exec_pg.c fbb_conf.c fbb_orb.c\ fortify.c forward.c fwdovl1.c fwdovl2.c fwdovl3.c\ fwdovl4.c fwdovl5.c fwdovl6.c fwdovl7.c fwdutil.c\ gesfic.c ibm.c info.c init.c init_srv.c\ init_tnc.c initfwd.c initport.c k_tasks.c kernel.c\ lzhuf.c maint_fw.c mbl_edit.c mbl_expo.c mbl_impo.c\ mbl_kill.c mbl_lc.c mbl_list.c mbl_log.c mbl_menu.c\ mbl_opt.c mbl_prn.c mbl_read.c mbl_rev.c mbl_stat.c\ mbl_sys.c mbl_user.c mblutil.c md5c.c modem.c\ nomenc.c nouvfwd.c pac_crc.c pacsat.c qraloc.c\ redist.c rx25.c serv.c serveur.c statis.c themes.c\ tnc.c tncio.c trait.c trajec.c trajovl.c variable.c\ warning.c watchdog.c waveplay.c wp.c wp_mess.c\ wpserv.c xfwd.c xmodem.c yapp.c # We want to build fbb_conf.c on the fly to substitute in default paths nodist_libxfbbd_a_SOURCES = fbb_conf.c BUILT_SOURCES = fbb_conf.c CLEANFILES = fbb_conf.c sourcefiles = fbb_conf.c edit = sed \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@libdir[@]|$(libdir)|g' # Need to include fbb_conf.c.in manually, as well as aff_stat.c EXTRA_DIST = fbb_conf.c.in aff_stat.c xfbbd_SOURCES = xfbbd.c xfbbd_CFLAGS = -D__ORB__ $(AM_CFLAGS) xfbbd_LDADD = libxfbbd.a $(AX25_LIB) @HAVE_NCURSES_FALSE@xfbbC_SOURCES = md5c.c xfbbC.c @HAVE_NCURSES_TRUE@xfbbC_SOURCES = md5c.c terminal.c xfbbC.c @HAVE_NCURSES_TRUE@xfbbC_LDADD = @CURSES_LIB@ #AM_CPPFLAGS = -I$(top_srcdir)/include AM_CPPFLAGS = -I$(top_srcdir)/include -Wstrict-prototypes -funsigned-char -DPROTOTYPES # Need to build stuff in this folder first, before X11, as there are deps in here # Check and see if we are going to build the X binaries at all first @HAVE_X_LIBS_TRUE@EXTRADIRS = X11 SUBDIRS = . $(EXTRADIRS) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-recursive .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 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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ 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)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || 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)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) install-serverPROGRAMS: $(server_PROGRAMS) @$(NORMAL_INSTALL) @list='$(server_PROGRAMS)'; test -n "$(serverdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(serverdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(serverdir)" || exit 1; \ fi; \ 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)$(serverdir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(serverdir)$$dir" || exit $$?; \ } \ ; done uninstall-serverPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(server_PROGRAMS)'; test -n "$(serverdir)" || 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)$(serverdir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(serverdir)" && rm -f $$files clean-serverPROGRAMS: -test -z "$(server_PROGRAMS)" || rm -f $(server_PROGRAMS) install-toolPROGRAMS: $(tool_PROGRAMS) @$(NORMAL_INSTALL) @list='$(tool_PROGRAMS)'; test -n "$(tooldir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(tooldir)'"; \ $(MKDIR_P) "$(DESTDIR)$(tooldir)" || exit 1; \ fi; \ 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)$(tooldir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(tooldir)$$dir" || exit $$?; \ } \ ; done uninstall-toolPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(tool_PROGRAMS)'; test -n "$(tooldir)" || 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)$(tooldir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(tooldir)" && rm -f $$files clean-toolPROGRAMS: -test -z "$(tool_PROGRAMS)" || rm -f $(tool_PROGRAMS) clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libxfbbd.a: $(libxfbbd_a_OBJECTS) $(libxfbbd_a_DEPENDENCIES) $(EXTRA_libxfbbd_a_DEPENDENCIES) $(AM_V_at)-rm -f libxfbbd.a $(AM_V_AR)$(libxfbbd_a_AR) libxfbbd.a $(libxfbbd_a_OBJECTS) $(libxfbbd_a_LIBADD) $(AM_V_at)$(RANLIB) libxfbbd.a ajoursat$(EXEEXT): $(ajoursat_OBJECTS) $(ajoursat_DEPENDENCIES) $(EXTRA_ajoursat_DEPENDENCIES) @rm -f ajoursat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ajoursat_OBJECTS) $(ajoursat_LDADD) $(LIBS) clr_user$(EXEEXT): $(clr_user_OBJECTS) $(clr_user_DEPENDENCIES) $(EXTRA_clr_user_DEPENDENCIES) @rm -f clr_user$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clr_user_OBJECTS) $(clr_user_LDADD) $(LIBS) epurmess$(EXEEXT): $(epurmess_OBJECTS) $(epurmess_DEPENDENCIES) $(EXTRA_epurmess_DEPENDENCIES) @rm -f epurmess$(EXEEXT) $(AM_V_CCLD)$(LINK) $(epurmess_OBJECTS) $(epurmess_LDADD) $(LIBS) epurwp$(EXEEXT): $(epurwp_OBJECTS) $(epurwp_DEPENDENCIES) $(EXTRA_epurwp_DEPENDENCIES) @rm -f epurwp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(epurwp_OBJECTS) $(epurwp_LDADD) $(LIBS) fbbgetconf$(EXEEXT): $(fbbgetconf_OBJECTS) $(fbbgetconf_DEPENDENCIES) $(EXTRA_fbbgetconf_DEPENDENCIES) @rm -f fbbgetconf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fbbgetconf_OBJECTS) $(fbbgetconf_LDADD) $(LIBS) maintinf$(EXEEXT): $(maintinf_OBJECTS) $(maintinf_DEPENDENCIES) $(EXTRA_maintinf_DEPENDENCIES) @rm -f maintinf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(maintinf_OBJECTS) $(maintinf_LDADD) $(LIBS) reqdir$(EXEEXT): $(reqdir_OBJECTS) $(reqdir_DEPENDENCIES) $(EXTRA_reqdir_DEPENDENCIES) @rm -f reqdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(reqdir_OBJECTS) $(reqdir_LDADD) $(LIBS) satdoc$(EXEEXT): $(satdoc_OBJECTS) $(satdoc_DEPENDENCIES) $(EXTRA_satdoc_DEPENDENCIES) @rm -f satdoc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(satdoc_OBJECTS) $(satdoc_LDADD) $(LIBS) satupdat$(EXEEXT): $(satupdat_OBJECTS) $(satupdat_DEPENDENCIES) $(EXTRA_satupdat_DEPENDENCIES) @rm -f satupdat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(satupdat_OBJECTS) $(satupdat_LDADD) $(LIBS) xfbbC$(EXEEXT): $(xfbbC_OBJECTS) $(xfbbC_DEPENDENCIES) $(EXTRA_xfbbC_DEPENDENCIES) @rm -f xfbbC$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xfbbC_OBJECTS) $(xfbbC_LDADD) $(LIBS) xfbbd$(EXEEXT): $(xfbbd_OBJECTS) $(xfbbd_DEPENDENCIES) $(EXTRA_xfbbd_DEPENDENCIES) @rm -f xfbbd$(EXEEXT) $(AM_V_CCLD)$(xfbbd_LINK) $(xfbbd_OBJECTS) $(xfbbd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ajoursat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arbre.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/autobin.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/balise.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bidexms.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clr_user.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/console.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/date.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/devio.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dos_dir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/driver.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_aea.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_ded.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_hst.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_kam.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_mod.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_pop.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_sock.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/drv_tcp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ems.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epurmess.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epurwp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exec_pg.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbb_conf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbb_orb.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbbgetconf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fortify.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/forward.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl1.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl2.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl3.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl4.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl5.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl6.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdovl7.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fwdutil.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gesfic.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ibm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/info.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_srv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_tnc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initfwd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/initport.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/k_tasks.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lzhuf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maint_fw.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/maintinf.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_edit.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_expo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_impo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_kill.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_lc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_list.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_log.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_menu.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_opt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_prn.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_read.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_rev.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_stat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_sys.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbl_user.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mblutil.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5c.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modem.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nomenc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nouvfwd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pac_crc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pacsat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qraloc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reqdir.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rx25.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/satdoc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/satupdat.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/serveur.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statis.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/terminal.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/themes.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tnc.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tncio.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trait.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trajec.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trajovl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/variable.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/warning.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/watchdog.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waveplay.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wp.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wp_mess.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wpserv.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbC.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbd-xfbbd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfwd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmodem.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/yapp.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` xfbbd-xfbbd.o: xfbbd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfbbd_CFLAGS) $(CFLAGS) -MT xfbbd-xfbbd.o -MD -MP -MF $(DEPDIR)/xfbbd-xfbbd.Tpo -c -o xfbbd-xfbbd.o `test -f 'xfbbd.c' || echo '$(srcdir)/'`xfbbd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfbbd-xfbbd.Tpo $(DEPDIR)/xfbbd-xfbbd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfbbd.c' object='xfbbd-xfbbd.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfbbd_CFLAGS) $(CFLAGS) -c -o xfbbd-xfbbd.o `test -f 'xfbbd.c' || echo '$(srcdir)/'`xfbbd.c xfbbd-xfbbd.obj: xfbbd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfbbd_CFLAGS) $(CFLAGS) -MT xfbbd-xfbbd.obj -MD -MP -MF $(DEPDIR)/xfbbd-xfbbd.Tpo -c -o xfbbd-xfbbd.obj `if test -f 'xfbbd.c'; then $(CYGPATH_W) 'xfbbd.c'; else $(CYGPATH_W) '$(srcdir)/xfbbd.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/xfbbd-xfbbd.Tpo $(DEPDIR)/xfbbd-xfbbd.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xfbbd.c' object='xfbbd-xfbbd.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(xfbbd_CFLAGS) $(CFLAGS) -c -o xfbbd-xfbbd.obj `if test -f 'xfbbd.c'; then $(CYGPATH_W) 'xfbbd.c'; else $(CYGPATH_W) '$(srcdir)/xfbbd.c'; fi` # 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. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ 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" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) 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; \ $(am__define_uniq_tagged_files); \ 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-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ 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 check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile $(PROGRAMS) $(LIBRARIES) installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(tooldir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-noinstLIBRARIES clean-sbinPROGRAMS \ clean-serverPROGRAMS clean-toolPROGRAMS mostlyclean-am distclean: distclean-recursive -rm -f ./$(DEPDIR)/ajoursat.Po -rm -f ./$(DEPDIR)/arbre.Po -rm -f ./$(DEPDIR)/autobin.Po -rm -f ./$(DEPDIR)/balise.Po -rm -f ./$(DEPDIR)/bidexms.Po -rm -f ./$(DEPDIR)/clr_user.Po -rm -f ./$(DEPDIR)/conf.Po -rm -f ./$(DEPDIR)/console.Po -rm -f ./$(DEPDIR)/date.Po -rm -f ./$(DEPDIR)/devio.Po -rm -f ./$(DEPDIR)/dos_1.Po -rm -f ./$(DEPDIR)/dos_dir.Po -rm -f ./$(DEPDIR)/driver.Po -rm -f ./$(DEPDIR)/drv_aea.Po -rm -f ./$(DEPDIR)/drv_ded.Po -rm -f ./$(DEPDIR)/drv_hst.Po -rm -f ./$(DEPDIR)/drv_kam.Po -rm -f ./$(DEPDIR)/drv_mod.Po -rm -f ./$(DEPDIR)/drv_pop.Po -rm -f ./$(DEPDIR)/drv_sock.Po -rm -f ./$(DEPDIR)/drv_tcp.Po -rm -f ./$(DEPDIR)/edit.Po -rm -f ./$(DEPDIR)/ems.Po -rm -f ./$(DEPDIR)/epurmess.Po -rm -f ./$(DEPDIR)/epurwp.Po -rm -f ./$(DEPDIR)/error.Po -rm -f ./$(DEPDIR)/exec_pg.Po -rm -f ./$(DEPDIR)/fbb_conf.Po -rm -f ./$(DEPDIR)/fbb_orb.Po -rm -f ./$(DEPDIR)/fbbgetconf.Po -rm -f ./$(DEPDIR)/fortify.Po -rm -f ./$(DEPDIR)/forward.Po -rm -f ./$(DEPDIR)/fwdovl1.Po -rm -f ./$(DEPDIR)/fwdovl2.Po -rm -f ./$(DEPDIR)/fwdovl3.Po -rm -f ./$(DEPDIR)/fwdovl4.Po -rm -f ./$(DEPDIR)/fwdovl5.Po -rm -f ./$(DEPDIR)/fwdovl6.Po -rm -f ./$(DEPDIR)/fwdovl7.Po -rm -f ./$(DEPDIR)/fwdutil.Po -rm -f ./$(DEPDIR)/gesfic.Po -rm -f ./$(DEPDIR)/ibm.Po -rm -f ./$(DEPDIR)/info.Po -rm -f ./$(DEPDIR)/init.Po -rm -f ./$(DEPDIR)/init_srv.Po -rm -f ./$(DEPDIR)/init_tnc.Po -rm -f ./$(DEPDIR)/initfwd.Po -rm -f ./$(DEPDIR)/initport.Po -rm -f ./$(DEPDIR)/k_tasks.Po -rm -f ./$(DEPDIR)/kernel.Po -rm -f ./$(DEPDIR)/lzhuf.Po -rm -f ./$(DEPDIR)/maint_fw.Po -rm -f ./$(DEPDIR)/maintinf.Po -rm -f ./$(DEPDIR)/mbl_edit.Po -rm -f ./$(DEPDIR)/mbl_expo.Po -rm -f ./$(DEPDIR)/mbl_impo.Po -rm -f ./$(DEPDIR)/mbl_kill.Po -rm -f ./$(DEPDIR)/mbl_lc.Po -rm -f ./$(DEPDIR)/mbl_list.Po -rm -f ./$(DEPDIR)/mbl_log.Po -rm -f ./$(DEPDIR)/mbl_menu.Po -rm -f ./$(DEPDIR)/mbl_opt.Po -rm -f ./$(DEPDIR)/mbl_prn.Po -rm -f ./$(DEPDIR)/mbl_read.Po -rm -f ./$(DEPDIR)/mbl_rev.Po -rm -f ./$(DEPDIR)/mbl_stat.Po -rm -f ./$(DEPDIR)/mbl_sys.Po -rm -f ./$(DEPDIR)/mbl_user.Po -rm -f ./$(DEPDIR)/mblutil.Po -rm -f ./$(DEPDIR)/md5c.Po -rm -f ./$(DEPDIR)/modem.Po -rm -f ./$(DEPDIR)/nomenc.Po -rm -f ./$(DEPDIR)/nouvfwd.Po -rm -f ./$(DEPDIR)/pac_crc.Po -rm -f ./$(DEPDIR)/pacsat.Po -rm -f ./$(DEPDIR)/qraloc.Po -rm -f ./$(DEPDIR)/redist.Po -rm -f ./$(DEPDIR)/reqdir.Po -rm -f ./$(DEPDIR)/rx25.Po -rm -f ./$(DEPDIR)/satdoc.Po -rm -f ./$(DEPDIR)/satupdat.Po -rm -f ./$(DEPDIR)/serv.Po -rm -f ./$(DEPDIR)/serveur.Po -rm -f ./$(DEPDIR)/statis.Po -rm -f ./$(DEPDIR)/terminal.Po -rm -f ./$(DEPDIR)/themes.Po -rm -f ./$(DEPDIR)/tnc.Po -rm -f ./$(DEPDIR)/tncio.Po -rm -f ./$(DEPDIR)/trait.Po -rm -f ./$(DEPDIR)/trajec.Po -rm -f ./$(DEPDIR)/trajovl.Po -rm -f ./$(DEPDIR)/variable.Po -rm -f ./$(DEPDIR)/warning.Po -rm -f ./$(DEPDIR)/watchdog.Po -rm -f ./$(DEPDIR)/waveplay.Po -rm -f ./$(DEPDIR)/wp.Po -rm -f ./$(DEPDIR)/wp_mess.Po -rm -f ./$(DEPDIR)/wpserv.Po -rm -f ./$(DEPDIR)/xfbbC.Po -rm -f ./$(DEPDIR)/xfbbd-xfbbd.Po -rm -f ./$(DEPDIR)/xfwd.Po -rm -f ./$(DEPDIR)/xmodem.Po -rm -f ./$(DEPDIR)/yapp.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-serverPROGRAMS install-toolPROGRAMS install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-sbinPROGRAMS 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 ./$(DEPDIR)/ajoursat.Po -rm -f ./$(DEPDIR)/arbre.Po -rm -f ./$(DEPDIR)/autobin.Po -rm -f ./$(DEPDIR)/balise.Po -rm -f ./$(DEPDIR)/bidexms.Po -rm -f ./$(DEPDIR)/clr_user.Po -rm -f ./$(DEPDIR)/conf.Po -rm -f ./$(DEPDIR)/console.Po -rm -f ./$(DEPDIR)/date.Po -rm -f ./$(DEPDIR)/devio.Po -rm -f ./$(DEPDIR)/dos_1.Po -rm -f ./$(DEPDIR)/dos_dir.Po -rm -f ./$(DEPDIR)/driver.Po -rm -f ./$(DEPDIR)/drv_aea.Po -rm -f ./$(DEPDIR)/drv_ded.Po -rm -f ./$(DEPDIR)/drv_hst.Po -rm -f ./$(DEPDIR)/drv_kam.Po -rm -f ./$(DEPDIR)/drv_mod.Po -rm -f ./$(DEPDIR)/drv_pop.Po -rm -f ./$(DEPDIR)/drv_sock.Po -rm -f ./$(DEPDIR)/drv_tcp.Po -rm -f ./$(DEPDIR)/edit.Po -rm -f ./$(DEPDIR)/ems.Po -rm -f ./$(DEPDIR)/epurmess.Po -rm -f ./$(DEPDIR)/epurwp.Po -rm -f ./$(DEPDIR)/error.Po -rm -f ./$(DEPDIR)/exec_pg.Po -rm -f ./$(DEPDIR)/fbb_conf.Po -rm -f ./$(DEPDIR)/fbb_orb.Po -rm -f ./$(DEPDIR)/fbbgetconf.Po -rm -f ./$(DEPDIR)/fortify.Po -rm -f ./$(DEPDIR)/forward.Po -rm -f ./$(DEPDIR)/fwdovl1.Po -rm -f ./$(DEPDIR)/fwdovl2.Po -rm -f ./$(DEPDIR)/fwdovl3.Po -rm -f ./$(DEPDIR)/fwdovl4.Po -rm -f ./$(DEPDIR)/fwdovl5.Po -rm -f ./$(DEPDIR)/fwdovl6.Po -rm -f ./$(DEPDIR)/fwdovl7.Po -rm -f ./$(DEPDIR)/fwdutil.Po -rm -f ./$(DEPDIR)/gesfic.Po -rm -f ./$(DEPDIR)/ibm.Po -rm -f ./$(DEPDIR)/info.Po -rm -f ./$(DEPDIR)/init.Po -rm -f ./$(DEPDIR)/init_srv.Po -rm -f ./$(DEPDIR)/init_tnc.Po -rm -f ./$(DEPDIR)/initfwd.Po -rm -f ./$(DEPDIR)/initport.Po -rm -f ./$(DEPDIR)/k_tasks.Po -rm -f ./$(DEPDIR)/kernel.Po -rm -f ./$(DEPDIR)/lzhuf.Po -rm -f ./$(DEPDIR)/maint_fw.Po -rm -f ./$(DEPDIR)/maintinf.Po -rm -f ./$(DEPDIR)/mbl_edit.Po -rm -f ./$(DEPDIR)/mbl_expo.Po -rm -f ./$(DEPDIR)/mbl_impo.Po -rm -f ./$(DEPDIR)/mbl_kill.Po -rm -f ./$(DEPDIR)/mbl_lc.Po -rm -f ./$(DEPDIR)/mbl_list.Po -rm -f ./$(DEPDIR)/mbl_log.Po -rm -f ./$(DEPDIR)/mbl_menu.Po -rm -f ./$(DEPDIR)/mbl_opt.Po -rm -f ./$(DEPDIR)/mbl_prn.Po -rm -f ./$(DEPDIR)/mbl_read.Po -rm -f ./$(DEPDIR)/mbl_rev.Po -rm -f ./$(DEPDIR)/mbl_stat.Po -rm -f ./$(DEPDIR)/mbl_sys.Po -rm -f ./$(DEPDIR)/mbl_user.Po -rm -f ./$(DEPDIR)/mblutil.Po -rm -f ./$(DEPDIR)/md5c.Po -rm -f ./$(DEPDIR)/modem.Po -rm -f ./$(DEPDIR)/nomenc.Po -rm -f ./$(DEPDIR)/nouvfwd.Po -rm -f ./$(DEPDIR)/pac_crc.Po -rm -f ./$(DEPDIR)/pacsat.Po -rm -f ./$(DEPDIR)/qraloc.Po -rm -f ./$(DEPDIR)/redist.Po -rm -f ./$(DEPDIR)/reqdir.Po -rm -f ./$(DEPDIR)/rx25.Po -rm -f ./$(DEPDIR)/satdoc.Po -rm -f ./$(DEPDIR)/satupdat.Po -rm -f ./$(DEPDIR)/serv.Po -rm -f ./$(DEPDIR)/serveur.Po -rm -f ./$(DEPDIR)/statis.Po -rm -f ./$(DEPDIR)/terminal.Po -rm -f ./$(DEPDIR)/themes.Po -rm -f ./$(DEPDIR)/tnc.Po -rm -f ./$(DEPDIR)/tncio.Po -rm -f ./$(DEPDIR)/trait.Po -rm -f ./$(DEPDIR)/trajec.Po -rm -f ./$(DEPDIR)/trajovl.Po -rm -f ./$(DEPDIR)/variable.Po -rm -f ./$(DEPDIR)/warning.Po -rm -f ./$(DEPDIR)/watchdog.Po -rm -f ./$(DEPDIR)/waveplay.Po -rm -f ./$(DEPDIR)/wp.Po -rm -f ./$(DEPDIR)/wp_mess.Po -rm -f ./$(DEPDIR)/wpserv.Po -rm -f ./$(DEPDIR)/xfbbC.Po -rm -f ./$(DEPDIR)/xfbbd-xfbbd.Po -rm -f ./$(DEPDIR)/xfwd.Po -rm -f ./$(DEPDIR)/xmodem.Po -rm -f ./$(DEPDIR)/yapp.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-sbinPROGRAMS uninstall-serverPROGRAMS \ uninstall-toolPROGRAMS .MAKE: $(am__recursive_targets) all check install install-am \ install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--depfiles check check-am clean clean-generic \ clean-noinstLIBRARIES clean-sbinPROGRAMS clean-serverPROGRAMS \ clean-toolPROGRAMS cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags 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-sbinPROGRAMS \ install-serverPROGRAMS install-strip install-toolPROGRAMS \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS \ uninstall-serverPROGRAMS uninstall-toolPROGRAMS .PRECIOUS: Makefile fbb_conf.c: Makefile @list='$(sourcefiles)'; for p in $$list; do \ $(edit) $(srcdir)/$$p.in >$$p; \ done # 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: fbb-7.0.10/src/driver.c0000644000175000017500000002621213613360505011504 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #include typedef int (*sta_)(int, int, int, void *); typedef int (*snd_)(int, int, int, char *, int, Beacon *); typedef int (*rcv_)(int *, int *, int *, char *, int *, ui_header *); typedef int (*opn_)(int, int); typedef int (*cls_)(int); typedef struct { sta_ sta; snd_ snd; rcv_ rcv; opn_ opn; cls_ cls; } DrvFct; /* I don't know how to avoid this warning... */ static DrvFct drv_fct[NB_TYP] = { /* STA_DRV SND_DRV RCV_DRV */ { sta_ded, snd_ded, rcv_ded, opn_ded, cls_ded } , /* TYP_DED */ { sta_aea, snd_aea, rcv_aea, NULL, NULL } , /* TYP_PK */ { sta_mod, snd_mod, NULL, NULL, NULL } , /* TYP_MOD */ { sta_kam, snd_kam, rcv_kam, NULL, NULL } , /* TYP_KAM */ #if !defined(__WIN32__) && (defined(__WINDOWS__) || defined(__FBBDOS__)) { sta_bpq, snd_bpq, rcv_bpq, NULL, NULL } , /* TYP_BPQ */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_BPQ */ #endif #if defined(__WINDOWS__) { sta_tcp, snd_tcp, NULL, NULL, NULL } , /* TYP_TCP */ #elif defined(__linux__) { sta_tcp, snd_tcp, rcv_tcp, opn_tcp, cls_tcp } , /* TYP_TCP */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_TCP */ #endif #if defined(__linux__) { sta_sck, snd_sck, rcv_sck, opn_sck, cls_sck } , /* TYP_SOCK */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_SOCK */ #endif #if defined(__WINDOWS__) { sta_agw, snd_agw, rcv_agw, opn_agw, cls_agw } , /* TYP_AGW */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_AGW */ #endif #if defined(__WINDOWS__) { sta_tcp, snd_tcp, rcv_tcp, NULL, NULL } , /* TYP_ETH */ #elif defined(__linux__) { sta_tcp, snd_tcp, rcv_tcp, opn_tcp, cls_tcp } , /* TYP_ETH */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_ETH */ #endif { sta_hst, snd_hst, rcv_hst, opn_hst, cls_hst } , /* TYP_HST */ #if defined(__WINDOWS__) || defined(__FBBDOS__) { sta_flx, snd_flx, rcv_flx, opn_flx, cls_flx } , /* TYP_FLX */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_FLX */ #endif #if defined(__linux__) { sta_pop, snd_pop, rcv_pop, opn_pop, cls_pop } , /* TYP_POP */ #else { NULL, NULL, NULL, NULL, NULL } , /* TYP_POP */ #endif }; void clear_queue (int voie) { if (P_TOR (voie)) { sta_drv (voie, TOR, "%C"); } } void tor_end (int voie) { } void tor_start (int voie) { if (P_TOR (voie)) { sta_drv (voie, TOR, "%I"); } } void tor_stop (int voie) { if (P_TOR (voie)) { sta_drv (voie, TOR, "%O"); } } void tor_disc (int voie) { } /******************************************* * * Status d'une voie * * Retourne le status demande dans *ptr * *******************************************/ int sta_drv (int voie, int cmd, void *ptr) { int canal; int val = 0; int port = no_port (voie); int p; if (DEBUG) return (0); df ("sta_drv", 4); if ((voie == CONSOLE) || (voie == INEXPORT)) { ff (); return (0); } p = p_port[port].typort; if (drv_fct[p].sta) { canal = svoie[voie]->affport.canal; val = (drv_fct[p].sta) (port, canal, cmd, ptr); } ff (); return (val); } /******************************************* / / Lecture d'une voie / / cmd retourne le type de donnees lues / buf retourne les donnees lues / len retourne longueur des donnees lues / ptr retourne l'info monitoring (ou NULL) / ********************************************/ int rcv_drv (int *port, int *voie, int *cmd, char *buf, int *len, ui_header * ptr) { int val = 0; int canal = 0; int p; if (DEBUG) return (0); df ("rcv_drv", 12); if ((*voie == CONSOLE) || (*voie == INEXPORT)) { ff (); return (0); } p = p_port[*port].typort; if (drv_fct[p].rcv) { val = (drv_fct[p].rcv) (port, &canal, cmd, buf, len, ptr); if (val) { if (val == 1) { /* Active le flag de processing */ is_idle = 0; } val = 1; /* Reponse a une commande */ if ((*cmd == ECHOCMD) || (*cmd == ERRCMD)) { #ifdef __WINDOWS__ SendEchoCmd (buf, *len); #endif *len = 0; *cmd = NOCMD; ff (); return (0); } /* Recherche la voie correspondant au canal */ if ((*cmd != UNPROTO) && (*cmd != NBBUF)) { *voie = no_voie (*port, canal); if (*voie == -1) { ff (); return (0); } #ifdef __linux__ if ((!HST (*port)) && (!DRSI (*port)) && (!BPQ (*port)) && (!S_LINUX (*port))) #else if ((!HST (*port)) && (!DRSI (*port)) && (!BPQ (*port)) && (!AGW (*port))) #endif { svoie[*voie]->affport.port = *port; } } } } ff (); return (val); } /******************************************* / / Ecriture d'une voie / / cmd contient le type de donnees lues / buf contient les donnees envoyees / len contient la longueur des donnees lues / ptr contient l'info monitoring (ou NULL) / ********************************************/ int snd_drv (int voie, int cmd, char *buffer, int len, Beacon * ptr) { int val = 0; int canal; int port; int p; /* Recherche du port */ if (cmd == UNPROTO) port = voie; else port = no_port (voie); p = p_port[port].typort; if ((DEBUG) || (!p_port[port].pvalid)) { return (1); } if ((cmd != UNPROTO) && ((voie == CONSOLE) || (voie == INEXPORT))) return (0); df ("snd_drv", 7); if (drv_fct[p].snd) { if (cmd == UNPROTO) { { val = (drv_fct[p].snd) (port, 0, cmd, buffer, len, ptr); ptr = ptr->next; } } else { canal = svoie[voie]->affport.canal; val = (drv_fct[p].snd) (port, canal, cmd, buffer, len, ptr); if ((cmd == DATA) && (svoie[voie]->sta.mem)) --svoie[voie]->sta.mem; } } if (val) { is_idle = 0; } ff (); return (val); } /******************************************* / / Ouverture d'un port / ********************************************/ int opn_drv (int port, int nb) { int p; int val = 0; if (DEBUG) return (0); p = p_port[port].typort; if (drv_fct[p].opn) { val = (drv_fct[p].opn) (port, nb); } return (val); } /******************************************* / / Fermeture d'un port / ********************************************/ int cls_drv (int port) { int p; int val = 0; if (DEBUG) return (0); p = p_port[port].typort; if (drv_fct[p].cls) { val = (drv_fct[p].cls) (port); } return (val); } /* * Fonctions diverses */ int no_voie (int port, int canal) { int i; df ("no_voie", 2); #ifdef __linux__ if (S_LINUX (port)) { for (i = 1; i < NBVOIES; i++) { if ((S_LINUX ((int)svoie[i]->affport.port)) && (canal == svoie[i]->affport.canal)) { ff (); return (i); } } } else #endif if (HST (port)) { for (i = 1; i < NBVOIES; i++) { if ((port == svoie[i]->affport.port) && (canal == 1) && (P_TOR (i))) { /* Port pactor */ ff (); return (i); } if ((HST ((int)svoie[i]->affport.port)) && (canal == svoie[i]->affport.canal)) { ff (); return (i); } } } else if (BPQ (port)) { for (i = 1; i < NBVOIES; i++) { if ((BPQ ((int)svoie[i]->affport.port)) && (canal == svoie[i]->affport.canal)) { ff (); return (i); } } } else if (DRSI (port)) { for (i = 1; i < NBVOIES; i++) { if ((DRSI ((int)svoie[i]->affport.port)) && (canal == svoie[i]->affport.canal)) { ff (); return (i); } } } else if (AGW (port)) { for (i = 1; i < NBVOIES; i++) { if ((AGW ((int)svoie[i]->affport.port)) && (canal == svoie[i]->affport.canal)) { ff (); return (i); } } } else { for (i = 1; i < NBVOIES; i++) { if ((port == svoie[i]->affport.port) && (canal == svoie[i]->affport.canal)) { ff (); return (i); } } } ff (); return (-1); } int is_pactor (void) { int port; for (port = 1; port < NBPORT; port++) if (IS_PACTOR (port)) return (port); return (0); } void not_allowed (char *buffer) { #ifdef ENGLISH sprintf (buffer, "Not an allowed command !"); #else sprintf (buffer, "Commande impossible ! "); #endif } void paclen_change (int port, int canal, char *buffer) { int voie = 0; int pac; int *p_ptr; char *ptr = buffer; if (canal) voie = no_voie (port, canal); do { ++ptr; } while (isspace (*ptr)); if (canal) { p_ptr = &(svoie[voie]->paclen); } else { p_ptr = &(p_port[port].pk_t); } if (isdigit (*ptr)) { pac = atoi (ptr); *buffer = '\0'; if ((pac >= 30) && (pac <= 250)) *p_ptr = pac; else sprintf (buffer, "INVALID VALUE : %d\r\n", pac); } else sprintf (buffer, "%d\r\n", *p_ptr); } char *mot (char *chaine) { static char ch_retour[20]; char *ptr = ch_retour; while (isalnum (*chaine)) *ptr++ = *chaine++; *ptr = '\0'; return (ch_retour); } void env_date (void) { struct tm *sdate; int port; long temps = time (NULL); char buffer[300]; sdate = localtime (&temps); for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { deb_io (); switch (p_port[port].typort) { case TYP_DED: sprintf (buffer, "K %02d:%02d:%02d", sdate->tm_hour, sdate->tm_min, sdate->tm_sec); tnc_commande (port, buffer, PORTCMD); sprintf (buffer, "K %02d/%02d/%02d", sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_year % 100); tnc_commande (port, buffer, PORTCMD); break; case TYP_PK: sprintf (buffer, "DA%02d%02d%02d%02d%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min); selcanal (port); tnc_commande (port, buffer, PORTCMD); break; } fin_io (); } } } #define CESC 0x1f void set_binary (int voie, int val) { svoie[voie]->binary = val; sta_drv (voie, BINCMD, &val); } void set_bs (int voie, int val) { sta_drv (voie, BSCMD, &val); } #ifdef __linux__ #include #include #include /* Une seule initialisation quelque soit le driver */ int fbb_ax25_config_load_ports (void) { static int init_ok = 0; if (init_ok) return (1); init_ok = 1; return (ax25_config_load_ports ()); } /* Une seule initialisation quelque soit le driver */ int fbb_nr_config_load_ports (void) { static int init_ok = 0; if (init_ok) return (1); init_ok = 1; return (nr_config_load_ports ()); } /* Une seule initialisation quelque soit le driver */ int fbb_rs_config_load_ports (void) { static int init_ok = 0; if (init_ok) return (1); init_ok = 1; return (rs_config_load_ports ()); } #endif fbb-7.0.10/src/epurmess.c0000644000175000017500000010500513747456632012071 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #define ENGLISH #include #include #include #include #include #include #include #include #ifdef __linux__ #include #else #include #include #include #include #endif #include #include #define DEBUG 1 #define TRUE 1 #define FALSE 0 #ifdef ENGLISH #define EXPI "Expi" #define ARCH "Arch" #define LECT "Read" #define SUPP "Kill" #define DETR "Dest" #else #define EXPI "Expi" #define ARCH "Arch" #define LECT "Lect" #define SUPP "Supp" #define DETR "Detr" #endif #ifdef __linux__ #define _read read #define _write write #define O_BINARY 0 #define __a2__ __attribute__ ((packed, aligned(2))) #define stricmp strcasecmp #define strcmpi strcasecmp #define strnicmp strncasecmp #define strncmpi strncasecmp #else #define __a2__ #endif char cdate[80]; long numtot, numenr, nomess, numsup, numarc, nbtot; long nbp, nbb; char mycall[7], expediteur[7], destinataire[7]; char mypath[80]; long mdate; #define MAX_RENUM (14L * 0x10000L) #define DEL_RENUM (MAX_RENUM - 0x20000L) #define NBBBS 80 #define NBMASK NBBBS/8 #define LGFREE 5 typedef struct { /* Longueur = 194 octets */ char type; char status; long numero __a2__; long taille __a2__; long date __a2__; char bbsf[7]; char bbsv[41]; char exped[7]; char desti[7]; char bid[13]; char titre[61]; char bin; char free[5]; long grpnum __a2__; unsigned short nblu; long theme __a2__; long datesd __a2__; long datech __a2__; char fbbs[NBMASK]; char forw[NBMASK]; } bullist; typedef struct typ_serlist { char nom[7]; char delai; struct typ_serlist *suiv; } deslist; typedef struct { long pn; long py; long pf; long px; long pk; long bn; long by; long bf; long bx; long bk; long bd; long rt; long rr; } param; #define BUFFSIZE 257 #define NB_AUTOMESS 2 int auto_mess[NB_AUTOMESS]; char text_rt[NB_AUTOMESS][BUFFSIZE]; char *mail_in; char *callsign; int nb_return_lines; void aff_status (bullist *); void change_defauts (param *, bullist *); int copy_ (char *, char *); void defauts (void); void ent_arch (FILE *, bullist *); void entete_liste (void); void erreur_arg (int); void init_liste (char *, int); void message_retour (int, bullist *, long); void newname (char *, char *); void print_compte_rendu (void); void print_zone(void); char *date_mbl_new (long); char *strdt (long); int semaine (void); int is_route (char *fbbs); deslist *tete_exped, *tete_route, *tete_desti; int *tabrec; char *dirmes_sys; char *dirmes_old; char *dirmes_new; char *compte_rendu; char *old_mail; char *mail; char *binmail; int archive_p, archive_b; int old_format; int ext_call = 0; long heure; param max, def; FILE *fptr, *dptr; extern long timezone; #ifdef __linux__ char *strupr (char *str) { char *tmp = str; while (*tmp) { if (islower (*tmp)) *tmp = toupper (*tmp); ++tmp; } return str; } char *back2slash (char *str) { char *tmp = str; while (*tmp) { if (isupper (*tmp)) *tmp = tolower (*tmp); if (*tmp == '\\') *tmp = '/'; ++tmp; } return str; } #endif char *test_back_slash (char *chaine) { static char temp[256]; strcpy(temp, chaine); if ((strlen(temp) == 0) #ifdef __linux__ || (temp[strlen (temp) - 1] != '/')) strcat(temp, "/"); #else || (temp[strlen (temp) - 1] != '\\')) strcat(temp, "\\"); #endif return (temp); } void err_keyword(char *keyword) { fprintf(stderr, "Error : keyword \"%s\" missing in fbb.conf file\n", keyword); exit(1); } void epure (char *ligne) { int lg; lg = strlen (ligne); if (ligne[lg - 1] == '\n') ligne[lg - 1] = '\0'; lg = strlen (ligne); if (ligne[lg - 1] == '\r') ligne[lg - 1] = '\0'; if (*ligne == '\032') *ligne = '\0'; } static int fbb_unlink (char *filename) { int ret = unlink (filename); return (ret); } int main (int ac, char **av) { int i; char *s; char *old_name; char *new_name; char *bin_name; char *buffer; int ecrit, unite; bullist entete; long record; FILE *fcr, *fpti, *fpto; long minimum; long maximum; int renum = 0; mail_in = (char *) (calloc(80 , sizeof(char))); callsign = (char *) (calloc(40 , sizeof(char))); s = (char *) (calloc(BUFFSIZE , sizeof(char))); old_name = (char *) (calloc(BUFFSIZE , sizeof(char))); new_name = (char *) (calloc(BUFFSIZE , sizeof(char))); bin_name = (char *) (calloc(BUFFSIZE , sizeof(char))); buffer = (char *) (calloc(BUFFSIZE , sizeof(char))); dirmes_sys = (char *) (calloc(BUFFSIZE , sizeof(char))); dirmes_old = (char *) (calloc(BUFFSIZE , sizeof(char))); dirmes_new = (char *) (calloc(BUFFSIZE , sizeof(char))); compte_rendu = (char *) (calloc(BUFFSIZE , sizeof(char))); old_mail = (char *) (calloc(BUFFSIZE , sizeof(char))); mail = (char *) (calloc(BUFFSIZE , sizeof(char))); binmail = (char *) (calloc(BUFFSIZE , sizeof(char))); old_format = 0; tete_exped = tete_route = tete_desti = NULL; for (i = 0; i < NB_AUTOMESS; i++) auto_mess[i] = 0; printf ("Epurmess V%s\n\n", VERSION); for (i = 1; i < ac; i++) { if (strnicmp ("/O", av[i], 2) == 0) { old_format = 1; printf ("Archive in old format\n"); } } defauts (); if (access (dirmes_sys, 0)) { fprintf (stderr, "Cannot find %s\n", dirmes_sys); exit (0); } heure = time (NULL); minimum = heure - (10L * 12L * 30L * 24L * 3600L); maximum = heure + (10L * 12L * 30L * 24L * 3600L); if ((fcr = fopen (compte_rendu, "rt")) != NULL) { if (fread (s, 80, 1, fcr)) { fclose (fcr); /* if ((heure - atol (s)) > 864000L) { fcr = fopen (compte_rendu, "wt"); #ifdef ENGLISH fprintf (fcr, "0\n\n"); fprintf (fcr, "EPURMESS was not done because your last EPURMESS was done more than 24h ago. \n\n"); fprintf (fcr, "Please verify the system clock!!!\n\n"); fprintf (fcr, "Kill this file (%s) to validate EPURMESS. \n", compte_rendu); printf ("Last update > 24h. EPURMESS was not done. \n"); #else fprintf (fcr, "0\n\n"); fprintf (fcr, "EPURMESS n'a pas ‚t‚ valid‚ car la derniŠre mise a jour remonte … plus de 24h.\n\n"); fprintf (fcr, "V‚rifiez votre horloge !!! \n\n"); fprintf (fcr, "Supprimer ce fichier (%s) pour revalider EPURMESS.\n", compte_rendu); printf ("Date de derniŠre mise … jour > 24h. EPURMESS non effectu‚.\n"); #endif fclose (fcr); exit (1); } } else fclose (fcr); */ } } #ifdef ENGLISH printf ("%s - Saves dirmes.sys file into dirmes.old file \n\n", date_mbl_new (time (NULL))); #else printf ("%s - Sauvegarde du fichier dirmes.sys en dirmes.old\n\n", date_mbl_new (time (NULL))); #endif if (!copy_ (dirmes_sys, dirmes_old)) { #ifdef ENGLISH printf ("%s - Cannot save dirmes.sys file into dirmes.old file !! \n\n", date_mbl_new (time (NULL))); #else printf ("%s - Sauvegarde du fichier dirmes.sys en dirmes.old impossible !!\n\n", date_mbl_new (time (NULL))); #endif } if ((fptr = fopen (dirmes_sys, "rb")) == NULL) { #ifdef ENGLISH printf ("Cannot open '%s' \n", dirmes_sys); #else printf ("Erreur ouverture '%s'\n", dirmes_sys); #endif exit (1); } if ((dptr = fopen (dirmes_new, "wb")) == NULL) { exit (1); } nbp = nbb = numtot = numenr = numsup = numarc = 0L; entete_liste (); if (fread (&entete, sizeof (bullist), 1, fptr) == 0) { #ifdef ENGLISH printf ("Error while reading file '%s'\n", dirmes_sys); #else printf ("Erreur lecture fichier '%s' \n", dirmes_sys); #endif exit (1); } if (entete.numero > MAX_RENUM) { renum = 1; entete.numero -= DEL_RENUM; } if (fwrite (&entete, sizeof (bullist), 1, dptr) == 0) { #ifdef ENGLISH printf ("Error while writing file '%s'\n", dirmes_new); #else printf ("Erreur ecriture fichier '%s' \n", dirmes_new); #endif exit (1); } record = 1L; strncpy (mycall, entete.exped, sizeof (mycall)); while (1) { ecrit = 1; if (fread (&entete, sizeof (bullist), 1, fptr) == 0) break; entete.bbsf[6] = '\0'; entete.bbsv[40] = '\0'; entete.exped[6] = '\0'; entete.desti[6] = '\0'; entete.bid[12] = '\0'; entete.titre[60] = '\0'; if (renum) { if ((entete.numero - DEL_RENUM) < 1L) { entete.status = 'A'; } } memset (entete.free, '\0', LGFREE); unite = (unsigned int) (entete.numero % 10); if (entete.type == '\0') { #ifdef __linux__ sprintf (old_name, "%smail%d/m_%06ld.mes", mail, unite, entete.numero); sprintf (bin_name, "%smail%d/m_%06ld.mes", binmail, unite, entete.numero); #else sprintf (old_name, "%sMAIL%d\\M_%06ld.MES", mail, unite, entete.numero); sprintf (bin_name, "%sMAIL%d\\M_%06ld.MES", binmail, unite, entete.numero); #endif fbb_unlink (old_name); fbb_unlink (bin_name); continue; } aff_status (&entete); def = max; change_defauts (&def, &entete); if ((entete.datech < minimum) || (entete.datech > maximum)) entete.status = 'A'; if ((entete.date < minimum) || (entete.date > maximum)) entete.status = 'A'; if ((entete.datesd < minimum) || (entete.datesd > maximum)) entete.datesd = entete.date; /* Message erronne */ if ((entete.taille > 10000000L) || (entete.taille < 0)) entete.status = 'A'; if (entete.datech > heure) entete.datech = heure; if (entete.date > heure) entete.date = heure; #ifdef __linux__ sprintf (old_name, "%smail%d/m_%06ld.mes", mail, unite, entete.numero); sprintf (bin_name, "%smail%d/m_%06ld.mes", binmail, unite, entete.numero); #else sprintf (old_name, "%sMAIL%d\\M_%06ld.MES", mail, unite, entete.numero); sprintf (bin_name, "%sMAIL%d\\M_%06ld.MES", binmail, unite, entete.numero); #endif if ((entete.type == 'P') && (entete.status == 'N') && (*entete.bbsv)) { if (!is_route (entete.fbbs) && (def.rr) && (heure - entete.date >= def.rr)) { message_retour (1, &entete, heure); entete.status = 'A'; } else if (!is_route (entete.forw) && (def.rt) && (heure - entete.date >= def.rt)) { message_retour (0, &entete, heure); entete.status = 'A'; } } if ((entete.type == 'A') && (entete.status != 'N')) { /* Destruction immediate */ printf (DETR); fbb_unlink (old_name); fbb_unlink (bin_name); ++numsup; ecrit = 0; } else if ((entete.type == 'P') || (entete.type == 'A')) { if ((entete.status == '$') && (heure - entete.datech >= def.bd)) { entete.status = 'X'; entete.datech = heure; fbb_unlink (bin_name); printf (EXPI); } if ((entete.status == 'N') && (heure - entete.datech >= def.pn)) { entete.status = 'X'; entete.datech = heure; fbb_unlink (bin_name); printf (EXPI); } if ((entete.status == 'Y') && (heure - entete.datech >= def.py)) { entete.status = 'X'; entete.datech = heure; fbb_unlink (bin_name); printf (EXPI); } if ((entete.status == 'F') && (heure - entete.datech >= def.pf)) { entete.status = 'K'; entete.datech = heure; fbb_unlink (bin_name); printf (SUPP); } if ((entete.status == 'X') && (heure - entete.datech >= def.px)) { entete.status = 'K'; entete.datech = heure; fbb_unlink (bin_name); printf (SUPP); } if ((entete.status == 'K') && (heure - entete.datech >= def.pk)) { entete.status = 'A'; entete.datech = heure; } if (entete.status == 'A') { /* Archivage immediat */ fbb_unlink (bin_name); if (archive_p) { sprintf (new_name, "%sPRIV.%02d", old_mail, semaine ()); if ((fpto = fopen (new_name, "at")) != NULL) { ent_arch (fpto, &entete); if ((fpti = fopen (old_name, "rt")) != NULL) { while (fgets (buffer, 256, fpti)) { fputs (buffer, fpto); } fclose (fpti); } fprintf (fpto, "\n/EX\n"); fclose (fpto); } printf (ARCH); ++numarc; } else { printf (DETR); ++numsup; } fbb_unlink (old_name); ecrit = 0; } if (ecrit) ++nbp; } else { if ((entete.status == 'N') && (heure - entete.datech >= def.bn)) { entete.status = 'X'; entete.datech = heure; fbb_unlink (bin_name); printf (EXPI); } if ((entete.status == '$') && (heure - entete.datech >= def.bd)) { entete.status = 'X'; entete.datech = heure; fbb_unlink (bin_name); printf (EXPI); } if ((entete.status == 'Y') && (heure - entete.datech >= def.by)) { entete.status = 'X'; entete.datech = heure; fbb_unlink (bin_name); printf (EXPI); } if ((entete.status == 'F') && (heure - entete.datech >= def.bf)) { entete.status = 'K'; entete.datech = heure; fbb_unlink (bin_name); printf (SUPP); } if ((entete.status == 'X') && (heure - entete.datech >= def.bx)) { entete.status = 'K'; entete.datech = heure; fbb_unlink (bin_name); printf (SUPP); } if ((entete.status == 'K') && (heure - entete.datech >= def.bk)) { entete.status = 'A'; entete.datech = heure; } if (entete.status == 'A') { /* Archivage immediat */ fbb_unlink (bin_name); if (archive_b) { sprintf (new_name, "%sBULL.%02d", old_mail, semaine ()); if ((fpto = fopen (new_name, "at")) != NULL) { ent_arch (fpto, &entete); if ((fpti = fopen (old_name, "rt")) != NULL) { while (fgets (buffer, 256, fpti)) fputs (buffer, fpto); fclose (fpti); } fprintf (fpto, "\n/EX\n"); fclose (fpto); } printf (ARCH); ++numarc; } else { printf (DETR); ++numsup; } fbb_unlink (old_name); ecrit = 0; } if (ecrit) ++nbb; } if (ecrit) { ++numtot; if (entete.status != 'K') ++numenr; ++record; } if (ecrit) { if (renum) { char ren_name[257]; entete.numero -= DEL_RENUM; unite = (unsigned int) (entete.numero % 10); #ifdef __linux__ sprintf (ren_name, "%smail%d/m_%06ld.mes", mail, unite, entete.numero); #else sprintf (ren_name, "%sMAIL%d\\M_%06ld.MES", mail, unite, entete.numero); #endif /* delete the binary file */ unlink (bin_name); /* rename the ascii file */ newname (old_name, ren_name); } if (fwrite (&entete, sizeof (bullist), 1, dptr) == 0) { #ifdef ENGLISH printf ("Error while writing file '%s'\n", dirmes_old); #else printf ("Erreur ecriture fichier '%s' \n", dirmes_old); #endif exit (1); } } putchar ('\n'); } putchar ('\n'); fclose (dptr); fclose (fptr); #ifdef ENGLISH printf ("Saves into dirmes.old - Copies dirmes.new into dirmes.sys \n"); #else printf ("Sauvegarde dans dirmes.old - Recopie dirmes.new dans dirmes.sys\n"); #endif if (!copy_ (dirmes_new, dirmes_sys)) { #ifdef ENGLISH printf ("%s - Cannot save dirmes.new file into dirmes.sys file !! \n\n", date_mbl_new (time (NULL))); #else printf ("%s - Sauvegarde du fichier dirmes.new en dirmes.sys impossible !!\n\n", date_mbl_new (time (NULL))); #endif } print_compte_rendu (); return (0); } void print_compte_rendu () { FILE *fcr; #ifdef ENGLISH printf ("\n"); printf ("File cleared : %4ld private message(s) \n", nbp); printf (" : %4ld bulletin message(s) \n", nbb); printf (" : %4ld active message(s) \n", numenr); printf (" : %4ld killed message(s) \n", numtot - numenr); printf (" : %4ld total message(s) \n", numtot); printf (" : %4ld archived message(s) \n", numarc); printf (" : %4ld destroyed message(s) \n", numsup); printf (" : %4d Timed-out message(s) \n", auto_mess[0]); printf (" : %4d No-Route message(s) \n\n", auto_mess[1]); if ((fcr = fopen (compte_rendu, "wt")) != NULL) { fprintf (fcr, "%ld\n\n", heure); fprintf (fcr, "File cleared : %4ld private message(s) \n", nbp); fprintf (fcr, " : %4ld bulletin message(s) \n", nbb); fprintf (fcr, " : %4ld active message(s) \n", numenr); fprintf (fcr, " : %4ld killed message(s) \n", numtot - numenr); fprintf (fcr, " : %4ld total message(s) \n", numtot); fprintf (fcr, " : %4ld archived message(s) \n", numarc); fprintf (fcr, " : %4ld destroyed message(s) \n", numsup); fprintf (fcr, " : %4d Timed-out message(s) \n", auto_mess[0]); fprintf (fcr, " : %4d No-Route message(s) \n\n", auto_mess[1]); fprintf (fcr, "Start computing : %s\n", strdt (heure)); fprintf (fcr, "End computing : %s\n", strdt (time (NULL))); fclose (fcr); } #else printf ("\n"); printf ("Fichier ‚pur‚ : %4ld message(s) priv‚(s) \n", nbp); printf (" : %4ld message(s) bulletin(s)\n", nbb); printf (" : %4ld message(s) actif(s) \n", numenr); printf (" : %4ld message(s) supprim‚(s)\n", numtot - numenr); printf (" : %4ld message(s) total \n", numtot); printf (" : %4ld message(s) archiv‚(s) \n", numarc); printf (" : %4ld message(s) d‚truit(s) \n", numsup); printf (" : %4d message(s) oubli‚(s) \n", auto_mess[0]); printf (" : %4d message(s) sans route \n\n", auto_mess[1]); if (fcr = fopen (compte_rendu, "wt")) { fprintf (fcr, "%ld\n\n", heure); fprintf (fcr, "Fichier ‚pur‚ : %4ld message(s) priv‚(s) \n", nbp); fprintf (fcr, " : %4ld message(s) bulletin(s)\n", nbb); fprintf (fcr, " : %4ld message(s) actif(s) \n", numenr); fprintf (fcr, " : %4ld message(s) supprim‚(s)\n", numtot - numenr); fprintf (fcr, " : %4ld message(s) total \n", numtot); fprintf (fcr, " : %4ld message(s) archiv‚(s) \n", numarc); fprintf (fcr, " : %4ld message(s) d‚truit(s) \n", numsup); fprintf (fcr, " : %4d message(s) oubli‚(s) \n", auto_mess[0]); fprintf (fcr, " : %4d message(s) sans route \n\n", auto_mess[1]); fprintf (fcr, "Debut du traitement : %s\n", strdt (heure)); fprintf (fcr, "Fin du traitement : %s\n", strdt (time (NULL))); fclose (fcr); } #endif } void change_defauts (param * def, bullist * bull) { deslist *lptr; lptr = tete_exped; while (lptr) { if (strcmp (lptr->nom, bull->exped) == 0) { def->bf = def->bx = def->pf = def->px = (long) lptr->delai * 86400L; break; } lptr = lptr->suiv; } lptr = tete_route; while (lptr) { if (strcmp (lptr->nom, bull->bbsv) == 0) { def->bf = def->bx = def->pf = def->px = (long) lptr->delai * 86400L; break; } lptr = lptr->suiv; } lptr = tete_desti; while (lptr) { if (strcmp (lptr->nom, bull->desti) == 0) { def->bf = def->bx = def->pf = def->px = (long) lptr->delai * 86400L; break; } lptr = lptr->suiv; } } void entete_liste (void) { #ifdef ENGLISH printf ("Act Msg# TS Dim. To @ BBS From Date Datexp Subject\n"); #else printf ("Act Msg# TS Dim. Pour @ BBS Exp. Date Datexp Sujet \n"); #endif } char *bbs_via (char *s) { int nb = 0; static char bbs[80]; while ((*s) && (*s != '.')) { if (nb == 6) break; bbs[nb++] = *s++; } bbs[nb] = '\0'; return (bbs); } void aff_status (bullist * ligne) { int i; char *ptri, *ptro; char bbs_v[42], date[40], datech[40], titre[21]; if (*(ligne->bbsv)) sprintf (bbs_v, "@%-6s", bbs_via (ligne->bbsv)); else *bbs_v = '\0'; strcpy (datech, date_mbl_new (ligne->datech)); strcpy (date, date_mbl_new (ligne->date)); ptri = ligne->titre; ptro = titre; for (i = 0; i < 20; i++) { if (*ptri == '\0') break; if (*ptri == '\a') *ptro = ' '; else *ptro = *ptri; ++ptri; ++ptro; } *ptro = '\0'; #ifdef ENGLISH printf ("Read %6ld %c%c %5ld %-6s%7s %-6s %-6s %s %1.19s\r", ligne->numero, ligne->type, ligne->status, ligne->taille, ligne->desti, bbs_v, ligne->exped, date, datech, titre); #else printf ("Lect %6ld %c%c %5ld %-6s%7s %-6s %-6s %s %1.19s\r", ligne->numero, ligne->type, ligne->status, ligne->taille, ligne->desti, bbs_v, ligne->exped, date, datech, titre); #endif } int find (char *s) { char *t = s; int n = 0; int dernier = 0, chiffre = 0, lettre = 0; while (*t) { if (!isalnum (*t)) return (FALSE); *t = toupper (*t); dernier = (isdigit (*t)); if (isdigit (*t)) ++chiffre; else ++lettre; ++t; ++n; } if (ext_call) { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir au moins un chiffre * doit contenir au moins une lettre */ if ((n < 3) || (n > 6) || (chiffre < 1) || (lettre < 1)) return (0); } else { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir 1 ou 2 chiffres . * ne doit pas se terminer par un chiffre . */ if ((n < 3) || (n > 6) || (chiffre < 1) || (chiffre > 2) || dernier) return (0); } return (1); } char *date_mbl_new (long temps) { struct tm *sdate; static char cdate[40]; sdate = localtime (&temps); #ifdef ENGLISH sprintf (cdate, "%02d-%02d-%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday); #else sprintf (cdate, "%02d/%02d/%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100); #endif return (cdate); } char *strdt (long temps) { struct tm *sdate; static char cdate[80]; sdate = localtime (&temps); #ifdef ENGLISH sprintf (cdate, "%02d-%02d-%02d %02d:%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min); #else sprintf (cdate, "%02d/%02d/%02d %02d:%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100, sdate->tm_hour, sdate->tm_min); #endif return (cdate); } void print_zone() { char *tz; printf( "TZ: %s ", (tz = getenv( "TZ" )) ? tz : "not set" ); printf( "- daylight: %d ", daylight ); printf( "- timezone: %ld ", timezone ); printf( "- time zone names: %s %s\n", tzname[0], tzname[1] ); } void defauts (void) { int i; unsigned int flag; int init = 1; int nolig, lig; FILE *fptr; char *c_path; char *ligne; char *str; static char *tzlig; char *ptr; char *temp; c_path = (char *) (calloc(BUFFSIZE , sizeof(char))); ligne = (char *) (calloc(BUFFSIZE , sizeof(char))); str = (char *) (calloc(80 , sizeof(char))); tzlig = (char *) (calloc(80 , sizeof(char))); temp = (char *) (calloc(20 , sizeof(char))); if (read_fbb_conf(NULL) > 0) { #ifdef ENGLISH fprintf (stderr, "Cannot open fbb.conf file \n"); #else fprintf (stderr, "Erreur ouverture fichier fbb.conf\n"); #endif exit (1); /* and users base directory */ } ptr = find_fbb_conf("vers", 0); if (ptr == NULL) { #ifdef ENGLISH fprintf (stderr, "Version number missing in fbb.conf\n"); #else fprintf (stderr, "Pas de numéro dans le fbb.conf\n"); #endif exit (1); } sprintf (temp, "FBB%s", VERSION); /* Only test the major number ... */ if (strncasecmp (temp, ptr, 4) != 0) { #ifdef ENGLISH fprintf (stderr, "Wrong version number in fbb.conf\n"); #else fprintf (stderr, "Numéro de version erroné dans fbb.conf\n"); #endif exit (1); } #ifdef __linux__ fprintf (stderr, "Configuration version : %s\n", ptr); #else fprintf (stderr, "Configuration version : %s\r", ptr); #endif ptr = find_fbb_conf("call", 0); if (ptr == NULL) err_keyword("call"); strcpy (callsign, strupr (ptr)); strcpy (mypath, strupr (ptr)); if ((ptr = strchr (callsign, '.')) != NULL) *ptr = '\0'; #ifdef ENGLISH fprintf (stderr, "Callsign : %s\n", callsign); fprintf (stderr, "Address : %s\n", mypath); #else fprintf (stderr, "Indicatif : %s\n", callsign); fprintf (stderr, "Addresse : %s\n", mypath); #endif /* Mail.in */ ptr = find_fbb_conf("impo", 0); if (ptr == NULL) ptr = def_fbb_conf("impo"); if (ptr == NULL) err_keyword("impo"); strcpy (mail_in, strupr (ptr)); #ifdef __linux__ back2slash (mail_in); #endif #ifdef ENGLISH fprintf (stderr, "MAIL.IN file : %s\n", mail_in); #else fprintf (stderr, "fichier MAIL.IN: %s\n", mail_in); #endif /* path of conf files */ ptr = find_fbb_conf("conf", 0); if (ptr == NULL) ptr = def_fbb_conf("conf"); if (ptr == NULL) err_keyword("conf"); strcpy (c_path, test_back_slash(ptr)); #ifdef ENGLISH fprintf (stderr, "Conf directory : %s\n", c_path); #else fprintf (stderr, "Configuration : %s\n", c_path); #endif /* flags */ ptr = find_fbb_conf("fbbf", 0); if (ptr == NULL) ptr = def_fbb_conf("fbbf"); if (ptr == NULL) err_keyword("fbbf"); flag = 0; sscanf (ptr, "%s %u", str, &flag); ext_call = ((flag & 4096) != 0); /* diff GMT */ ptr = find_fbb_conf("loca", 0); if (ptr == NULL) ptr = def_fbb_conf("loca"); if (ptr == NULL) err_keyword("loca"); #ifdef ENGLISH fprintf (stderr, "GMT difference : %d - ", atoi (ptr)); #else fprintf (stderr, "Diff‚rence GMT : %d - ", atoi (ptr)); #endif tzset (); /* get timezone info */ print_zone(); putchar ('\n'); sleep (2); lig = nolig = 0; sprintf(ligne, "%sepurmess.ini", c_path); #ifdef __linux__ if ((fptr = fopen (ligne, "r")) != NULL) #else if ((fptr = fopen (ligne, "rt")) != NULL) #endif { while (fgets (ligne, 256, fptr)) { epure (ligne); nolig++; if ((*ligne == '#') || (*ligne == '\0') || (*ligne == '\032')) continue; lig++; if ((lig < 20) && (lig > 21)) strupr (ligne); if (init) { switch (lig) { case 1: strcpy (mail, ligne); #ifdef __linux__ back2slash (mail); #endif break; case 2: strcpy (binmail, ligne); #ifdef __linux__ back2slash (binmail); #endif break; case 3: strcpy (old_mail, ligne); #ifdef __linux__ back2slash (old_mail); #endif break; case 4: strcpy (dirmes_sys, ligne); #ifdef __linux__ back2slash (dirmes_sys); #endif break; case 5: strcpy (dirmes_old, ligne); #ifdef __linux__ back2slash (dirmes_old); #endif break; case 6: strcpy (dirmes_new, ligne); #ifdef __linux__ back2slash (dirmes_new); #endif break; case 7: strcpy (compte_rendu, ligne); #ifdef __linux__ back2slash (compte_rendu); #endif break; case 8: archive_p = archive_b = 1; sscanf (ligne, "%d %d", &archive_p, &archive_b); break; case 9: max.pn = atol (ligne) * 86400L; break; case 10: max.py = atol (ligne) * 86400L; break; case 11: max.pf = atol (ligne) * 86400L; break; case 12: max.px = atol (ligne) * 86400L; break; case 13: max.pk = atol (ligne) * 86400L; break; case 14: max.bn = atol (ligne) * 86400L; break; case 15: max.bd = atol (ligne) * 86400L; break; case 16: max.by = atol (ligne) * 86400L; break; case 17: max.bx = atol (ligne) * 86400L; break; case 18: max.bf = atol (ligne) * 86400L; break; case 19: max.bk = atol (ligne) * 86400L; break; case 20: sscanf (ligne, "%ld %[^\n]", &max.rt, text_rt[0]); if (max.rt == 0) *text_rt[0] = '\0'; max.rt *= 86400L; break; case 21: sscanf (ligne, "%ld %[^\n]", &max.rr, text_rt[1]); if (max.rr == 0) *text_rt[1] = '\0'; max.rr *= 86400L; break; case 22: nb_return_lines = atoi (ligne); break; case 23: if (*ligne != '-') erreur_arg (nolig); init = 0; break; default: erreur_arg (nolig); break; } } else { if (*ligne == '-') break; init_liste (ligne, nolig); } } for (i = 0; i < NB_AUTOMESS; i++) { char *ptri; char *ptro; ptri = ptro = text_rt[i]; while (*ptri) { if ((*ptri == '$') && (*(ptri + 1) == 'W')) { *ptro = '\n'; ++ptri; } else *ptro = *ptri; ++ptri; ++ptro; } *ptro = '\0'; } } else { #ifdef ENGLISH fprintf (stderr, "Cannot open EPURMESS.INI file \n"); #else fprintf (stderr, "Erreur ouverture fichier EPURMESS.INI\n"); #endif exit (1); } } void init_liste (char *ligne, int nolig) { char *nom; int temps; int init = 0; char *mode; deslist *lptr = tete_desti; nom = (char *) (calloc(80 , sizeof(char))); mode = (char *) (calloc(80 , sizeof(char))); if (sscanf (ligne, "%s %s %d", mode, nom, &temps) != 3) erreur_arg (nolig); switch (toupper (*mode)) { case 'F': case '<': lptr = tete_exped; if (lptr == NULL) { tete_exped = lptr = malloc (sizeof (deslist)); init = 1; } break; case 'V': case '@': lptr = tete_route; if (lptr == NULL) { tete_route = lptr = malloc (sizeof (deslist)); init = 1; } break; case 'T': case '>': lptr = tete_desti; if (lptr == NULL) { tete_desti = lptr = malloc (sizeof (deslist)); init = 1; } break; default: erreur_arg (nolig); break; } if (init == 0) { while (lptr->suiv) lptr = lptr->suiv; lptr->suiv = malloc (sizeof (deslist)); lptr = lptr->suiv; } lptr->suiv = NULL; strncpy (lptr->nom, nom, 6); lptr->nom[6] = '\0'; lptr->delai = temps; } #if 0 void copy_ (char *oldfich, char *newfich) { char s[256]; #ifdef __linux__ sprintf (s, "cp %s %s > /dev/null", oldfich, newfich); #else sprintf (s, "copy %s %s", oldfich, newfich); #endif system (s); } #endif #define TAIBUF 16384 /* static char buffer[TAIBUF]; */ int copy_ (char *oldfich, char *newfich) { int retour = 1; int fd_orig; int fd_dest; int nb_lus; int ret; int dest_access; char *buffer; buffer = (char *) (calloc(TAIBUF , sizeof(char))); if (buffer == NULL) { fprintf (stderr, "Not enough memory for epurmess file copy function\n"); return (0); } if ((fd_orig = open (oldfich, O_RDONLY | O_BINARY, S_IREAD | S_IWRITE)) == EOF) { fprintf (stderr, "Cannot find %s\n", oldfich); free (buffer); return (0); } dest_access = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY; if ((fd_dest = open (newfich, dest_access, S_IREAD | S_IWRITE)) == EOF) { close (fd_orig); fprintf (stderr, "Cannot create %s\n", newfich); free (buffer); return (0); } for (;;) { nb_lus = _read (fd_orig, buffer, TAIBUF); if (nb_lus == -1) { retour = 0; break; } if (nb_lus == 0) { retour = 1; break; } ret = _write (fd_dest, buffer, nb_lus); if (ret != nb_lus) { retour = 0; break; } } close (fd_orig); close (fd_dest); free (buffer); return (retour); } void newname (char *oldfich, char *newfich) { rename (oldfich, newfich); } int is_route (char *fbbs) { int i; for (i = 0; i < NBMASK; i++) if (fbbs[i]) return (1); return (0); } void erreur_arg (int numero) { #ifdef ENGLISH printf ("Error EPURMESS.INI in line Nb %d \n", numero); #else printf ("Erreur fichier EPURMESS.INI ligne Nø%d\n", numero); #endif exit (1); } int semaine (void) { long temps = time (NULL); struct tm *sdate = localtime (&temps); #if 0 int ny = sdate->tm_yday - 1; int nw = sdate->tm_wday; int first_day; if (nw == 0) nw = 6; else --nw; if (ny <= nw) first_day = nw - ny; else first_day = 7 - ((ny - nw) % 7); return ((((ny + first_day) / 7) % 52) + 1); #endif int ny = sdate->tm_yday; /* Numero du jour dans l'annee */ int nw = sdate->tm_wday; /* Numero du jour dans la semaine */ if (nw == 0) nw = 6; else --nw; /* 0 = dimanche -> 0 = lundi */ if (ny < nw) /* Premiere semaine de l'annee ? */ { temps -= (3600L * 24L * (ny + 1)); sdate = localtime (&temps); ny = sdate->tm_yday; /* Numero du jour de l'annee precedente */ nw = sdate->tm_wday; /* Numero du jour de la semaine avant */ if (nw == 0) nw = 6; else --nw; /* 0 = dimanche -> 0 = lundi */ } return ((7 - nw + ny) / 7); } void ent_arch (FILE * fptr, bullist * pm) { char *bbsv; long temps = pm->date; struct tm *sdate = gmtime (&temps); bbsv = (char *) (calloc(80 , sizeof(char))); if (old_format) { fprintf (fptr, "Msg #%ld Type:%c Stat:%c To:%s@%s From:%s Date:%s \n", pm->numero, pm->type, pm->status, pm->desti, pm->bbsv, pm->exped, strdt (pm->date)); fprintf (fptr, "Bid: %s Subject: %s\n", pm->bid, pm->titre); } else { if (*pm->bbsv) sprintf (bbsv, " @ %s", pm->bbsv); else *bbsv = '\0'; fprintf (fptr, "S%c %s%s < %s $%s\n", pm->type, pm->desti, bbsv, pm->exped, pm->bid); fprintf (fptr, "%s\n", pm->titre); } fprintf (fptr, "R:%02d%02d%02d/%02d%02dZ @:%s\n", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min, mypath); } void message_retour (int num_txt, bullist * entete, long heure) { FILE *mess; FILE *fptr; int unite; int i; int nrl; char *bbs; char *ligne; char *scan; ligne = (char *) (calloc(BUFFSIZE , sizeof(char))); bbs = (char *) (calloc(42 , sizeof(char))); /* printf("\nDemande de message %d\n", num_txt); printf("Message = <%s>\n", text_rt[num_txt]); sleep(5); */ if (*text_rt[num_txt] == '\0') return; if (num_txt >= NB_AUTOMESS) return; nrl = nb_return_lines; *bbs = '\0'; ++auto_mess[num_txt]; unite = entete->numero % 10; sprintf (ligne, "%sMAIL%d\\M_%06ld.MES", mail, unite, entete->numero); if ((mess = fopen (ligne, "rt")) == NULL) { return; } while (fgets (ligne, 256, mess)) { if (strncmp (ligne, "R:", 2) != 0) break; scan = ligne; while ((*scan) && (*scan != '@')) ++scan; ++scan; if (*scan == ':') ++scan; i = 0; while (isgraph (*scan)) { bbs[i] = toupper (*scan); ++scan; if (++i == 40) break; } bbs[i] = '\0'; } if (*bbs == '\0') strcpy (bbs, callsign); if ((fptr = fopen (mail_in, "at")) != NULL) { fprintf (fptr, "SP %s @ %s < %s\n", entete->exped, bbs, callsign); fprintf (fptr, "Undelivered mail in %s\n\n", callsign); fprintf (fptr, "%s BBS, %s%s", callsign, ctime (&heure), text_rt[num_txt]); fprintf (fptr, "\n\nSP %s @ %s < %s\n", entete->desti, entete->bbsv, entete->exped); fprintf (fptr, "%s\n", entete->titre); while (fgets (ligne, 256, mess)) { if (nrl-- <= 0) break; if (strncmpi (ligne, "/ACK", 4) != 0) fputs (ligne, fptr); } fprintf (fptr, "/EX\n"); } fclose (fptr); fclose (mess); } fbb-7.0.10/src/clr_user.c0000644000175000017500000001153213747456632012045 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #define ENGLISH #include #include #include #include #include #include #include #define FALSE 0 #define TRUE 1 #ifdef __linux__ #define __a2__ __attribute__ ((packed, aligned(2))) #else #define __a2__ #endif #define INF_SYS "inf.sys" #define BUFFSIZE 256 typedef struct typindic { char call[7]; char num; } indicat; typedef struct { indicat indic ; /* 8 Callsign */ indicat relai[8] ; /* 64 Digis path */ long lastmes __a2__ ; /* 4 Last L number */ long nbcon __a2__ ; /* 4 Number of connexions */ long hcon __a2__ ; /* 4 Last connexion date */ long lastyap __a2__ ; /* 4 Last YN date */ unsigned short flags ; /* 2 Flags */ unsigned short on_base ; /* 2 ON Base number */ unsigned char nbl ; /* 1 Lines paging */ unsigned char lang ; /* 1 Language */ long newbanner __a2__; /* 4 Last Banner date */ unsigned short download ; /* 2 download size (KB) = 100 */ char free[20] ; /* 20 Reserved */ char theme ; /* 1 Current topic */ char nom[18] ; /* 18 1st Name */ char prenom[13]; /* 13 Christian name */ char adres[61] ; /* 61 Address */ char ville[31] ; /* 31 City */ char teld[13] ; /* 13 home phone */ char telp[13] ; /* 13 modem phone */ char home[41] ; /* 41 home BBS */ char qra[7] ; /* 7 Qth Locator */ char priv[13] ; /* 13 PRIV directory */ char filtre[7] ; /* 7 LC choice filter */ char pass[13] ; /* 13 Password */ char zip[9] ; /* 9 Zipcode */ } info ; /* Total : 360 bytes */ FILE *fichi; char* system_dir; char *strlwr (char *txt) { char *scan = txt; while (*scan) { if (isupper (*scan)) *scan = tolower (*scan); ++scan; } return (txt); } void err_keyword(char *keyword) { fprintf(stderr, "Error : keyword \"%s\" missing in fbb.conf file\n", keyword); exit(1); } char *test_back_slash (char *chaine) { static char temp[256]; strcpy(temp, chaine); if ((strlen(temp) == 0) #ifdef __linux__ || (temp[strlen (temp) - 1] != '/')) strcat(temp, "/"); #else || (temp[strlen (temp) - 1] != '\\')) strcat(temp, "\\"); #endif return (temp); } void ouvre_nomenc (void) { char *filename = (char *) (calloc(BUFFSIZE , sizeof(char))); sprintf (filename, "%s%s", system_dir, INF_SYS); if ((fichi = fopen (filename, "rb")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Cannot find %s !! \n", filename); #else fprintf (stderr, "Erreur ouverture %s !!\n", filename); #endif exit (1); } else fprintf (stderr, "%s file found\n",filename); } int main (int ac, char **av) { info buf; char *ptr; long rinfo = 0L; long tot_dw = 0L; long nb_users = 0L; long temps = time (NULL); struct tm *tm = localtime (&temps); system_dir = (char *) (calloc(BUFFSIZE , sizeof(char))); fprintf (stderr, "CLR_USER V%s\n\n", VERSION); /* if (tm->tm_wday != 0) return(0); */ putchar ('\n'); puts (asctime (tm)); if (read_fbb_conf(NULL) > 0) { #ifdef ENGLISH fprintf (stderr, "Cannot open fbb.conf file \n"); #else fprintf (stderr, "Erreur ouverture fichier fbb.conf\n"); #endif exit (1); } /* path of conf files */ ptr = find_fbb_conf("data", 0); if (ptr == NULL) ptr = def_fbb_conf("data"); if (ptr == NULL) err_keyword("data"); strcpy (system_dir, test_back_slash(strlwr (ptr))); ouvre_nomenc(); while (fread ((char *) &buf, (int) sizeof (buf), 1, fichi)) { tot_dw += (long) buf.download; if (buf.download) { printf ("%6s : %dKB\n", buf.indic.call, buf.download); buf.download = 0; fseek (fichi, rinfo, 0); fwrite ((char *) &buf, (int) sizeof (buf), 1, fichi); } rinfo += sizeof (buf); fseek (fichi, rinfo, 0); ++nb_users; } fclose (fichi); #ifdef ENGLISH printf ("%ld callsigns ok \n", nb_users); printf ("%ld KB downloaded \n", tot_dw); #else printf ("%ld indicatifs \n", nb_users); printf ("%ld KB envoy‚s \n", tot_dw); #endif return (0); } fbb-7.0.10/src/maintinf.c0000644000175000017500000002775113747456632012046 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #define ENGLISH #ifdef __linux__ #include #include #include #define __NO_CTYPE #define INF_NEW "inf.new" #define INF_SYS "inf.sys" #define __a2__ __attribute__ ((packed, aligned(2))) #else #define __a2__ #define INF_NEW "inf.new" #define INF_SYS "inf.sys" #endif #include #include #include #include #include #define FALSE 0 #define TRUE 1 #define uchar unsigned char #define ushort unsigned short #define EXCLUDED(buf) (buf.flags & 0x1) typedef struct typindic { char call[7]; char num; } indicat; typedef struct { indicat indic; /* 8 Callsign */ indicat relai[8]; /* 64 Digis path */ long lastmes __a2__; /* 4 Last L number */ long nbcon __a2__; /* 4 Number of connexions */ long hcon __a2__; /* 4 Last connexion date */ long lastyap __a2__; /* 4 Last YN date */ ushort flags; /* 2 Flags */ ushort on_base; /* 2 ON Base number */ uchar nbl; /* 1 Lines paging */ uchar lang; /* 1 Language */ long newbanner __a2__; /* 4 Last Banner date */ ushort download; /* 2 download size (KB) = 100 */ char free[20]; /* 20 Reserved */ char theme; /* 1 Current topic */ char nom[18]; /* 18 1st Name */ char prenom[13]; /* 13 Christian name */ char adres[61]; /* 61 Address */ char ville[31]; /* 31 City */ char teld[13]; /* 13 home phone */ char telp[13]; /* 13 modem phone */ char home[41]; /* 41 home BBS */ char qra[7]; /* 7 Qth Locator */ char priv[13]; /* 13 PRIV directory */ char filtre[7]; /* 7 LC choice filter */ char pass[13]; /* 13 Password */ char zip[9]; /* 9 Zipcode */ } info; /* Total : 360 bytes */ typedef struct typindictri { char indic[7]; long pos; struct typindictri *suiv; } indictri; FILE *fichi, *ficho; char temp[500]; char system_dir[256]; indictri *tete; int rejet, nbindic; int ext_call = 0; static void defauts (void); static int find (char *s); static void check (info * bul); static void err_alloc (void); static void insere (char *ind, long pos); static void ouvre_nomenc (void); #ifdef __linux__ char *strupr (char *txt) { char *scan = txt; while (*scan) { if (islower (*scan)) *scan = toupper (*scan); ++scan; } return (txt); } char *strlwr (char *txt) { char *scan = txt; while (*scan) { if (isupper (*scan)) *scan = tolower (*scan); ++scan; } return (txt); } #endif char *test_back_slash (char *chaine) { static char temp[256]; strcpy(temp, chaine); if ((strlen(temp) == 0) #ifdef __linux__ || (temp[strlen (temp) - 1] != '/')) strcat(temp, "/"); #else || (temp[strlen (temp) - 1] != '\\')) strcat(temp, "\\"); #endif return (temp); } void err_keyword(char *keyword) { fprintf(stderr, "Error : keyword \"%s\"missing in fbb.conf file\n", keyword); exit(1); } void epure (char *ligne) { int lg; lg = strlen (ligne); if (ligne[lg - 1] == '\n') ligne[lg - 1] = '\0'; lg = strlen (ligne); if (ligne[lg - 1] == '\r') ligne[lg - 1] = '\0'; if (*ligne == '\032') *ligne = '\0'; } int main (int ac, char **av) { int rep; int auto_rep = 0; int monthes; info buf; long rinfo = 0; long i = 0; indictri *ptr; long temps = time (NULL); long timout; fprintf (stderr, "\nMAINTINF V%s\n\n", VERSION); #ifdef ENGLISH fprintf (stderr, "FBB software MUST be stopped !! \n\n"); #else fprintf (stderr, "Le logiciel FBB Doit etre arr‚t‚ !!\n\n"); #endif defauts (); rejet = nbindic = 0; timout = 86400L * 31L; /* 31 jours / mois */ if (ac == 1) { #ifdef ENGLISH fprintf (stderr, "Format : MAINTINF Monthes [/A]\n\nMonthes is \"time check\" to kill old callsigns (0 = no check) \n \n"); #else fprintf (stderr, "Format : MAINTINF Mois [/A]\n\nMois est le \"Test des dates\" pour supprimer les indicatifs obsoletes\n(0 = pas de test)\n"); #endif exit (0); } monthes = atoi (av[1]); timout *= monthes; if (ac >= 3) { ext_call = (strcmp (strupr (av[2]), "/N") == 0); if (ext_call) { --ac; ++av; #ifdef ENGLISH printf ("No callsign check \n"); #else printf ("Pas de test d'indicatif\n"); #endif } } if (ac == 3) auto_rep = (strcmp (strupr (av[2]), "/A") == 0); #ifdef ENGLISH if (monthes) printf ("Time check : %d monthes\n", monthes); else printf ("No Time check \n"); #else if (monthes) printf ("Test dates : %d mois \n", monthes); else printf ("Pas de test dates\n"); #endif sleep (2); ouvre_nomenc (); if ((tete = (indictri *) malloc (sizeof (indictri))) == NULL) err_alloc (); tete->suiv = NULL; rewind (fichi); while (fread ((char *) &buf, (int) sizeof (buf), 1, fichi)) { if ((!EXCLUDED (buf)) && (timout) && ((temps - buf.hcon) > timout)) { #ifdef ENGLISH printf ("rejects <%s> : Old callsign \n", buf.indic.call); #else printf ("rejŠte <%s> : Indicatif inusit‚\n", buf.indic.call); #endif ++rejet; } else if (find (buf.indic.call)) { insere (buf.indic.call, rinfo); } else { #ifdef ENGLISH printf ("rejects <%s> : Incorrect callsign\n", buf.indic.call); #else printf ("rejŠte <%s> : Indicatif incorrect\n", buf.indic.call); #endif ++rejet; } ++rinfo; } #ifdef ENGLISH printf ("%d callsigns ok \n", nbindic); printf ("%d callsigns rejected\n", rejet); printf ("---------------------------------------------\n\n"); #else printf ("%d indicatifs inse‚re‚s\n", nbindic); printf ("%d indicatifs rejete‚s\n", rejet); printf ("---------------------------------- \n\n"); #endif if (!auto_rep) { while (TRUE) { #ifdef ENGLISH fprintf (stderr, "Create %s (Y/N) : ", INF_NEW); #else fprintf (stderr, "Creation de %s (O/N) : ", INF_NEW); #endif rep = getchar (); #ifdef ENGLISH if ((rep == 'y') || (rep == 'Y') || (rep == 'n') || (rep == 'N')) #else if ((rep == 'o') || (rep == 'O') || (rep == 'n') || (rep == 'N')) #endif break; } putchar ('\n'); } #ifdef ENGLISH if ((auto_rep) || (toupper (rep) == 'Y')) { #else if ((auto_rep) || (toupper (rep) == 'O')) { #endif char filename[256]; sprintf (filename, "%s%s", system_dir, INF_NEW); if ((ficho = fopen (filename, "wb")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Error creating %s \n", filename); #else fprintf (stderr, "Impossible de creer %s\n", filename); #endif } else { ptr = tete; while ((ptr = ptr->suiv) != NULL) { fseek (fichi, ptr->pos * (long) sizeof (buf), 0); fread (&buf, sizeof (buf), 1, fichi); check (&buf); fwrite (&buf, sizeof (buf), 1, ficho); if ((++i % 10) == 0) #ifdef ENGLISH fprintf (stderr, "\r%ld callsigns ", i); #else fprintf (stderr, "\r%ld indicatifs ", i); #endif } #ifdef ENGLISH fprintf (stderr, "\r%ld callsigns ", i); #else fprintf (stderr, "\r%ld indicatifs ", i); #endif fclose (ficho); fputc ('\r', stderr); } #ifdef ENGLISH printf ("\nFile %s created\n\n", INF_NEW); printf ("\nYou must now change %s with %s !!\n", INF_SYS, INF_NEW); printf ("---------------------------------------------\n\n"); #else printf ("\nFichier %s cr‚‚\n\n", INF_NEW); printf ("\nRemplacer %s par %s !! \n", INF_SYS, INF_NEW); printf ("---------------------------------- \n\n"); #endif } fclose (fichi); return 0; } static void check (info * bul) { int i; bul->indic.call[6] = '\0'; for (i = 0; i < 8; i++) bul->relai[i].call[6] = '\0'; bul->nom[17] = '\0'; bul->prenom[12] = '\0'; bul->adres[60] = '\0'; bul->ville[30] = '\0'; bul->teld[12] = '\0'; bul->telp[12] = '\0'; bul->home[40] = '\0'; bul->qra[6] = '\0'; bul->priv[12] = '\0'; bul->filtre[6] = '\0'; bul->pass[12] = '\0'; bul->zip[8] = '\0'; if ((bul->nbcon < 0) || (bul->nbcon > 100000L)) bul->nbcon = 0L; if ((bul->nbl < (uchar) 4) || (bul->nbl > (uchar) 50)) bul->nbl = (uchar) 25; if (bul->lang > (uchar) 99) bul->lang = (uchar) 1; } static void insere (char *ind, long pos) { int cmp; indictri *pprec, *ptr, *ptemp; pprec = ptr = tete; while ((ptr = ptr->suiv) != NULL) { cmp = strcmp (ind, ptr->indic); if (cmp == 0) { printf ("rejects <%s> : already inserted\n", ind); ++rejet; return; } else if (cmp < 0) break; pprec = ptr; } if ((ptemp = (indictri *) malloc (sizeof (indictri))) == NULL) err_alloc (); ++nbindic; ptemp->suiv = ptr; pprec->suiv = ptemp; ptemp->pos = pos; strcpy (ptemp->indic, ind); } static int find (char *s) { char *t = s; int n = 0; int dernier = 0, chiffre = 0, lettre = 0; while (*t) { if (!isalnum (*t)) return (FALSE); *t = toupper (*t); dernier = (isdigit (*t)); if (isdigit (*t)) ++chiffre; else ++lettre; ++t; ++n; } /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir 1 ou 2 chiffres . * ne doit pas se terminer par un chiffre . */ if (ext_call) { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir au moins un chiffre * doit contenir au moins une lettre */ if ((n < 3) || (n > 6) || (chiffre < 1) || (lettre < 1)) return (0); } else { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir 1 ou 2 chiffres . * ne doit pas se terminer par un chiffre . */ if ((n < 3) || (n > 6) || (chiffre < 1) || (chiffre > 2) || dernier) return (0); } t = temp; while (isalnum (*s)) *t++ = *s++; *t = '\0'; t = temp; return (TRUE); } static void ouvre_nomenc (void) { char filename[256]; sprintf (filename, "%s%s", system_dir, INF_SYS); if ((fichi = fopen (filename, "rb")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Cannot find %s !! \n", filename); #else fprintf (stderr, "Erreur ouverture %s !!\n", filename); #endif exit (1); } } static void err_alloc (void) { #ifdef ENGLISH fprintf (stderr, "Memory allocation error \n"); #else fprintf (stderr, "Erreur allocation memoire\n"); #endif exit (1); } static void defauts (void) { unsigned int flag; char *ptr; char temp[20]; if (read_fbb_conf(NULL) > 0) { #ifdef ENGLISH fprintf (stderr, "Cannot open fbb.conf file \n"); #else fprintf (stderr, "Erreur ouverture fichier fbb.conf\n"); #endif exit (1); /* and users base directory */ } ptr = find_fbb_conf("vers", 0); if (ptr == NULL) { #ifdef ENGLISH fprintf (stderr, "Version number missing in fbb.conf\n"); #else fprintf (stderr, "Pas de numéro de version dans fbb.conf\n"); #endif exit (1); } /* sprintf (temp, "FBB%s", VERSION); if (strncasecmp (temp, ptr, 7) != 0) { #ifdef ENGLISH fprintf (stderr, "Wrong version number '%s' in fbb.conf\n", ptr); #else fprintf (stderr, "Numéro de version erroné '%s' dans fbb.conf\n", ptr); #endif exit (1); } fprintf (stderr, "Configuration version : %s\r\n", ptr); */ /* path of conf files */ ptr = find_fbb_conf("data", 0); if (ptr == NULL) ptr = def_fbb_conf("data"); if (ptr == NULL) err_keyword("data"); strcpy (system_dir, test_back_slash(strlwr (ptr))); /* flags */ ptr = find_fbb_conf("fbbf", 0); if (ptr == NULL) ptr = def_fbb_conf("fbbf"); if (ptr == NULL) err_keyword("fbbf"); flag = 0; sscanf (ptr, "%s %u", temp, &flag); ext_call = ((flag & 4096) != 0); } fbb-7.0.10/src/mbl_list.c0000644000175000017500000004231513613360505012020 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module Nø1 emulation WA7MBL */ static int mbl_lx (void); static int mbl_bloc_liste (void); static int strfind (bullist *, char *); static int teste_liste (bullist *); static int mess_bloc_liste (void); static void list_mine (char); /* Commande 'L' -> List messages */ #include "aff_stat.c" static int strfind (bullist * pbul, char *cherche) { return (strmatch (ltitre (1, pbul), cherche)); } static int manque_forward (bullist * lbul) { int i; if ((*lbul->bbsv) && (lbul->status == 'N')) { for (i = 0; i < NBMASK; i++) if (lbul->fbbs[i]) return (0); return (1); } return (0); } static int teste_liste (bullist * lbul) { if (lbul->numero < pvoie->recliste.debut) return (0); if (lbul->numero > pvoie->recliste.fin) return (0); if (lbul->date < pvoie->recliste.avant) return (0); if (lbul->date > pvoie->recliste.apres) return (0); if (!droits (COSYSOP)) { if (strcmp (lbul->desti, "KILL") == 0) return (0); if (lbul->type == 'A') return (0); if ((lbul->status == 'K') && (pvoie->recliste.status != 'K')) return (0); if ((lbul->status == 'A') && (pvoie->recliste.status != 'A')) return (0); } if ((pvoie->recliste.type) && (pvoie->recliste.type != lbul->type)) return (0); if ((pvoie->recliste.status) && (pvoie->recliste.status != lbul->status)) return (0); if ((pvoie->recliste.route) && (!manque_forward (lbul))) return (0); if ((*pvoie->recliste.exp) && (!strmatch (lbul->exped, pvoie->recliste.exp))) return (0); if ((*pvoie->recliste.dest) && (!strmatch (lbul->desti, pvoie->recliste.dest))) return (0); if (*pvoie->recliste.find) return (strfind (lbul, pvoie->recliste.find)); if (*pvoie->recliste.bbs) { if (*pvoie->recliste.bbs == '-') { if (*lbul->bbsv) return (0); } else { if (!strmatch (bbs_via (lbul->bbsv), pvoie->recliste.bbs)) return (0); } } return (1); } static int mbl_bloc_liste (void) { int retour = 1; unsigned offset = pvoie->recliste.offset; bloc_mess *bptr = pvoie->recliste.ptemp; bullist ligne; pvoie->sr_mem = pvoie->seq = FALSE; ouvre_dir (); while (bptr) { if (!pvoie->reverse) --offset; if (bptr->st_mess[offset].noenr) { read_dir (bptr->st_mess[offset].noenr, &ligne); if (ligne.numero < pvoie->recliste.debut) break; if ((ligne.type) && (droit_ok (&ligne, 1)) && (teste_liste (&ligne))) { if (pvoie->recliste.last-- == 0L) break; if (pvoie->temp1) { pvoie->temp2 -= entete_liste (); pvoie->temp1 = 0; } aff_status (&ligne); --pvoie->temp2; } } if (pvoie->reverse) { if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } else { if (offset == 0) { bptr = prec_dir (bptr); offset = T_BLOC_MESS; } } if (pvoie->temp2 == 0) { retour = 2; break; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } ferme_dir (); pvoie->recliste.offset = offset; pvoie->recliste.ptemp = bptr; if ((retour) && (pvoie->temp1)) texte (T_MBL + 3); return (retour); } void mess_liste (int pr) { int mode_list = 1; int verbose = 0; switch (pvoie->niv3) { case 0: pvoie->temp1 = 1; pvoie->temp2 = pvoie->lignes; ch_niv3 (1); break; case 1: break; case 2: while_space (); switch (toupper (*indd)) { case 'A': mode_list = 0; retour_mbl (); break; case 'V': verbose = 1; case 'R': mode_list = 0; incindd (); if (isdigit (*indd)) { list_read (verbose); pvoie->sr_mem = 1; if (mbl_mess_read () == 0) { pvoie->sr_mem = 0; texte (T_QST + 6); } } else { texte (T_ERR + 3); texte (T_QST + 6); } break; default: pvoie->temp2 = pvoie->lignes; ch_niv3 (1); break; } break; case 3: mode_list = 0; if (read_mess (1) == 0) ch_niv3 (4); break; case 4: mode_list = 0; pvoie->sr_mem = 1; if (mbl_mess_read () == 0) { pvoie->sr_mem = 0; texte (T_QST + 6); ch_niv3 (2); } break; default: fbb_error (ERR_NIVEAU, "MESS-LIST", pvoie->niv3); } if (mode_list) { if (pr) { pvoie->lignes = -1; switch (mess_bloc_liste ()) { case 0: break; case 1: retour_mbl (); break; case 2: texte (T_QST + 6); ch_niv3 (2); break; } } else { pvoie->lignes = -1; #if 0 switch (mess_bloc_liste ()) { case 0: break; case 1: retour_mbl (); break; case 2: ch_niv3 (1); break; } #else mess_bloc_liste (); pvoie->sr_mem = pvoie->seq = FALSE; libere_tread (voiecur); libere_tlist (voiecur); pvoie->mbl = 1; maj_niv (N_MBL, 0, 0); #endif } } } static int mess_bloc_liste (void) { int retour = 1; rd_list *ptemp; bullist ligne; mess_noeud *mptr; pvoie->sr_mem = pvoie->seq = FALSE; ouvre_dir (); while ((ptemp = pvoie->t_list) != NULL) { if (pvoie->temp1) { pvoie->temp1 = 0; entete_liste (); --pvoie->temp2; } mptr = findmess (ptemp->nmess); if (mptr) { read_dir (mptr->noenr, &ligne); aff_status (&ligne); } --pvoie->temp2; pvoie->t_list = pvoie->t_list->suite; m_libere (ptemp, sizeof (rd_list)); if (pvoie->temp2 == 0) { retour = 2; break; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } ferme_dir (); if ((retour) && (pvoie->temp1)) texte (T_MBL + 3); return (retour); } static void list_mine (char mode) { char s[2]; int nouveau = 0; unsigned num_ind; if (isdigit (mode)) { s[0] = mode; s[1] = '\0'; insnoeud (s, &num_ind); } else { if (mode == 'N') nouveau = TRUE; num_ind = pvoie->no_indic; } list_messages (nouveau, num_ind, 1); } void send_list(int voie) { unsigned offset; bloc_mess *bptr = tete_dir; mess_noeud *mptr; bullist bul; char buf[80]; sprintf(buf, "S%d", svoie[voie]->ncur->nbmess); sta_drv (voie, SNDCMD, buf); ouvre_dir (); /* Read messages */ while (bptr) { for (offset = 0 ; offset < T_BLOC_MESS ; offset++) { mptr = &(bptr->st_mess[offset]); if ((mptr->noenr) && (mptr->no_indic == svoie[voie]->no_indic)) { read_dir (mptr->noenr, &bul); if (bul.status != 'N' && bul.status != 'K' && bul.status != 'A') { sprintf(buf, "M%ld %ld %c", bul.numero, bul.taille, bul.status); sta_drv (voie, SNDCMD, buf); } } } bptr = bptr->suiv; } bptr = tete_dir; /* Unread messages */ while (bptr) { for (offset = 0 ; offset < T_BLOC_MESS ; offset++) { mptr = &(bptr->st_mess[offset]); if ((mptr->noenr) && (mptr->no_indic == svoie[voie]->no_indic)) { read_dir (mptr->noenr, &bul); if (bul.status == 'N') { sprintf(buf, "M%ld %ld %c", bul.numero, bul.taille, bul.status); sta_drv (voie, SNDCMD, buf); } } } bptr = bptr->suiv; } ferme_dir (); sta_drv (voie, SNDCMD, "M0 0 N"); } void list_messages (int nouveau, unsigned num_ind, int pr) { int trouve = 0; unsigned offset = 0; bloc_mess *bptr = tete_dir; mess_noeud *mptr; rd_list *ptemp = NULL; bullist bul; ouvre_dir (); /* pvoie->typlist = 0; */ while (bptr->suiv) bptr = bptr->suiv; while (bptr) { offset = T_BLOC_MESS; while (offset--) { mptr = &(bptr->st_mess[offset]); if ((mptr->noenr) && (mptr->no_indic == num_ind)) { read_dir (mptr->noenr, &bul); if (((!nouveau) || (nouveau && (bul.status == 'N'))) && (bul.status != 'H') && (bul.status != 'A')) { if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_list = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = mptr->nmess; ptemp->verb = 1; trouve = 1; } } } bptr = prec_dir (bptr); } ferme_dir (); if (!trouve) { if (nouveau) texte (T_MBL + 4); else texte (T_MBL + 3); retour_mbl (); } else { maj_niv (N_MBL, 16, 0); mess_liste (pr); } } static int copy_word(char *dest, char *str, int max) { int nb = 0; while (!isspace(*str) && !iscntrl(*str)) { *dest++ = *str++; ++nb; if (max && nb == max) break; } *dest = '\0'; return nb; } static int cmd_list(int cmd) { char cde; int ok = 1; long date; switch (cmd) { case 'A': pvoie->recliste.status = 'A'; break; case 'B': pvoie->recliste.type = 'B'; break; case 'D': cde = *indd++; if ((cde == '<') || (cde == '>')) { if (teste_espace ()) { if ((date = date_to_time (indd)) == 0L) { ok = 0; texte (T_ERR + 3); } else { char tmp[20]; indd += copy_word(tmp, indd, 19); switch (cde) { case '>': pvoie->recliste.avant = date /* + 86400L */ ; break; case '<': pvoie->recliste.apres = date - 86400L; break; } } } else { texte (T_ERR + 2); ok = 0; } } else { ok = 0; sprintf (varx[0], "LD%c", cmd); texte (T_ERR + 1); } break; case 'E': pvoie->recliste.route = 1; break; case 'F': pvoie->recliste.status = 'F'; break; case 'H': pvoie->temp1 = 0; list_held (); ok = 0; break; case 'K': pvoie->recliste.status = 'K'; break; case 'L': if (!ISPRINT (*indd)) { pvoie->recliste.last = 1; } else if (teste_espace ()) { if (isdigit (*indd)) pvoie->recliste.last = lit_chiffre (0); else { texte (T_ERR + 3); ok = 0; } } else { texte (T_ERR + 2); ok = 0; } break; case 'M': case 'N': list_mine (cmd); ok = 2; break; case 'P': pvoie->recliste.type = 'P'; break; case 'S': if (teste_espace ()) { int len = 0; char *ptr = indd; while (*ptr && *ptr != ' ') { ++ptr; ++len; } pvoie->recliste.find[0] = '*'; strn_cpy ((len > 17) ? 17 : len, (pvoie->recliste.find) + 1, strupr (indd)); indd += len; strcat (pvoie->recliste.find, "*"); } else { texte (T_ERR + 2); ok = 0; } break; case 'T': pvoie->recliste.type = 'T'; break; case 'U': pvoie->recliste.type = 'P'; pvoie->recliste.status = 'N'; break; case 'X': pvoie->recliste.status = 'X'; break; case 'Y': pvoie->recliste.status = 'Y'; break; case '$': pvoie->recliste.status = '$'; break; case '<': if (teste_espace ()) { indd += copy_word(pvoie->recliste.exp, indd, 6); } else { texte (T_ERR + 2); ok = 0; } break; case '>': if (teste_espace ()) { indd += copy_word(pvoie->recliste.dest, indd, 6); } else { texte (T_ERR + 2); ok = 0; } break; case '@': if (teste_espace ()) { indd += copy_word(pvoie->recliste.bbs, indd, 6); } else { strcpy (pvoie->recliste.bbs, "-"); } break; case 'R': pvoie->reverse = 1; case ' ': teste_espace (); if (*indd == '\0') { pvoie->recliste.l = TRUE; pvoie->recliste.debut = pvoie->finf.lastmes + 1; pvoie->l_mess = nomess; break; } if (strchr (indd, '-')) { if (isdigit (*indd)) pvoie->recliste.debut = lit_chiffre (1); else { texte (T_ERR + 3); ok = 0; break; } ++indd; if (isdigit (*indd)) pvoie->recliste.fin = lit_chiffre (1); if (pvoie->recliste.fin <= pvoie->recliste.debut) ok = 0; } else { if (isdigit (*indd)) pvoie->recliste.fin = pvoie->recliste.debut = lit_chiffre (1); else ok = 0; } break; default: if (isdigit (cmd)) { list_mine (cmd); ok = 0; } else { /* sprintf(varx[0], "L%c", c) ; texte(T_ERR + 1) ; */ ok = 3; } break; } return ok; } int mbl_lx (void) { char c; int ok = 1; int i; bloc_mess *temp; long numero; pvoie->reverse = 0; init_recliste (voiecur); if (!ISPRINT (*indd)) { pvoie->recliste.debut = pvoie->finf.lastmes + 1; pvoie->l_mess = nomess; } else { sup_ln (indd); fbb_log (voiecur, 'M', strupr (indd - 1)); c = *indd++; for (;;) { ok = cmd_list(c); if (ok == 0) break; while_space(); c = *indd++; if (c == '\0') break; if (c != '&') { ok = 3; break; } incindd(); c = *indd++; if (c != 'L' && c != 'l') { ok = 3; break; } c = *indd++; } } if (ok == 1) { if (pvoie->reverse) { temp = tete_dir; numero = pvoie->recliste.debut; while (temp->suiv) { if (temp->suiv->st_mess[0].nmess > numero) break; temp = temp->suiv; } for (i = 0; i < T_BLOC_MESS; i++) { if (temp->st_mess[i].nmess == 0) { --i; break; } if (temp->st_mess[i].nmess >= numero) break; } if (i == T_BLOC_MESS) --i; pvoie->recliste.ptemp = temp; pvoie->recliste.offset = i; } else { pvoie->recliste.ptemp = last_dir (); pvoie->recliste.offset = T_BLOC_MESS; } pvoie->temp1 = 1; } return (ok); } void list_read (int verbose) { long no; bullist *pbul; rd_list *ptemp = NULL; libere_tread (voiecur); while ((no = lit_chiffre (1)) != 0L) { if ((pbul = ch_record (NULL, no, 'Y')) != NULL) { if (droit_ok (pbul, 1)) { if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_read = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = no; ptemp->verb = verbose; } else texte (T_ERR + 10); } else texte (T_ERR + 10); } } int mbl_list (void) { int mode_list = 1; int verbose = 0; int error = 0; switch (pvoie->niv3) { case 0: if (toupper (*indd) == 'C') { return (list_lc ()); } switch (mbl_lx ()) { case 0: retour_mbl (); case 2: mode_list = 0; break; case 1: pvoie->temp2 = pvoie->lignes; ch_niv3 (1); break; case 3: mode_list = 0; error = 1; --indd; break; } break; case 1: break; case 2: while_space (); switch (toupper (*indd)) { case 'A': mode_list = 0; retour_mbl (); break; case 'V': verbose = 1; case 'R': mode_list = 0; incindd (); if (isdigit (*indd)) { pvoie->aut_nc = 1; list_read (verbose); pvoie->sr_mem = 1; if (mbl_mess_read () == 0) { pvoie->sr_mem = 0; texte (T_QST + 6); } } else { texte (T_ERR + 3); texte (T_QST + 6); } break; default: pvoie->temp2 = pvoie->lignes; ch_niv3 (1); break; } break; case 3: mode_list = 0; pvoie->aut_nc = 1; if (read_mess (1) == 0) ch_niv3 (4); break; case 4: mode_list = 0; pvoie->aut_nc = 1; pvoie->sr_mem = 1; if (mbl_mess_read () == 0) { pvoie->sr_mem = 0; texte (T_QST + 6); ch_niv3 (2); } break; default: fbb_error (ERR_NIVEAU, "MSG-LIST", pvoie->niv3); } if (mode_list) { pvoie->lignes = -1; switch (mbl_bloc_liste ()) { case 0: break; case 1: retour_mbl (); break; case 2: texte (T_QST + 6); ch_niv3 (2); break; } } return (error); } /* Test du password */ void mbl_passwd (void) { char buffer[80]; switch (pvoie->niv3) { case 0: snd_passwd (buffer); if (*buffer == '\0') retour_mbl (); else { outln (buffer, strlen (buffer)); ch_niv3 (1); } break; case 1: if (tst_passwd (indd)) { outln ("Ok", 2); change_droits (voiecur); sprintf (buffer, "SYS OK"); } else { *pvoie->passwd = '\0'; sprintf (buffer, "SYS FAILED"); } fbb_log (voiecur, 'M', buffer); retour_mbl (); break; } } /* Commande 'S' -> Send messages */ int mbl_send (void) { int error = 0; switch (toupper (*indd)) { case 'X': if (!read_only ()) { --indd; maj_niv (N_XFWD, 1, 0); xfwd (); } else retour_mbl (); break; case 'Y': if ((toupper (indd[1]) == 'S') && (!pvoie->read_only) && (droits (CMDSYS))) { maj_niv (N_MBL, 14, 0); mbl_passwd (); } else { error = 1; /* cmd_err(--indd) ; */ } break; case 'R': if (!read_only ()) { *indd = toupper (*indd); send_reply (); } else retour_mbl (); break; case 'C': if (!read_only ()) { fbb_log (voiecur, 'S', strupr (indd)); send_copy (); } else retour_mbl (); break; default: maj_niv (N_FORW, 0, 0); error = fwd (); break; } return (error); } /* Commande 'I' -> Info */ void mbl_info (void) { char buffer[257]; sprintf (buffer, "LANG\\%s.INF", nomlang + nlang * LG_LANG); if (!outfich (c_disque (buffer))) q_mark (); } fbb-7.0.10/src/serveur.c0000644000175000017500000002423613613360505011710 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Gestion des serveurs de donnees. SERVEUR.H */ #include static int is_redist (char *); void tst_serveur (bullist * pbul) { serlist *lptr; bullist psauve; if ((strcmp (pbul->desti, "WP") == 0) && (strcmp (pbul->exped, mycall) != 0) && (is_wpupdate (pbul->titre))) { /* WP Update ? */ wp_read_mess (pbul); /* Lit le message pour MAJ WP */ return; } if ((*pbul->bbsv) || (pbul->type != 'P')) return; psauve = *pbul; if (is_redist (pbul->desti)) { lptr = tete_serv; while (lptr) { if (strcmp (lptr->nom_serveur, "REDIST") == 0) { appel_serveur (lptr, pbul); break; } lptr = lptr->suiv; } } else { lptr = tete_serv; while (lptr) { if (strcmp (lptr->nom_serveur, pbul->desti) == 0) { appel_serveur (lptr, pbul); break; } lptr = lptr->suiv; } } *pbul = psauve; } int p_cmd (void) { serlist *lptr; char s[200]; int ok = 1; int c = toupper (*indd); switch (c) { case 'G': incindd (); maj_niv (N_MBL, 17, 0); exec_pg (); ok = 2; break; case 'R': ok = mbl_print (); break; case 'S': lptr = tete_serv; while (lptr) { sprintf (s, "%6s: %s", lptr->nom_serveur, lptr->com_serveur); outln (s, strlen (s)); lptr = lptr->suiv; } break; default: ok = 0; break; } if (ok == 1) retour_mbl (); return (ok); } void libere_serveurs (void) { serlist *lptr; while (tete_serv) { lptr = tete_serv; tete_serv = tete_serv->suiv; m_libere (lptr, sizeof (serlist)); } } void init_serveur (char *ligne, int nolig) { char nom[80], pg[80], com[80]; serlist *lptr; *com = '\0'; if (sscanf (ligne, "%s %s %[^\n\r]", nom, pg, com) < 2) err_init (nolig); strupr (nom); /* Cherche si le service existe deja */ lptr = tete_serv; while (lptr) { if (strcmp (lptr->nom_serveur, nom) == 0) return; lptr = lptr->suiv; } lptr = tete_serv; if (lptr) { while (lptr->suiv) { lptr = lptr->suiv; } lptr->suiv = (serlist *) m_alloue (sizeof (serlist)); lptr = lptr->suiv; } else { tete_serv = lptr = (serlist *) m_alloue (sizeof (serlist)); } lptr->suiv = NULL; strn_cpy (6, lptr->nom_serveur, nom); strcpy (lptr->nom_pg, pg); strcpy (lptr->com_serveur, com); } #ifdef __WINDOWS__ #pragma argsused #endif void affich_serveurs (int tp) { #ifdef __linux__ int tot = 0; char text[80]; serlist *lptr = tete_serv; while (lptr) { ++tot; sprintf (text, "%d: %s", tot, lptr->nom_serveur); InitText (text); lptr = lptr->suiv; } #endif #ifdef __WINDOWS__ int tot = 0; char text[80]; serlist *lptr = tete_serv; while (lptr) { ++tot; wsprintf (text, "%d: %s %s", tot, lptr->nom_serveur, lptr->com_serveur); InitText (text); lptr = lptr->suiv; } #endif #ifdef __FBBDOS__ fen *fen_ptr; serlist *lptr; int size, nb_serv = 0; lptr = tete_serv; while (lptr) { ++nb_serv; lptr = lptr->suiv; } if (nb_serv == 0) return; size = (nb_serv > 19) ? 19 : nb_serv; lptr = tete_serv; deb_io (); #ifdef ENGLISH fen_ptr = open_win (10, 2, 75, 4 + size, INIT, "Servers "); while (lptr) { cprintf ("Server %s: %s \r\n", lptr->nom_serveur, lptr->com_serveur); lptr = lptr->suiv; } attend_caractere (tp); close_win (fen_ptr); #else fen_ptr = open_win (10, 2, 75, 4 + size, INIT, "Services"); while (lptr) { cprintf ("Service %s: %s\r\n", lptr->nom_serveur, lptr->com_serveur); lptr = lptr->suiv; } attend_caractere (tp); close_win (fen_ptr); #endif fin_io (); #endif /* __WINDOWS__ */ } static int is_redist (char *server_name) { if ( (strcmp (server_name, "REDIST") == 0) || (strcmp (server_name, "LOCBBS") == 0) || (strcmp (server_name, "LOCAL") == 0) || (strcmp (server_name, "REGION") == 0) || (strcmp (server_name, "NATION") == 0) ) { return (1); } return (0); } int appel_serveur (serlist * lptr, bullist * pbul) { static int num_file = 1; ind_noeud *noeud; mess_noeud *mptr; FILE *fptr; FILE *fptm; char nom_fichier[80]; char texte[80]; #ifdef __FBBDOS__ int disk; int duplic; char cur_dir[MAXPATH]; char localdir[61]; #endif #ifdef __WINDOWS__ char localdir[61]; #endif int retour = 0; int supprime = 1; /* Affiche le nom du service dans le bandeau */ sprintf (texte, "%-7s", lptr->nom_serveur); aff_chaine (W_STAT, 2, 4, texte); /* Cree le fichier copie */ #ifdef __linux__ sprintf (nom_fichier, "%sl_serv%02d.in", DATADIR, num_file); if ((fptr = fopen (nom_fichier, "w")) != NULL) #endif #ifdef __WINDOWS__ sprintf (nom_fichier, "%s\\w_serv%02d.IN", getcwd (localdir, 60), num_file); if ((fptr = fopen (nom_fichier, "wt")) != NULL) #endif #ifdef __FBBDOS__ sprintf (nom_fichier, "%s\\d_serv%02d.IN", getcwd (localdir, 60), num_file); if ((fptr = fopen (nom_fichier, "wt")) != NULL) #endif { fprintf (fptr, "SP %s < %s\n", pbul->desti, pbul->exped); fprintf (fptr, "%s\n", pbul->titre); fflush (fptr); /* Fait une copie du message original */ if ((fptm = ouvre_mess (O_TEXT, pbul->numero, pbul->status)) != NULL) { fflush (fptr); fflush (fptm); copy_fic (fileno (fptm), fileno (fptr), NULL); fprintf (fptr, "\n/EX\n"); ferme (fptm, 75); ferme (fptr, 76); /* Teste les services "speciaux" */ if ((*lptr->nom_pg == '*') && strcmp ("REQCFG", lptr->nom_serveur) == 0) { retour = req_cfg (nom_fichier); } else if ((*lptr->nom_pg == '*') && strcmp ("REDIST", lptr->nom_serveur) == 0) { retour = redist (nom_fichier); } else if ((*lptr->nom_pg == '*') && strcmp ("WP", lptr->nom_serveur) == 0) { if (strcmp (pbul->exped, mycall) == 0) { /* Exped = moi ? */ if (*pbul->bbsv) supprime = 0; /* Ne supprime pas le message */ else retour = wp_service (nom_fichier); } else if (*pbul->bbsv == '\0') retour = wp_service (nom_fichier); /* Exped = autre */ else supprime = 0; } else { #ifdef __linux__ char commande[256]; FILE *fp; sprintf (commande, "cd %s ; ./%s %s", SERVDIR, lptr->nom_pg, back2slash(nom_fichier)); fp = popen (commande, "r"); if (fp == NULL) printf ("Failed to run command\n" ); else retour = pclose(fp); retour = retour >> 8; if (++num_file == 10) num_file = 1; #endif #ifdef __WINDOWS__ char commande[256]; char *extension; extension = strrchr (lptr->nom_pg, '.'); if (extension && (strcmp (extension, ".DLL") == 0)) { /* DLL appel immediat... */ HINSTANCE hinstFilter; retour = -1; hinstFilter = LoadLibrary (lptr->nom_pg); if (hinstFilter > HINSTANCE_ERROR) { int (FAR PASCAL * DllProc) (int ac, char FAR ** av); int ac = 0; char *av[30]; ac = 0; av[ac++] = lptr->nom_pg; av[ac++] = nom_fichier; av[ac] = NULL; (FARPROC) DllProc = GetProcAddress (hinstFilter, "svc_main"); if (DllProc) retour = (*DllProc) (ac, (char FAR **) av); FreeLibrary (hinstFilter); } } else { sprintf (commande, "%s %s", lptr->nom_pg, nom_fichier); /* Appel serveurs via Windows */ retour = (fbb_exec (commande) == 1) ? 0 : -1; } if (++num_file == 10) num_file = 1; #endif #ifdef __FBBDOS__ deb_io (); /* Stoppe le multitaches */ disk = getdisk (); strcpy (cur_dir, "X:\\"); cur_dir[0] = 'A' + disk; getcurdir (0, cur_dir + 3); operationnel = FALSE; /* Stoppe les stats de taches */ duplic = dup (1); /* Ferme le stdout */ close (1); break_ok (); /* Valide le Ctrl C */ retour = spawnlp (P_WAIT, lptr->nom_pg, lptr->nom_serveur, nom_fichier, NULL); break_stop (); /* Devalide le Ctrl C */ dup2 (duplic, 1); /* Remet le stdout */ close (duplic); operationnel = TRUE; setdisk (disk); chdir (cur_dir); fin_io (); unlink (nom_fichier); #endif /* __WINDOWS__ */ } if ((retour != 0) && (retour != 10)) { /* Erreur de lancement : Envoi d'un message SYSOP */ #ifdef ENGLISH cprintf ("Error starting server %s (%s)\r\n", lptr->nom_serveur, lptr->nom_pg); sprintf (texte, "Error starting server %s (%s)\n", lptr->nom_serveur, lptr->nom_pg); if (w_mask & W_SERVER) mess_warning (admin, "*** SERVER ERROR *** ", texte); #else cprintf ("Erreur appel serveur %s (%s) \r\n", lptr->nom_serveur, lptr->nom_pg); sprintf (texte, "Erreur appel serveur %s (%s) \n", lptr->nom_serveur, lptr->nom_pg); if (w_mask & W_SERVER) mess_warning (admin, "*** ERREUR SERVEUR ***", texte); #endif } if (retour == 10) supprime = 0; } else ferme (fptr, 77); timeprec = 0L; } if (supprime) { if ((mptr = findmess (pbul->numero)) != NULL) { /* Tue le message */ ouvre_dir (); pbul->status = 'K'; write_dir (mptr->noenr, pbul); ferme_dir (); noeud = cher_noeud (pbul->desti); --(noeud->nbnew); --(noeud->nbmess); chg_mess (0xffff, pbul->numero); /* Plus de destinataire */ } } return (supprime); } int ptctrx (int port, char *cmde) { int pp; int ok = 0; char cmdbuf[80]; for (pp = 1; pp < NBPORT; pp++) { if ((HST (pp)) && (p_port[pp].moport & 0x80)) { sprintf (cmdbuf, "!%s", cmde + 3); tnc_commande (pp, cmdbuf, PORTCMD); ok = 1; break; } } /* Les autres ports attendent deux secondes pour etre sur que la commande a ete envoyee */ if ((ok) && (pp != port)) { p_port[port].stop = 2; } return (ok); } fbb-7.0.10/src/fwdovl1.c0000644000175000017500000004356213613360505011602 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 1 */ #include #define MAXNOT 10 static char *BID_STRING = "%ld_%s"; static char *ALT_STRING = "%ld-%s"; typedef struct pnot { int type[MAXNOT]; char texte[MAXNOT][41]; struct pnot *suite; } snot; static int is_not (snot *, int, char *); static int test_forward_nts (int); static void libere_not (snot *); static int nb_bbs; long next_num (void) { char type; unsigned record; unsigned num_indic; if (ptmes->numero == 0L) { ptmes->numero = ++nomess; if ((ptmes->numero % 0x10000L) == 0) ptmes->numero = ++nomess; pvoie->mess_recu = 0; insnoeud (ptmes->desti, &num_indic); type = ptmes->type; ptmes->type = '\0'; ouvre_dir (); write_dir (0, ptmes); record = length_dir (); write_dir (record, ptmes); ferme_dir (); ptmes->type = type; insmess (record, num_indic, ptmes->numero); } return (ptmes->numero); } static int host_bbs (bullist * pbull) { int retour = 0; ind_noeud *pnoeud; unsigned no_indic; FILE *fptr; info frec; if ((is_serv (pbull->desti)) || (strcmp (pbull->desti, "SYSOP") == 0) || (!find (pbull->desti))) return (2); var_cpy (0, "\0"); if ((retour = route_wp_home (pbull)) != 0) { route_wp_hier (pbull); var_cpy (0, "WP"); } else { pnoeud = insnoeud (pbull->desti, &no_indic); if (pnoeud->coord != 0xffff) { fptr = ouvre_nomenc (); fseek (fptr, (long) pnoeud->coord * sizeof (frec), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 39); if (*frec.home) { strcpy (pbull->bbsv, frec.home); retour = 1; var_cpy (0, "H"); } } } return (retour); } int chercher_voie (nom) char *nom; { int i; /* en sortie : -1 si nom n'est pas connecte, numero de voie si connecte */ for (i = 1; i < NBVOIES - 1; i++) if ((svoie[i]->sta.connect) && (indcmp (svoie[i]->sta.indicatif.call, nom))) return (i); return (-1); } void make_bid (void) { char ligne[80]; long num; char *bid_str = BID_STRING; if (std_header & 1024) bid_str = ALT_STRING; if (!isalnum (*ptmes->bid)) { if ((*pvoie->mess_bid) && ((std_header & 64) == 0)) strn_cpy (12, ligne, pvoie->mess_bid); else if (pvoie->mess_num > 0L) { num = (pvoie->mess_num % 0x10000L); sprintf (ligne, bid_str, num, bbs_via (pvoie->mess_home)); } else { num = (ptmes->numero % 0x10000L); sprintf (ligne, bid_str, num, mycall); } strn_cpy (12, ptmes->bid, ligne); } } int fwd_get (char *buffer) { if (EMS_FWD_OK ()) { return (read_exms_string (FORWARD, buffer)); } if (*fwd_scan == '\032') return (0); while ((*buffer++ = *fwd_scan++) != '\0'); return (1); } #define BBS_LEN 6 static void in_bbs (char *bbs) { int i; char *ptr = data; for (i = 0; i < nb_bbs; i++) { if (strcmp (bbs, ptr) == 0) return; ptr += (BBS_LEN + 1); } strn_cpy (BBS_LEN, ptr, bbs); ++nb_bbs; } static void out_bbs (void) { int i; char *ptr = data; if (nb_bbs == 0) out (" ?????? ", 8); else { qsort ((void *) data, nb_bbs, BBS_LEN + 1, (int (*)(const void *, const void *)) strcmp); for (i = 0; i < nb_bbs; i++) { out (" ", 1); out (ptr, strlen (ptr)); ptr += (BBS_LEN + 1); } out (" ", 2); } } int already_forw (char *masque, int nobbs) { return (masque[(nobbs - 1) / 8] & (1 << ((nobbs - 1) % 8))); } void set_bit_fwd (char *masque, int nobbs) { if (nobbs) masque[(nobbs - 1) / 8] |= (1 << ((nobbs - 1) % 8)); } void clr_bit_fwd (char *masque, int nobbs) { if (nobbs) masque[(nobbs - 1) / 8] &= (~(1 << ((nobbs - 1) % 8))); } static int is_not (snot * t_not, int type, char *texte) { int nb; char *ptr; while (t_not) { for (nb = 0; nb < MAXNOT; nb++) { ptr = t_not->texte[nb]; if (*ptr == '\0') break; if ((t_not->type[nb] == type) && (strmatch (texte, ptr))) { return (1); } } t_not = t_not->suite; } return (0); } static void libere_not (snot * t_not) { snot *p_not; /* Libere la listes NOT */ while (t_not) { p_not = t_not->suite; m_libere (t_not, sizeof (snot)); t_not = p_not; } } void libere_route (int voie) { Svoie *vptr = svoie[voie]; Route *r_ptr; while ((r_ptr = vptr->r_tete) != NULL) { vptr->r_tete = r_ptr->suite; m_libere (r_ptr, sizeof (Route)); } } int test_forward (int valid) { char *pcom; char ligne[80], combuf[80]; int nobbs = 0, type, nb, i, lig = 0; long num; int route = 0, fwd_ok = 0; int not_b = 0, not_g = 0, not_h = 0; int ping_pong = 0; int route_bbs = 0; char *bbs_v; snot *t_not, *p_not; char *bid_str = BID_STRING; if (ptmes->type == 'T') return (test_forward_nts (valid)); if (std_header & 1024) bid_str = ALT_STRING; t_not = p_not = NULL; nb = MAXNOT; bbs_v = bbs_via (ptmes->bbsv); nb_bbs = 0; rewind_fwd (); if ((ptmes->type != 'B') && (strcmp (ptmes->desti, "SYSOP") != 0)) pvoie->messdate = 0L; /* TEST SUR LES BULLETINS */ if ((pvoie->messdate == 0L) || ((pvoie->messdate) && ((time (NULL) - pvoie->messdate) < (86400L * nb_jour_val)))) { while (fwd_get (combuf)) { pcom = combuf; ++lig; switch (type = *pcom++) { case '!': /* Not ! */ if (!route) break; switch (type = *pcom++) { case 'B': case 'F': case 'G': case 'H': if (nb == MAXNOT) { if (p_not) { p_not->suite = (snot *) m_alloue (sizeof (snot)); p_not = p_not->suite; } else { t_not = p_not = (snot *) m_alloue (sizeof (snot)); } for (i = 0; i < MAXNOT; i++) *(p_not->texte[i]) = '\0'; p_not->suite = NULL; nb = 0; } p_not->type[nb] = type; strn_cpy (40, p_not->texte[nb], pcom); ++nb; break; } break; case 'A': /* recuperer le No et le nom de la BBS destinataire */ route = 0; route_bbs = 0; nobbs = num_bbs (pcom); if (is_route (pcom)) { set_bit_fwd (ptmes->forw, nobbs); break; } strcpy (ligne, pcom); if (already_forw (ptmes->forw, nobbs)) break; route = 1; libere_not (t_not); t_not = p_not = NULL; nb = MAXNOT; not_b = not_g = not_h = 0; break; case 'G': /* indication de groupe */ if (!route) break; route_bbs = 0; if ((*bbs_v) && (ptmes->status == '$')) { if ((not_g) || (is_not (t_not, type, bbs_v))) { not_g = 1; } else if (strmatch (bbs_v, pcom)) { if (indcmp (pvoie->sta.indicatif.call, ligne) == 0) { if (!(FOR (pvoie->mode))) { in_bbs (ligne); } set_bit_fwd (ptmes->fbbs, nobbs); fwd_ok = 1; } else { set_bit_fwd (ptmes->forw, nobbs); } } } break; case 'H': /* indication de Hierarchie */ if (!route) break; route_bbs = 0; if ((*ptmes->bbsv) && (ptmes->status != '$')) { if ((not_h) || (is_not (t_not, type, ptmes->bbsv))) { not_h = 1; } else if (strmatch (ptmes->bbsv, pcom)) { if (((pvoie->mode & F_FOR) == 0) || (indcmp (pvoie->sta.indicatif.call, ligne) == 0)) { set_bit_fwd (ptmes->fbbs, nobbs); fwd_ok = 1; if (!(FOR (pvoie->mode))) { in_bbs (ligne); } } else { /* Ping Pong ! */ /* dde_warning(W_PPG); */ ping_pong = 1; } } } break; case 'B': /* indication de BBS */ if (!route) break; route_bbs = 1; if ((*bbs_v) && (ptmes->status != '$')) { if ((not_b) || (is_not (t_not, type, bbs_v))) { not_b = 1; } else if (strmatch (bbs_v, pcom)) { if (((pvoie->mode & F_FOR) == 0) || (indcmp (pvoie->sta.indicatif.call, ligne) == 0)) { set_bit_fwd (ptmes->fbbs, nobbs); fwd_ok = 1; if (!(FOR (pvoie->mode))) { in_bbs (ligne); } } else { /* Ping Pong ! */ /* dde_warning(W_PPG); */ ping_pong = 1; } } } break; case 'F': /* indication de routage */ if (!route) break; if (is_not (t_not, type, pcom)) break; if ((*bbs_v == '\0') && (find (ptmes->desti))) { /* Redirection d'un destinataire prive */ if ((!not_b) && (strmatch (ptmes->desti, pcom))) { if (((pvoie->mode & F_FOR) == 0) || (indcmp (pvoie->sta.indicatif.call, ligne) == 0)) { set_bit_fwd (ptmes->fbbs, nobbs); fwd_ok = 1; if (!(FOR (pvoie->mode))) { in_bbs (ligne); } } else { /* Ping Pong ! */ /* dde_warning(W_PPG); */ ping_pong = 1; } } } else if (route_bbs == 0) { /* Routage sur le destinataire */ if ((!not_b) && (strmatch (ptmes->desti, pcom))) { if (indcmp (pvoie->sta.indicatif.call, ligne) == 0) { set_bit_fwd (ptmes->fbbs, nobbs); fwd_ok = 1; if (!(FOR (pvoie->mode))) { in_bbs (ligne); } } } } break; default: break; } } } else { ptmes->status = 'X'; } if (*(ptmes->bid) == '\0') strcpy (ptmes->bid, " "); if (!FOR (pvoie->mode)) { if (fwd_ok) { texte (T_MBL + 40); out_bbs (); } } if ((valid) && (*ptmes->bid)) { if (*ptmes->bid == ' ') { if ((*pvoie->mess_bid) && ((std_header & 64) == 0)) strn_cpy (12, ptmes->bid, pvoie->mess_bid); else if (pvoie->mess_num > 0L) { num = (pvoie->mess_num % 0x10000L); sprintf (ligne, bid_str, num, bbs_via (pvoie->mess_home)); } else { num = (ptmes->numero % 0x10000L); sprintf (ligne, bid_str, num, mycall); } strn_cpy (12, ptmes->bid, ligne); } if (!FOR (pvoie->mode)) { if (ptmes->type == 'P') out ("Mid: $R ", 9); else out ("Bid: $R ", 9); } if (valid == 1) w_bid (); } if ((ping_pong) && (!fwd_ok)) dde_warning (W_PPG); libere_not (t_not); libere_route (voiecur); return (fwd_ok); } static int test_forward_nts (int valid) { char *pcom; char desti[80], ligne[80], combuf[80]; /* char wtexte[256] ; */ int nobbs = 0, type, nb, i, lig = 0; long num; int route = 0, fwd_ok = 0; int not_z = 0; int ping_pong = 0; snot *t_not, *p_not; char *bid_str = BID_STRING; if (std_header & 1024) bid_str = ALT_STRING; t_not = p_not = NULL; nb = MAXNOT; strcpy (desti, ptmes->desti); rewind_fwd (); if ((pvoie->messdate == 0L) || ((pvoie->messdate) && ((time (NULL) - pvoie->messdate) < (86400L * nb_jour_val)))) { while (fwd_get (combuf)) { pcom = combuf; ++lig; switch (type = *pcom++) { case '!': /* Not ! */ if (!route) break; switch (type = *pcom++) { case 'Z': if (nb == MAXNOT) { if (p_not) { p_not->suite = (snot *) m_alloue (sizeof (snot)); p_not = p_not->suite; } else { t_not = p_not = (snot *) m_alloue (sizeof (snot)); } for (i = 0; i < MAXNOT; i++) *(p_not->texte[i]) = '\0'; p_not->suite = NULL; nb = 0; } p_not->type[nb] = type; strn_cpy (40, p_not->texte[nb], pcom); ++nb; break; } break; case 'A': /* recuperer le No et le nom de la BBS destinataire */ route = 0; nobbs = num_bbs (pcom); if (is_route (pcom)) { set_bit_fwd (ptmes->forw, nobbs); break; } strcpy (ligne, pcom); if (already_forw (ptmes->forw, nobbs)) break; route = 1; libere_not (t_not); t_not = p_not = NULL; nb = MAXNOT; not_z = 0; break; case 'Z': /* indication de route */ if (!route) break; if ((not_z) || (is_not (t_not, type, desti))) { not_z = 1; } else if (strmatch (desti, pcom)) { if (((pvoie->mode & F_FOR) == 0) || (indcmp (pvoie->sta.indicatif.call, ligne) == 0)) { set_bit_fwd (ptmes->fbbs, nobbs); fwd_ok = 1; if (!(FOR (pvoie->mode))) { in_bbs (ligne); } } else { /* Ping Pong ! */ ping_pong = 1; } } break; default: break; } } } else { ptmes->status = 'X'; } if (!FOR (pvoie->mode)) { if (fwd_ok) { texte (T_MBL + 40); out_bbs (); } } if (*(ptmes->bid) == '\0') strcpy (ptmes->bid, " "); if ((valid) && (!FOR (pvoie->mode))) out (" ", 2); if ((valid) && (*ptmes->bid)) { if (*ptmes->bid == ' ') { if ((*pvoie->mess_bid) && ((std_header & 64) == 0)) strn_cpy (12, ptmes->bid, pvoie->mess_bid); else if (pvoie->mess_num > 0L) { num = (pvoie->mess_num % 0x10000L); sprintf (ligne, bid_str, num, bbs_via (pvoie->mess_home)); } else { num = (ptmes->numero % 0x10000L); sprintf (ligne, bid_str, num, mycall); } strn_cpy (12, ptmes->bid, ligne); } if (!FOR (pvoie->mode)) { if (ptmes->type == 'P') out ("Mid: $R ", 9); else out ("Bid: $R ", 9); } if (valid != 2) w_bid (); } if ((ping_pong) && (!fwd_ok)) dde_warning (W_PPG); libere_not (t_not); libere_route (voiecur); return (fwd_ok); } int reacheminement (void) { /* static int boucle = 0;*/ int achemine_trouve; int nts_trouve; int route_bbs; int type = 0; int nb; int i; char *pcom; char combuf[80]; char ligne[257]; char desti[10]; char *bbs_v; int not_b = 0, not_g = 0, not_h = 0, not_z = 0; snot *t_not, *p_not; df ("reacheminement", 0); pvoie->warning = 0; route_bbs = 0; t_not = p_not = NULL; nb = MAXNOT; strcpy (desti, ptmes->desti); bbs_v = bbs_via (ptmes->bbsv); if (hiecmp (mypath, ptmes->bbsv)) { *ptmes->bbsv = '\0'; ff (); return (1); } /* S'il y a une route est specifiee, l'acheminement existe-t-il ? */ achemine_trouve = (*ptmes->bbsv == '\0'); nts_trouve = (ptmes->type != 'T'); if (!nts_trouve) { /* L'acheminement est trouve, routage sur le desti ... */ achemine_trouve = TRUE; } else if (achemine_trouve) { switch (host_bbs (ptmes)) { case 2: break; case 1: if ((!FOR (pvoie->mode)) && (ptmes->type != 'B') && (*ptmes->bbsv)) texte (T_MBL + 41); /* l'acheminement existe-t-il pour le home BBS ? */ achemine_trouve = 0; break; case 0: if ((!FOR (pvoie->mode)) && (EMS_WPG_OK ()) && (find (ptmes->desti)) && (*ptmes->bbsv == '\0')) texte (T_MBL + 56); } } if (hiecmp (mypath, ptmes->bbsv)) { *ptmes->bbsv = '\0'; ff (); return (1); } if (cherche_route (ptmes)) { if (!FOR (pvoie->mode)) { texte (T_MBL + 41); } } bbs_v = bbs_via (ptmes->bbsv); rewind_fwd (); while (fwd_get (combuf)) { pcom = combuf; switch (*pcom++) { case '!': /* Not ! */ switch (type = *pcom++) { case 'B': case 'G': case 'H': case 'Z': case 'F': if (nb == MAXNOT) { if (p_not) { p_not->suite = (snot *) m_alloue (sizeof (snot)); p_not = p_not->suite; } else { t_not = p_not = (snot *) m_alloue (sizeof (snot)); } for (i = 0; i < MAXNOT; i++) *(p_not->texte[i]) = '\0'; p_not->suite = NULL; nb = 0; } p_not->type[nb] = type; strn_cpy (40, p_not->texte[nb], pcom); ++nb; break; } break; case 'A': route_bbs = 0; libere_not (t_not); t_not = p_not = NULL; nb = MAXNOT; not_b = not_g = not_h = not_z = 0; case 'B': /* recuperer le nom de la BBS destinataire */ route_bbs = 1; strcpy (ligne, pcom); if ((not_b) || (is_not (t_not, type, bbs_v))) { not_b = 1; break; } if ((ptmes->status != '$') && (!achemine_trouve) && (strmatch (bbs_v, pcom))) { achemine_trouve = TRUE; } break; case 'H': /* test des hierarchies */ route_bbs = 0; if ((not_h) || (is_not (t_not, type, bbs_v))) { not_h = 1; break; } if ((ptmes->status != '$') && (!achemine_trouve) && (strmatch (ptmes->bbsv, pcom))) { achemine_trouve = TRUE; } break; case 'G': /* test du groupe */ route_bbs = 0; if ((not_g) || (is_not (t_not, type, bbs_v))) { not_g = 1; break; } if ((ptmes->status == '$') && (!achemine_trouve) && (strmatch (bbs_v, pcom))) { achemine_trouve = TRUE; } break; case 'Z': /* Route NTS */ route_bbs = 1; if ((not_z) || (is_not (t_not, type, desti))) { not_z = 1; break; } if ((ptmes->type == 'T') && (!nts_trouve) && (strmatch (desti, pcom))) nts_trouve = TRUE; break; case 'F': /* chercher les messages de l'OM associe a la BBS */ if (is_not (t_not, type, pcom)) break; if ((*(ptmes->bbsv) == '\0') && (strmatch (ptmes->desti, pcom))) { /* (indcmp(ptmes->desti, pcom))) { */ if ((route_bbs) && (find (ptmes->desti))) { strcpy (ptmes->bbsv, ligne); } achemine_trouve = TRUE; if (cherche_route (ptmes)) { if ((!FOR (pvoie->mode)) && (ptmes->type != 'B')) { texte (T_MBL + 41); } } } break; default: break; } } libere_not (t_not); if (!achemine_trouve) { dde_warning (W_ROU); if (!FOR (pvoie->mode)) texte (T_MBL + 49); } if (!nts_trouve) { dde_warning (W_NTS); if (!FOR (pvoie->mode)) { strcpy (ligne, ptmes->bbsv); strcpy (ptmes->bbsv, desti); texte (T_MBL + 49); strcpy (ptmes->bbsv, ligne); } } ff (); /* boucle = 0;*/ return (1); } fbb-7.0.10/src/drv_kam.c0000644000175000017500000003621313613360505011636 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include typedef struct { char port; char stream; } KamTries; typedef struct { char canal; char *cmd; } KamCmd; KamTries kam_try[NBPORT]; KamCmd kam_cmd[NBPORT]; static int lit_stat_kam (int port, int canal, stat_ch * ptr); static int kam_send (int port, int canal, int type, char *chaine, int len); static int kam_tor (int port, char *chaine, int len); static int kam_send_dt (int port, int canal, char *buffer, int len); static int kam_send_ui (int port, char *buffer, int len, Beacon * beacon); static int kam_inbuf (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui); /* * Fonctions g‚n‚riques du driver */ int sta_kam (int port, int canal, int cmd, void *ptr) { char command[256]; char *cptr = (char *) ptr; if ((kam_cmd[port].cmd) && (p_port[port].stop == 0)) { int len = strlen (kam_cmd[port].cmd); kam_send (port, kam_cmd[port].canal, 1, kam_cmd[port].cmd, len); m_libere (kam_cmd[port].cmd, len + 1); kam_cmd[port].cmd = NULL; } switch (cmd) { case TNCSTAT: return (lit_stat_kam (port, canal, (stat_ch *) ptr)); case SNDCMD: /* Teste la commande de connexion delayee */ if ((*cptr == 'C') && (*(cptr + 1) == ' ') && (p_port[port].stop)) { kam_cmd[port].cmd = m_alloue (strlen (cptr) + 1); strcpy (kam_cmd[port].cmd, cptr); kam_cmd[port].canal = canal; return (1); } return (kam_send (port, canal, 1, cptr, strlen (ptr))); case ECHOCMD: return (1); case PORTCMD: strcpy (command, (char *) ptr); return (kam_send (port, 0, 1, command, strlen (command))); } return (0); } int snd_kam (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ret = 0; switch (cmd) { case COMMAND: ret = kam_send (port, 0, 1, buffer, len); break; case TOR: ret = kam_tor (port, buffer, len); break; case DATA: ret = kam_send_dt (port, canal, buffer, len); break; case UNPROTO: ret = kam_send_ui (port, buffer, len, ptr); break; } return (ret); } int rcv_kam (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ptr) { int val; val = kam_inbuf (port, canal, cmd, buffer, len, ptr); return (val); } /*************** Driver KAM ************/ static int kam_tor (int port, char *chaine, int len) { int c; df ("kam_tor", 6); while (car_tx (port)) ; /* attend que le buffer d'emission soit vide */ send_tnc (port, 0xc0); while (len--) { c = *chaine++; if (c == 0xc0) { send_tnc (port, 0xdb); c = 0xdc; } else if (c == 0xdb) { send_tnc (port, 0xdb); c = 0xdd; } send_tnc (port, c); } send_tnc (port, 0xc0); ff (); return (1); } static int kam_read (int port, char *buffer) { int c, nb; char *ptr = buffer; df ("kam_read", 3); nb = 0; if (!car_tnc (port)) { ff (); return (0); } if (rec_tnc (port) != 0xc0) { ++com_error; ff (); return (0); } for (;;) { c = rec_tnc (port); if (c == -1) { continue; } if (c == 0xdb) { while ((c = rec_tnc (port)) == -1); switch (c) { case 0xdc: *ptr++ = 0xc0; break; case 0xdd: *ptr++ = 0xdb; break; } ++nb; } else if (c == 0xc0) { if (nb) break; else nb = -1; } else if (nb < 300) { *ptr++ = c; ++nb; } } ff (); return (nb); } static int kam_send (int port, int canal, int type, char *chaine, int len) { int c; int c_port = 0; int c_voie = 0; int c_mode = 0; int tor = 0; df ("kam_send", 4); while (car_tx (port)) ; /* attend que le buffer d'emission soit vide */ /* Envoi dans stream 0 en TOR */ if ((tor) && (type == 2)) type = 0; switch (type) { case 0: /* Unproto */ c_mode = 'D'; c_port = p_port[port].ccanal + '0'; c_voie = '0'; break; case 1: /* Commande */ c_mode = 'C'; c_port = p_port[port].ccanal + '0'; if (canal == 0) c_voie = '0'; else c_voie = 'A' + canal - 1; break; case 2: /* Data */ c_mode = 'D'; c_port = p_port[port].ccanal + '0'; c_voie = 'A' + canal - 1; break; } send_tnc (port, 0xc0); send_tnc (port, c_mode); send_tnc (port, c_port); send_tnc (port, c_voie); while (len--) { c = *chaine++; if (c == 0xc0) { send_tnc (port, 0xdb); c = 0xdc; } else if (c == 0xdb) { send_tnc (port, 0xdb); c = 0xdd; } send_tnc (port, c); } send_tnc (port, 0xc0); ff (); return (1); } static int kam_send_dt (int port, int canal, char *buffer, int len) { int retour = 1; if (len <= 0) return (0); df ("kam_send_dt", 5); retour = kam_send (port, canal, 2, buffer, len); ff (); return (retour); } static int kam_send_ui (int port, char *buffer, int len, Beacon * beacon) { char commande[300]; char s[80]; int i; int via = 1; df ("kam_send_ui", 5); sprintf (commande, "U %s-%d", mot (beacon->desti.call), beacon->desti.num); for (i = 0; i < 8; i++) { if (*beacon->digi[i].call) { if (via) { strcat (commande, " VIA "); via = 0; } else { strcat (commande, ","); } sprintf (s, "%s-%d", mot (beacon->digi[i].call), beacon->digi[i].num); strcat (commande, s); } } kam_send (port, 0, 1, commande, strlen (commande)); kam_send (port, 0, 0, buffer, len); ff (); return (1); } static void lit_kam_tries (int port, int canal, char *ptr, stat_ch * sta) { int ret; df ("lit_kam_tries", 2); sscanf (ptr, "%*s %d", &ret); sta->ret = ret; sta->stat = -1; sta->connect = -1; sta->ack = -1; sta->mem = -1; ff (); return; } static void lit_kam_status (int port, char *ptr, stat_ch * sta) { #define NB_KAM_STAT 13 static struct { int lg; char *txt; } kam_stat[NB_KAM_STAT] = { { 9, "DISCONNEC" } , { 9, "CONNECT i" } , { 9, "FRMR in p" } , { 9, "DISC in p" } , { 9, "CONNECTED" } , { 1, "x" } , { 9, "Waiting a" } , { 9, "Device bu" } , { 9, "Remote de" } , { 9, "Both devi" } , { 17, "Waiting ACK and d" } , { 17, "Waiting ACK and r" } , { 17, "Waiting ACK and b" } , }; int i; int mod; int voie; int stat = 0; int ack = 0; int kam_port = 0; int stream = 0; int st_kam[MAXVOIES]; char *scan; df ("lit_kam_status", 3); sta->ret = -1; sta->stat = -1; sta->connect = -1; sta->ack = -1; sta->mem = -1; for (i = 0; i < MAXVOIES; i++) { if ((i < NBVOIES) && (svoie[i]->affport.port == port)) st_kam[i] = 0; else st_kam[i] = -1; } scan = strtok (ptr, "\r"); if (scan == NULL) { ff (); return; } sscanf (scan, "%*s %*s %d", &p_port[port].mem); while ((scan = strtok (NULL, "\r")) != NULL) { if (scan[1] != '/') continue; stream = scan[0] - '@'; kam_port = (scan[2] == 'V') ? 1 : 2; if (kam_port == 0) continue; mod = 0; if (p_port[port].ccanal != kam_port) { /* Recherche l'autre port du TNC */ for (i = 1; i < NBPORT; i++) { if (i == port) continue; if (p_port[i].ccom == p_port[port].ccom) { port = i; break; } } } voie = no_voie (port, stream); if (voie == -1) continue; scan += 4; if (*scan == '#') { while ((*scan) && (*scan != '(')) ++scan; ++scan; ack = 0; while (isdigit (*scan)) { ack *= 10; ack += (*scan - '0'); ++scan; } scan += 2; } else { ack = 0; } stat = 20; for (i = 0; i < NB_KAM_STAT; i++) { if (strncmp (kam_stat[i].txt, scan, kam_stat[i].lg) == 0) { stat = i; st_kam[voie] = i; } } if ((P_TOR (voie)) && (p_port[no_port (voie)].transmit)) stat = 18; if (stat == 0) { ack = 0; sta->ret = 0; } if (sta->ack != ack) { sta->ack = ack; mod = 1; } if (sta->stat != stat) { sta->stat = stat; mod = 1; } if (mod) status (voie); } for (voie = 0; voie < MAXVOIES; voie++) { if (st_kam[voie] == 0) { mod = 0; if (sta->ack != 0) { sta->ack = 0; mod = 1; } if (sta->ret != 0) { sta->ret = 0; mod = 1; } if (sta->stat != 0) { sta->stat = 0; mod = 1; } if (mod) status (voie); } } ff (); return; } static int lit_stat_kam (int port, int canal, stat_ch * ptr) { static long last_call = 0L; long temps; if (ptr) { temps = time (NULL); if (temps == last_call) return (0); last_call = temps; } df ("lit_stat_kam", 1); if (kam_try[(int)p_port[port].ccom].port == 0) { kam_try[(int)p_port[port].ccom].port = (char) port; kam_try[(int)p_port[port].ccom].stream = (char) canal; kam_send (port, 0, 1, "STATUS", 6); kam_send (port, canal, 1, "TRIES", 5); } ff (); return (0); } static void kam_get_ui (int port, char *buffer, ui_header * ui) { char *ptr; char *sptr; memset (ui, 0, sizeof (ui_header)); ui->port = port; ptr = strtok (buffer, ">"); /* exped */ if (ptr == NULL) return; n_cpy (11, ui->from, ptr); ptr = strtok (NULL, ":,"); /* desti */ if (ptr == NULL) return; n_cpy (11, ui->to, ptr); ptr = strtok (NULL, ":,"); /* digis */ if (ptr == NULL) return; if (*ptr != ' ') { for (;;) { strncat (ui->via, ptr, 12); strcat (ui->via, " "); ptr = strtok (NULL, ":,"); /* digis */ if (ptr == NULL) return; if ((*ptr == '\0') || (*ptr == ' ')) break; } } ++ptr; sptr = ptr; while ((*sptr) && (*sptr != '>')) ++sptr; *sptr = '\0'; /* controle */ *ui->ctl = '\0'; if (ptr[0] == '<') { int pos = 0; int version = 1; int reponse = 0; ++ptr; if (ptr[0] == '<') { version = 2; /* AX25 Version 2 */ ++ptr; } sptr = ptr; if (*sptr == 'F') { pos = 4; } else if (*sptr == 'U') { pos = 2; if (sptr[1] == 'A') reponse = 1; } else if (*sptr == 'C') { strcpy (ptr, "SABM"); pos = 4; } else if (*sptr == 'D') { strcpy (ptr, "DISC"); pos = 4; } else if (*sptr == 'I') { pos = 3; } else { if (*sptr == 'r') { strupr (sptr); reponse = 1; } if (sptr[1] == 'R') pos = 3; else pos = 4; } if (version == 1) { if (reponse) sptr[pos] = '\0'; else sptr[pos] = '!'; } else { if (reponse) sptr[pos] = '-'; else sptr[pos] = '+'; } sptr[pos + 1] = '\0'; n_cpy (4, ui->ctl, ptr); } ui->ui = (strncmp (ui->ctl, "UI", 2) == 0); ui->pid = 0xf0; } static int kam_inbuf (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { int nbcar, can; int type; int i, lport; int valid = 0; int deja; char stemp[80]; static char buf[600]; char *ptr; df ("lit_txt_kam", 1); if ((nbcar = kam_read (*port, buf)) >= 3) { lport = (int) (*(buf + 1) - '0'); if (p_port[*port].ccanal != lport) { /* Recherche l'autre port du TNC */ for (i = 1; i < NBPORT; i++) { if (i == *port) continue; if (p_port[i].ccom == p_port[*port].ccom) { *port = i; break; } } } type = (int) *buf; can = (int) (*(buf + 2) - 'A') + 1; switch (type) { case 'M': ptr = buf + 3; nbcar -= 3; deja = 0; while ((*ptr) && (nbcar)) { --nbcar; if (*ptr++ == ':') { if (deja) { break; } deja = 1; } } kam_get_ui (*port, buf + 3, ui); if (nbcar > 0) { ++ptr; --nbcar; memcpy (buffer, ptr, nbcar); sprintf (ui->txt, " (%d)", nbcar); } else nbcar = 0; valid = 1; *cmd = UNPROTO; *canal = can; *len = nbcar; break; case 'S': nbcar -= 3; ptr = buf + 3; ptr[nbcar] = '\0'; *buffer = '\0'; *len = 0; /* TOR modes ... */ if (strncmp (ptr, "') stemp[strlen (stemp) - 1] = '\0'; sprintf (buffer, "(%d) CONNECTED to %s", can, stemp); valid = 1; *cmd = COMMAND; *canal = 1; *len = strlen (buffer); break; } else if (strstr (ptr, "STANDBY")) { sprintf (buffer, "(%d) DISCONNECTED fm KAM", can); p_port[*port].transmit = 0; valid = 1; *cmd = COMMAND; *canal = 1; *len = strlen (buffer); if ((p_port[*port].moport & 0x80) == 0) { /* Retour en mode packet */ kam_tor (*port, "X", 1); } break; } else if (*ptr != '*') break; ptr += 4; *buffer = '\0'; switch (*ptr) { case 'C': valid = 1; sscanf (ptr, "%*s %*s %s", stemp); sprintf (buffer, "(%d) CONNECTED to %s", can, stemp); /* Connection */ break; case 'D': valid = 1; sprintf (buffer, "(%d) DISCONNECTED fm KAM", can); /* Deconnection */ break; case 'r': valid = 1; sprintf (buffer, "(%d) LINK FAILURE with KAM", can); break; default: valid = 0; break; } *cmd = COMMAND; *canal = can; *len = strlen (buffer); break; case 'D': nbcar -= 3; memcpy (buffer, buf + 3, nbcar); valid = 1; *cmd = DATA; if (can < 0) can = 1; *canal = can; *len = nbcar; break; case 'C': nbcar -= 3; memcpy (buffer, buf + 3, nbcar); *len = 0; *cmd = NOCMD; if (nbcar > 0) { if (strncmp (buf + 3, "FREE", 4) == 0) { stat_ch sta; int tnc = p_port[*port].ccom; memset (&sta, 0, sizeof (sta)); *port = kam_try[tnc].port; can = kam_try[tnc].stream; lit_kam_status (*port, buf + 3, &sta); memcpy (buffer, &sta, sizeof (sta)); valid = 1; *cmd = STATS; *canal = can; *len = 0; } else if (strncmp (buf + 3, "TRIES", 5) == 0) { stat_ch sta; int tnc = p_port[*port].ccom; memset (&sta, 0, sizeof (sta)); *port = kam_try[tnc].port; can = kam_try[tnc].stream; lit_kam_tries (*port, can, buf + 3, &sta); memcpy (buffer, &sta, sizeof (sta)); valid = 1; *cmd = STATS; *canal = can; *len = 0; kam_try[tnc].port = 0; } else { valid = 1; *cmd = ECHOCMD; *canal = can; *len = nbcar; } } break; case 'R': nbcar -= 3; memcpy (buffer, buf + 3, nbcar); valid = 1; *cmd = UNPROTO; *canal = can; *len = nbcar; break; case 'I': valid = 0; *cmd = TOR; p_port[*port].transmit = (can != '0'); *len = 0; break; default: break; } } ff (); return (valid); } void env_com_kam (int port, int canal, char *buffer) { if (toupper (*buffer) == 'B') { paclen_change (port, canal, buffer); } else { kam_send (port, 0, 1, buffer, strlen (buffer)); *buffer = '\0'; } } fbb-7.0.10/src/mbl_prn.c0000644000175000017500000001363213613360505011644 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MBL_PRN.C */ #include #ifdef __FBBDOS__ static char print_name[128]; static int print_string (char *, FILE *); #endif static int open_print (void); static int print_mess (int, bullist *); #ifdef __FBBDOS__ static void print_file (char *ptr); #endif int mbl_print (void) { bullist *pbul; long no; int ok = 0; int verbose = 0; int old_print = print; if (voiecur != CONSOLE) return (0); incindd (); if (!ISGRAPH (*indd)) { if (print) { close_print (); } else { open_print (); } return (1); } #ifdef __FBBDOS__ if (*indd == '>') { incindd (); print_file (indd); return (1); } #endif if (toupper (*indd) == 'V') { verbose = 1; incindd (); } if (!print) open_print (); while ((no = lit_chiffre (1)) != 0L) { ok = 1; if ((pbul = ch_record (NULL, no, '\0')) != NULL) { if (!print_mess (verbose, pbul)) break; } else texte (T_ERR + 10); } if (!old_print) close_print (); return (ok); } static int print_mess (int verbose, bullist * pbul) { #ifdef __FBBDOS__ char *ptr; FILE *fptr; int fd; int c, first = 1; int nb = 0; int call = 0; char ligne[90]; char chaine[256]; int flag = FALSE; long record = 0L; short postexte = 0; trait_time = 0; *ptmes = *pbul; if (*ptmes->bbsv) sprintf (varx[0], "@%-6s ", ptmes->bbsv); else *varx[0] = '\0'; fputc ('\r', file_prn); if (!print) return (0); fputc ('\n', file_prn); if (!print) return (0); ptr = expand (langue[vlang]->plang[T_MBL + 35 - 1]); if (!print_string (ptr, file_prn)) return (0); ptr = expand (langue[vlang]->plang[T_MBL + 38 - 1]); if (!print_string (ptr, file_prn)) return (0); if ((fptr = fopen (mess_name (MESS, ptmes->numero, chaine), "rb")) == NULL) return (0); if (!verbose) { /* fseek(fptr, supp_header(fptr, 0), 0) ; */ ptr = ligne; while ((c = fgetc (fptr)) != EOF) { if ((flag) && (c == '\n')) { record = ftell (fptr); postexte = 0; call = 0; flag = FALSE; } else { switch (call) { case 0: break; case 1: if (isalnum (c)) { *ptr++ = c; nb++; call = 2; } break; case 2: if (isalnum (c)) { *ptr++ = c; nb++; } else { *ptr++ = '!'; nb++; call = 0; if (nb >= 65) { *ptr++ = '\r'; *ptr++ = '\n'; nb += 2; fflush (file_prn); write (fileno (file_prn), ligne, nb); nb = 0; ptr = ligne; first = 2; } } break; } if (postexte == 0) { if (c != 'R') /*return(record) */ break; else flag = TRUE; } if ((postexte == 1) && (flag) && (c != ':')) /*return(record) */ break; ++postexte; } if ((flag) && (c == '@')) { if (first) { fflush (file_prn); if (first == 1) { write (fileno (file_prn), "Path: !", 7); } else { write (fileno (file_prn), " !", 7); } first = 0; } call = 1; } } if (nb) { *ptr++ = '\r'; *ptr++ = '\n'; nb += 2; fflush (file_prn); write (fileno (file_prn), ligne, nb); } } if (!print) return (0); fseek (fptr, record, 0); fflush (fptr); fflush (file_prn); fd = fileno (fptr); copy_fic (fd, fileno (file_prn), NULL); fclose (fptr); #endif return (1); } #ifdef __FBBDOS__ static int print_string (char *ptr, FILE * fptr) { while (*ptr) { if (*ptr == '\n') { fputc ('\r', fptr); if (!print) return (0); } fputc (*ptr, fptr); if (!print) return (0); ++ptr; } return (1); } #endif void init_print (void) { #ifdef __FBBDOS__ file_prn = stdprn; strcpy (print_name, "PRN:"); #endif } #ifdef __FBBDOS__ static void print_file (char *ptr) { char old[128]; char s[256]; int ok = print; sup_ln (ptr); if (*ptr) { strcpy (old, print_name); close_print (); if (*ptr == '-') { file_prn = stdprn; strcpy (print_name, "PRN:"); } else { strcpy (print_name, strupr (ptr)); } ok = open_print (); print = 0; if (!ok) { #ifdef ENGLISH sprintf (s, "Error printing to %s ", print_name); #else sprintf (s, "Erreur impression sur %s", print_name); #endif strcpy (print_name, old); } } #ifdef ENGLISH sprintf (s, "Printing to %s ", print_name); #else sprintf (s, "Impression sur %s", print_name); #endif outln (s, strlen (s)); print = ok; } #endif void close_print (void) { print = 0; #if defined( __WINDOWS__) || defined(__linux__) SpoolLine (0, 0, NULL, 0); #endif #ifdef __FBBDOS__ if ((file_prn != stdprn) && (file_prn)) { fclose (file_prn); } file_prn = NULL; trait (0, ""); #endif } static int open_print (void) { #ifdef __linux__ print = 1; #endif #ifdef __WINDOWS__ print = 1; #endif #ifdef __FBBDOS__ if (file_prn) close_print (); if (strcmp (print_name, "PRN:") == 0) { print = 1; file_prn = stdprn; } else if ((file_prn = fopen (print_name, "ab")) != NULL) { print = 1; } trait (0, ""); #endif return (print); } fbb-7.0.10/src/fwdovl3.c0000644000175000017500000006466713613360505011615 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 3 */ #include static void seek_fwd (unsigned pos) { if (EMS_FWD_OK ()) seek_exms_string (FORWARD, (long) pos); else fwd_scan = fwd_file + pos; } void rewind_fwd (void) { seek_fwd (0); } static unsigned tell_fwd (void) { if (EMS_FWD_OK ()) return (unsigned) (tell_exms_string (FORWARD)); else return (unsigned) (fwd_scan - fwd_file); } void param_tnc (int type, typ_pfwd ** ptnc, char *cmde) { typ_pfwd *p; if (*ptnc == NULL) { *ptnc = (typ_pfwd *) m_alloue (sizeof (typ_pfwd)); p = *ptnc; } else { p = *ptnc; while (p->suiv) p = p->suiv; p->suiv = (typ_pfwd *) m_alloue (sizeof (typ_pfwd)); p = p->suiv; } p->suiv = NULL; n_cpy (78, p->chaine, cmde); p->type = type; } void libere_tnc (typ_pfwd ** ptnc) { typ_pfwd *pcurr, *ptemp; pcurr = *ptnc; while (pcurr) { ptemp = pcurr; pcurr = pcurr->suiv; m_libere (ptemp, sizeof (typ_pfwd)); } *ptnc = NULL; } int n_bbs (char *bbs) { char *ptr = bbs_ptr; int nb = 1; while (nb <= NBBBS) { if (strncmp (ptr, bbs, 6) == 0) return (nb); ++nb; ptr += 7; } return (0); } int num_bbs (char *bbs) { int nb = n_bbs (strupr (bbs)); char bbs_nom[10]; char s[80]; if (nb == 0 && !svoie[CONSOLE]->sta.connect) { strn_cpy (6, bbs_nom, bbs); #ifdef ENGLISH sprintf (s, "Unknown BBS %s in BBS.SYS file ", bbs_nom); #else sprintf (s, " BBS %s inconnue dans BBS.SYS ", bbs_nom); #endif win_message (2, s); } return (nb); } int get_link (int no_bbs) { if (no_bbs) return ((int) *(bbs_ptr + 6 + 7 * (no_bbs - 1))); else return (1); } void set_link (int no_bbs, int choix) { if (no_bbs) *(bbs_ptr + 6 + 7 * (no_bbs - 1)) = (char) choix; } static int fwd_libre (int nobbs, int noport) { int test; Forward *pfwd = p_port[noport].listfwd; test = already_forw (p_port[noport].fwd, nobbs); if (test == 0) { while (pfwd) { if (nobbs == pfwd->no_bbs) return (0); pfwd = pfwd->suite; } return (1); } else return (0); } int what_port (int n_bbs) { int temp; int trouve = 0; int fin = 0; int nobbs = 0; int cptif = 0; int fwdlig = 0; int dans_bloc = 0; int nbchoix = 1; long h_time = time (NULL); int port = -1; char combuf[80]; char *pcom; /* init_bbs() ; */ rewind_fwd (); while (!fin) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++fwdlig; switch (*pcom++) { case 'E': /* ENDIF */ --cptif; break; case 'I': ++cptif; if (tst_fwd (pcom, nobbs, h_time, 0, &nbchoix, 0, -1) == FALSE) { temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++fwdlig; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; case '@': if (cptif == (temp + 1)) ++temp; /* else */ break; default: break; } } } break; case '@': /* ELSE */ temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++fwdlig; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; default: break; } } break; case 'P': /* Indication du port de forward */ if (dans_bloc) { *pcom = toupper (*pcom); port = *pcom - '@'; } break; case 'A': dans_bloc = port = 1; nobbs = num_bbs (pcom); trouve = (nobbs == n_bbs); break; case '-': nobbs = dans_bloc = 0; if (trouve) fin = 1; break; } } return (port); } void appel_fwd (Forward * pfwd, int noport) { uchar max, old, typ; char nombbs[80]; char combuf[80]; char *ptr; char *pcom; char mesnoeud[4][3][20]; int mesnum; int i, nobbs, port, voie = 0, temp, choix, canal; int reverse, fin, retour, con_fwd, dde_clk; int trouve, dans_bloc, fbb_mode, t_o, nbchoix; int reverse_mode, val, dans_test_port; int data_mode = 1; int nb_prompt = 0; char s[80]; #ifdef __FBBDOS__ fen *fen_ptr; #endif typ_pfwd *ptnc; typ_pfwd *ctnc; atfwd *nbmess; long h_time = time (NULL); char p_route[NB_P_ROUTE][7]; df ("appel_fwd", 3); ctnc = NULL; pfwd->lastpos = pfwd->fwdpos; do { for (i = 0; i < NB_P_ROUTE; i++) *p_route[i] = '\0'; seek_fwd (pfwd->fwdpos); /* fwd_scan = fwd_file + pfwd->fwdpos; */ ptnc = NULL; nobbs = 0; dans_test_port = 0; port = 1; reverse = pfwd->reverse; fin = FALSE; retour = 0; con_fwd = FALSE; trouve = 0; dans_bloc = 0; fbb_mode = -1; dde_clk = 0; /* t_o = 0; */ t_o = time_b; nbchoix = 1; while (!trouve) { if (fwd_get (combuf) == 0) { fin = TRUE; retour = 0; pfwd->reverse = 0; break; } pcom = combuf; ++pfwd->fwdlig; switch (*pcom++) { case 'E': /* ENDIF */ if (dans_test_port == pfwd->cptif) dans_test_port = 0; --pfwd->cptif; break; case '@': /* ELSE */ temp = pfwd->cptif - 1; while (pfwd->cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++pfwd->fwdlig; switch (*pcom++) { case 'I': ++pfwd->cptif; break; case 'E': --pfwd->cptif; break; default: break; } } break; case 'I': ++pfwd->cptif; if ((val = tst_fwd (pcom, nobbs, h_time, port, NULL, pfwd->reverse, noport)) == FALSE) { temp = pfwd->cptif - 1; while (pfwd->cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++pfwd->fwdlig; switch (*pcom++) { case 'I': ++pfwd->cptif; break; case 'E': --pfwd->cptif; break; case '@': if (pfwd->cptif == (temp + 1)) ++temp; break; default: break; } } } else if (val == 'P') { dans_test_port = pfwd->cptif; } break; case 'D': if ((!dans_bloc) && ((port == noport) || (dans_test_port))) { if (strncmpi (pcom, "PTCTRX", 6) == 0) { ptctrx (port, pcom); } else { #ifdef __WINDOWS__ if (call_dll (pcom, NO_REPORT_MODE, NULL, 0, NULL) == -1) call_nbdos (&pcom, 1, NO_REPORT_MODE, NULL, NULL, NULL); #endif #ifdef __FBBDOS__ send_dos (1, pcom, NULL); #endif #ifdef __linux__ call_nbdos (&pcom, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #endif } } break; case 'L': if ((!dans_bloc) && ((port == noport) || (dans_test_port))) program_tnc (no_voie (noport, 1), pcom); break; case 'X': if ((!dans_bloc) && ((port == noport) || (dans_test_port))) { if (strncmpi (pcom, "PTCTRX", 6) == 0) { ptctrx (port, pcom); } else { #ifdef __WINDOWS__ if (call_dll (pcom, NO_REPORT_MODE, NULL, 0, NULL) == -1) call_nbdos (&pcom, 1, NO_REPORT_MODE, NULL, NULL, NULL); #endif #ifdef __FBBDOS__ send_dos (2, pcom, NULL); #endif #ifdef __linux__ call_nbdos (&pcom, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #endif } } break; case 'P': /* Indication du port de forward */ *pcom = toupper (*pcom); port = *pcom - '@'; break; case 'A': dans_bloc = 1; strcpy (nombbs, pcom); nobbs = num_bbs (nombbs); if ((chercher_voie (nombbs) == -1) && (!pfwd->fin_fwd) && (fwd_libre (nobbs, noport)) && ((*pfwd->fwdbbs == '\0') || (strcmp (pfwd->fwdbbs, nombbs) == 0))) { trouve = 1; } break; case '-': nobbs = dans_bloc = 0; break; } } pfwd->con_lig[0][0] = '\0'; pfwd->txt_con[0] = '\0'; for (mesnum = 0; mesnum < 4; mesnum++) for (i = 0; i < 3; i++) *mesnoeud[mesnum][i] = '\0'; mesnum = 0; max = 0xff; old = 0; typ = '\0'; port = 1; canal = 0; pfwd->no_con = 0; for (i = 0; i < 8; i++) *pfwd->con_lig[i] = '\0'; if (!fin) { /* Valide le flag forward de la bbs */ set_bit_fwd (p_port[noport].fwd, nobbs); reverse_mode = 1; while ((!fin) && (fwd_get (combuf))) { pcom = combuf; ++pfwd->fwdlig; switch (*pcom++) { case '!': /* Not */ break; case 'B': /* Nom de la BBS destinataire */ break; case 'C': /* sauvegarde du texte de connnexion */ if (pfwd->no_con < 8) { n_cpy (79, pfwd->con_lig[pfwd->no_con], pcom); pfwd->no_con++; } break; case 'd': /* commande DOS */ param_tnc (1, &ctnc, pcom); break; case 'D': param_tnc (1, &ptnc, pcom); break; case 'E': /* ENDIF */ if (dans_test_port == pfwd->cptif) dans_test_port = 0; --pfwd->cptif; break; case 'F': /* OM associe a la BBS */ break; case 'G': /* indicateur de groupe */ break; case 'H': /* indicateur de hierarchie */ break; case 'I': /* IF */ ++pfwd->cptif; if ((val = tst_fwd (pcom, nobbs, h_time, port, &nbchoix, pfwd->reverse, noport)) == FALSE) { temp = pfwd->cptif - 1; while (pfwd->cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++pfwd->fwdlig; switch (*pcom++) { case 'I': ++pfwd->cptif; break; case 'E': --pfwd->cptif; break; case '@': if (pfwd->cptif == (temp + 1)) /* code folded from here */ ++temp; /* unfolding */ break; default: break; } } } else if (val == 'P') { dans_test_port = pfwd->cptif; } break; case 'J': /* Selection des messages "data" */ data_mode = atoi (pcom); break; case 'K': /* Canal preselectionne */ canal = atoi (pcom); break; case 'l': /* Ligne de commande TNC (connection) */ param_tnc (0, &ctnc, pcom); break; case 'L': /* Ligne de commande TNC */ param_tnc (0, &ptnc, pcom); break; case 'M': /* Pas de reverse */ reverse_mode = 0; break; case 'N': /* Pas de forward FBB */ /* 1 = FBB */ /* 2 = FBB+BIN */ /* 4 = FBB+BIN+RESUME */ /* 8 = XFWD */ fbb_mode = (atoi (pcom) << 1) + 1; if (fbb_mode & 8) fbb_mode |= 7; else if (fbb_mode & 4) fbb_mode |= 3; break; case 'O': /* Time-out en forward */ t_o = atoi (pcom) * 60; break; case 'P': /* Indication du port de forward */ *pcom = toupper (*pcom); port = *pcom - '@'; break; case 'Q': /* Interdiction Reverse */ break; case 'R': /* reverse forwarding */ reverse = TRUE; break; case 'S': /* critere de selection des messages Noeuds */ if (mesnum == 4) break; sscanf (pcom, "%s %s %s", mesnoeud[mesnum][0], mesnoeud[mesnum][1], mesnoeud[mesnum][2]); ++mesnum; break; case 'T': /* limite la taille du fichier forwarde */ while (*pcom) { if (toupper (*pcom) == 'M') { ++pcom; max = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else if (toupper (*pcom) == 'O') { ++pcom; old = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else if (toupper (*pcom) == 'P') { typ |= FWD_PRIV; ++pcom; } else if (toupper (*pcom) == 'S') { typ |= FWD_SMALL; ++pcom; } else if (toupper (*pcom) == 'D') { typ |= FWD_DUPES; ++pcom; } else if (isdigit (*pcom)) { max = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else ++pcom; } break; case 'U': /* Routage prioritaire */ if ((ptr = strtok (pcom, " \t")) != NULL) { strn_cpy (6, p_route[0], ptr); i = 1; while ((ptr = strtok (NULL, " \t")) != NULL) { strn_cpy (6, p_route[i], ptr); ++i; if (i == NB_P_ROUTE) break; } } break; case 'V': /* texte envoye en connexion */ strcpy (pfwd->txt_con, pcom); break; case 'W': if (isdigit (*pcom)) nb_prompt = atoi (pcom); else nb_prompt = 1; break; case 'x': /* commande DOS */ param_tnc (2, &ctnc, pcom); break; case 'X': /* commande DOS */ param_tnc (2, &ptnc, pcom); break; case 'Y': /* Mise a l'heure PMS */ dde_clk = 1; break; case 'Z': /* NTS */ break; case '@': /* ELSE */ temp = pfwd->cptif - 1; while (pfwd->cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++pfwd->fwdlig; switch (*pcom++) { case 'I': ++pfwd->cptif; break; case 'E': --pfwd->cptif; break; default: break; } } break; case '*': case '#': /* ligne commentaire */ break; case '-': /* fin de bloc - passage BBS a connecter suivante */ /************ ???????????? ***************/ /* pfwd->fwdpos = (unsigned) (fwd_scan - fwd_file) ; */ pfwd->fwdpos = tell_fwd (); if ((noport == port) && ((voie = ch_voie (port, canal)) >= 0) && ((((nbmess = attend_fwd (nobbs, max, old, typ, data_mode)) != 0L) || (reverse)))) { deb_io (); sprintf (s, "Forward %d %s", nobbs, nombbs); /* fprintf (stderr, "\nForward %d %s\n", nobbs, nombbs);*/ #ifdef __FBBDOS__ fen_ptr = open_win (45, 5, 68, 18, INIT, s); #endif #ifdef __linux__ #ifdef ENGLISH if (max < 0xff) cprintf ("Max size : %u Kb\n", max); #else /* if (max < 0xff) printf ("Taille max %u Kb\n", max);*/ #endif #ifdef ENGLISH if (typ & FWD_SMALL) cprintf ("Smallest first \n"); #else if (typ & FWD_SMALL) cprintf ("Envoi par taille\n"); #endif #endif /* if (nbmess) { #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("\nPrivate : %d\r\n", nbmess->nbpriv); cprintf ("Bulletins : %d\r\n", nbmess->nbbul); #else cprintf ("\nPriv‚s : %d\r\n", nbmess->nbpriv); cprintf ("Bulletins : %d\r\n", nbmess->nbbul); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("\nPrivate : %d\n", nbmess->nbpriv); cprintf ("Bulletins : %d\n", nbmess->nbbul); #else cprintf ("\nPriv‚s : %d\n", nbmess->nbpriv); cprintf ("Bulletins : %d\n", nbmess->nbbul); #endif #endif } else #ifdef __FBBDOS__ cprintf ("\nReverse\r\n"); #endif #ifdef __linux__ cprintf ("\nReverse\n"); #endif */ /* il y a des messages a forwarder - connexion */ if (*pfwd->con_lig[0]) { #ifdef __FBBDOS__ /* cprintf ("Link BBS #%d\r\n", get_link (nobbs));*/ #endif #ifdef __linux__ /* cprintf ("Link BBS #%d\n", get_link (nobbs));*/ #endif program_fwd (1, 1, &ptnc, voie); svoie[voie]->ctnc = ctnc; ctnc = NULL; svoie[voie]->nb_prompt = nb_prompt; svoie[voie]->nb_choix = nbchoix; svoie[voie]->cur_choix = (uchar) get_link (nobbs); svoie[voie]->curfwd = pfwd; svoie[voie]->maxfwd = max; svoie[voie]->oldfwd = old; svoie[voie]->typfwd = typ; svoie[voie]->bbsfwd = (uchar) nobbs; svoie[voie]->rev_mode = reverse_mode; svoie[voie]->data_mode = data_mode; if (dde_clk) svoie[voie]->clock = 1; for (mesnum = 0; mesnum < 4; mesnum++) for (i = 0; i < 3; i++) n_cpy (19, pfwd->mesnode[mesnum][i], mesnoeud[mesnum][i]); pvoie->sid = 0; if (fbb_mode == -1) { svoie[voie]->fbb = bin_fwd; svoie[voie]->prot_fwd = prot_fwd; } else { if (fbb_mode & FWD_BIN) svoie[voie]->fbb = bin_fwd; svoie[voie]->prot_fwd = prot_fwd & fbb_mode; } /* if (t_o == time_n) */ /* if (t_o == time_b) ++t_o; */ /* if (t_o) { */ svoie[voie]->timout = t_o; /* init_timout (voie); * ? F6BVP */ #ifdef __FBBDOS__ /* cprintf ("Time out %d mn\r\n", t_o / 60);*/ #endif #ifdef __linux__ /* cprintf ("Time out %d mn\n", t_o / 60);*/ #endif con_fwd = TRUE; retour = voie; } else { choix = get_link (nobbs); if (choix < (int) nbchoix) { ++choix; set_link (nobbs, choix); clr_bit_fwd (p_port[noport].fwd, nobbs); pfwd->fwdpos = pfwd->lastpos; } else set_link (nobbs, 1); retour = -1; } for (i = 0; i < NB_P_ROUTE; i++) { if (*p_route[i]) #ifdef __FBBDOS__ cprintf ("Prio : %s\r\n", p_route[i]); #endif #ifdef __linux__ cprintf ("Prio : %s\n", p_route[i]); #endif strcpy (svoie[voie]->p_route[i], p_route[i]); } #ifdef __FBBDOS__ if (pfwd->reverse) { sleep_ (1); } close_win (fen_ptr); #endif fin_io (); } else { retour = -1; } fin = TRUE; break; } } } if (con_fwd) { pfwd->no_bbs = nobbs; if (noport) { if (connect_fwd (voie, pfwd) != 0) { dec_voie (voie); retour = -1; } else { pfwd->no_con = 1; } } else { if (!mail_out (pfwd->con_lig[0])) retour = -1; } } libere_tnc (&ptnc); if (ctnc) libere_tnc (&ctnc); } while (retour == -1); if (!retour) { *pfwd->fwdbbs = '\0'; } pfwd->forward = retour; aff_forward (); ff (); } int appel_rev_fwd (int affiche) { int i; int temp, nobbs, retour = FALSE, fin = FALSE, ligne = 0, cptif = 0; int reverse = 1; char nombbs[80]; char combuf[80]; char *pcom; char *ptr; #ifdef __FBBDOS__ fen *fen_ptr; #endif typ_pfwd *ptnc; atfwd *nbmess; long h_time = time (NULL); df ("appel_rev_fwd", 1); ptnc = NULL; pvoie->data_mode = 1; /* init_bbs() ; */ pvoie->bbsfwd = 0; rewind_fwd (); while (TRUE) { if (fwd_get (combuf) == 0) { ff (); return (FALSE); } pcom = combuf; ++ligne; if (*pcom++ == 'A') { port = 1; strcpy (nombbs, pcom); nobbs = num_bbs (nombbs); if (indcmp (nombbs, pvoie->sta.indicatif.call)) { break; } } } for (i = 0; i < NB_P_ROUTE; i++) *(pvoie->p_route[i]) = '\0'; pvoie->maxfwd = 0xff; pvoie->oldfwd = 0; pvoie->typfwd = 0; pvoie->bbsfwd = (uchar) nobbs; deb_io (); #ifdef __FBBDOS__ if (affiche == 1) { sprintf (s, "Reverse %d %s", nobbs, nombbs); fen_ptr = open_win (45, 5, 68, 18, INIT, s); } #endif while ((!fin) && (fwd_get (combuf))) { pcom = combuf; ++ligne; switch (*pcom++) { case '!': /* Not */ break; case 'B': /* recuperer le nom de la BBS destinataire */ break; case 'C': /* sauvegarde du texte de connexion */ break; case 'l': /* Ligne de commande TNC */ break; case 'O': pvoie->timout = atoi (pcom) * 60; /* if (affiche == 1) cprintf ("Time out voie %d = %d mn\r\n", i, pvoie->timout / 60);*/ break; case 'd': /* commande DOS */ case 'x': /* commande DOS */ case 'P': /* Indication du port de forward */ case 'D': /* Commande DOS */ case 'K': /* Canal preselectionne */ case 'M': /* Pas de reverse */ case 'N': /* Mode FBB inactif */ case 'R': /* Reverse */ case 'S': /* Chaines identification */ case 'V': /* Texte connexion */ case 'X': /* Commande DOS */ case 'Y': /* Mise a l'heure */ case 'Z': /* NTS */ break; case 'Q': /* Interdit le reverse */ reverse = 0; break; case 'E': /* ENDIF */ --cptif; break; case 'F': /* chercher les messages de l'OM associe a la BBS */ break; case 'G': /* Indicateur de groupe */ break; case 'H': /* indicateur de hierarchie */ break; case 'I': /* IF */ ++cptif; if (tst_fwd (pcom, nobbs, h_time, 0, NULL, 1, -1) == FALSE) { temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; case '@': if (cptif == (temp + 1)) ++temp; break; default: break; } } } break; case 'J': /* Selection des messages "data" */ pvoie->data_mode = atoi (pcom); break; case 'T': /* limite la taille du fichier forwarde */ while (*pcom) { if (toupper (*pcom) == 'M') { ++pcom; pvoie->maxfwd = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else if (toupper (*pcom) == 'O') { ++pcom; pvoie->oldfwd = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else if (toupper (*pcom) == 'P') { pvoie->typfwd |= FWD_PRIV; ++pcom; } else if (toupper (*pcom) == 'S') { pvoie->typfwd |= FWD_SMALL; ++pcom; } else if (toupper (*pcom) == 'D') { pvoie->typfwd |= FWD_DUPES; ++pcom; } else if (isdigit (*pcom)) { pvoie->maxfwd = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else ++pcom; } break; case 'U': /* Routage prioritaire */ if ((ptr = strtok (pcom, " \t")) != NULL) { strn_cpy (6, pvoie->p_route[0], ptr); i = 1; while ((ptr = strtok (NULL, " \t")) != NULL) { strn_cpy (6, pvoie->p_route[i], ptr); ++i; if (i == NB_P_ROUTE) break; } } break; case '@': /* ELSE */ temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++ligne; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; default: break; } } break; case '*': case '#': /* ligne commentaire */ break; case '-': /* fin de bloc - envoi du reverse forwarding */ if ((reverse) && ((nbmess = attend_fwd (nobbs, pvoie->maxfwd, pvoie->oldfwd, pvoie->typfwd, pvoie->data_mode)) != 0L)) { /* if (affiche == 1) { #ifdef ENGLISH cprintf ("\nPrivate : %d\r\n", nbmess->nbpriv); cprintf ("Bulletins : %d\r\n", nbmess->nbbul); #else cprintf ("\nPriv‚s : %d\r\n", nbmess->nbpriv); cprintf ("Bulletins : %d\r\n", nbmess->nbbul); #endif for (i = 0; i < NB_P_ROUTE; i++) { if (*pvoie->p_route[i]) cprintf ("Prio : %s\r\n", pvoie->p_route[i]); } } */ retour = 1; } else retour = 0; fin = TRUE; break; } } libere_tnc (&ptnc); #ifdef __FBBDOS__ if (affiche) { if (pvoie->reverse) { sleep_ (1); } close_win (fen_ptr); } #endif fin_io (); ff (); return (retour); } void prog_rev_tnc (int voie) { int i; int temp, nobbs, fin = FALSE, ligne = 0, cptif = 0; int port = 1; char nombbs[80]; char combuf[80]; char *pcom; typ_pfwd *ptnc; long h_time = time (NULL); ptnc = NULL; nobbs = 0; rewind_fwd (); while (TRUE) { if (fwd_get (combuf) == 0) { return; } pcom = combuf; ++ligne; if (*pcom++ == 'A') { port = 1; strcpy (nombbs, pcom); nobbs = num_bbs (nombbs); if (indcmp (nombbs, svoie[voie]->sta.indicatif.call)) { break; } } } for (i = 0; i < NB_P_ROUTE; i++) *(svoie[voie]->p_route[i]) = '\0'; svoie[voie]->maxfwd = 0xff; svoie[voie]->oldfwd = 0; svoie[voie]->typfwd = 0; deb_io (); while ((!fin) && (fwd_get (combuf))) { pcom = combuf; ++ligne; switch (*pcom++) { case '!': /* Not */ break; case 'B': /* recuperer le nom de la BBS destinataire */ break; case 'C': /* sauvegarde du texte de connexion */ break; case 'l': /* Ligne de commande TNC */ param_tnc (0, &ptnc, pcom); break; case 'O': break; case 'd': /* commande DOS */ param_tnc (1, &ptnc, pcom); break; case 'x': /* commande DOS */ param_tnc (2, &ptnc, pcom); break; case 'P': /* Indication du port de forward */ *pcom = toupper (*pcom); port = *pcom - '@'; break; case 'K': /* Canal preselectionne */ case 'M': /* Pas de reverse */ case 'N': /* Mode FBB inactif */ case 'R': /* Reverse */ case 'S': /* Chaines identification */ case 'V': /* Texte connexion */ case 'Y': /* Mise a l'heure */ case 'Z': /* NTS */ break; case 'Q': /* Interdit le reverse */ break; case 'E': /* ENDIF */ --cptif; break; case 'F': /* chercher les messages de l'OM associe a la BBS */ break; case 'G': /* Indicateur de groupe */ break; case 'H': /* indicateur de hierarchie */ break; case 'I': /* IF */ ++cptif; if (tst_fwd (pcom, nobbs, h_time, 0, NULL, 1, -1) == FALSE) { temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; case '@': if (cptif == (temp + 1)) ++temp; break; default: break; } } } break; case 'T': /* limite la taille du fichier forwarde */ break; case 'U': /* Routage prioritaire */ break; case '@': /* ELSE */ temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) { fin = TRUE; break; } pcom = combuf; ++ligne; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; default: break; } } break; case '*': case '#': /* ligne commentaire */ break; case '-': /* fin de bloc - envoi du reverse forwarding */ if ((port == no_port (voie)) && (ptnc)) { program_fwd (1, 1, &ptnc, voie); } fin = 1; break; } } libere_tnc (&ptnc); fin_io (); } fbb-7.0.10/src/mbl_menu.c0000644000175000017500000003064513613360505012014 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MBL_MENU.C * */ #include /* * Pas de forward si read-only * si pas déclaré BBS sur un port GUEST */ int forward_auth (int voie) { /* Toujours OK sur l'import/export */ if (voie == INEXPORT) return (1); if (POP (no_port (voie))) return (1); if (svoie[voie]->read_only) return 0; if (std_header & 128) { /* N'accepte que si BBS declarees */ if ((BBS (svoie[voie]->finf.flags)) || (PMS (svoie[voie]->finf.flags))) return (1); else return (0); } if ((P_GUEST (voie)) && (!BBS (svoie[voie]->finf.flags))) return 0; return 1; } static void menu_mbl (void) { int c, error = 0; int cmd = 1; char com[80]; char *pt_err = indd; char *ptr; limite_commande (); while (*indd && (!ISGRAPH (*indd))) indd++; strn_cpy (70, com, indd); ptr = strchr (com, ' '); if (ptr) *ptr = '\0'; c = *indd++; if ((!SYS (pvoie->finf.flags)) && (voiecur != CONSOLE) && (!LOC (pvoie->finf.flags)) && (P_GUEST (voiecur))) { switch (toupper (c)) { case 'A': interruption (voiecur); break; case 'B': if (bye ()) { maj_niv (N_MENU, 0, 0); sortie (); } else { cmd_err (--indd); } break; case 'F': if (FOR (pvoie->mode)) { if (*indd == '>') { maj_niv (N_FORW, 1, 0); rcv_rev_fwd (); } else { maj_niv (N_MENU, 0, 0); sortie (); } } else error = 1; break; case 'K': if (!read_only ()) { if (toupper (*indd) == 'M') { maj_niv (N_MBL, 4, 0); mbl_kill (); } else error = 1; } else retour_mbl (); break; case 'L': if ((toupper (*indd) == 'M') || (toupper (*indd) == 'N')) { maj_niv (N_MBL, 1, 0); mbl_list (); } else error = 1; break; case 'N': maj_niv (N_MBL, 7, 0); error = mbl_name (); break; case 'O': maj_niv (N_MBL, 11, 0); error = mbl_options (); retour_mbl (); break; /* Added by N1URO for cross-node command set compatability */ case 'Q': if (quit ()) { maj_niv (N_MENU, 0, 0); sortie (); } case 'R': if ((toupper (*indd) == 'M') || (toupper (*indd) == 'N')) { maj_niv (N_MBL, 2, 0); mbl_read (0); } else error = 1; break; case 'S': maj_niv (N_MBL, 3, 0); mbl_send (); break; case 'T': maj_niv (N_MBL, 9, 0); mbl_tell (); break; case 'X': if (EXP (pvoie->finf.flags)) { pvoie->finf.flags &= (~F_EXP); texte (T_MBL + 18); } else { pvoie->finf.flags |= F_EXP; texte (T_MBL + 17); } /* pvoie->finf.flags = pvoie->mode ; */ if (!pvoie->read_only) ch_info (); retour_mbl (); break; case '[': if (forward_auth (voiecur)) { while (ISGRAPH (*indd)) ++indd; if (*(indd - 1) == ']') { analyse_idnt (pt_err); if (pvoie->prot_fwd & FWD_FBB) { pvoie->temp1 = 0; pvoie->ind_mess = 0; pvoie->temp2 = FALSE; init_rec_fwd (voiecur); maj_niv (N_FORW, 5, 2); return; } else pvoie->mode |= F_BBS; prompt (pvoie->finf.flags, pvoie->niv1); } else cmd_err (pt_err); } else cmd_err (--indd); break; case '*': /* if ((*indd == '*') && (*(indd + 1) == '*')) { indd += 3; if (test_linked ()) { traite_voie (voiecur); } } else */ { cmd_err (--indd); } cmd = 0; break; case 'H': if ((*indd) && (strncmpi (indd, "ELP", 3) == 0)) { int nb = 0; while ((*indd) && (!isspace (*indd))) { ++indd; ++nb; } if (nb != 3) { error = 1; break; } } else if (ISGRAPH (*indd)) { error = 1; break; } case '?': while (isspace (*indd)) ++indd; help (indd); break; case ';': cmd = 0; break; case '\0': cmd = 0; prompt (pvoie->finf.flags, N_MBL); break; default: cmd = 0; --indd; if (!defaut ()) error = 1; break; } if (error) { cmd_err (pt_err); } } else { if (!appel_pg (com)) { switch (toupper (c)) { case 'A': if (!ISGRAPH (*indd)) interruption (voiecur); else error = 1; break; case 'B': if (bye ()) { maj_niv (N_MENU, 0, 0); sortie (); } else error = 1; /* { cmd_err(--indd) ; } */ break; case 'C': maj_niv (N_CONF, 0, 0); error = conference (); break; case 'D': maj_niv (N_MBL, 8, 0); error = mbl_dump (); break; case 'E': if (droits (COSYSOP)) { maj_niv (N_MBL, 11, 0); error = mbl_edit (); } else error = 1; /* { cmd_err(--indd) ; } */ break; case 'F': switch (toupper (*indd)) { case '>': if (FOR (pvoie->mode)) { if (pvoie->prot_fwd & FWD_XPRO) { maj_niv (N_XFWD, 1, 5); xfwd (); } else { maj_niv (N_FORW, 1, 0); rcv_rev_fwd (); } } else error = 1; break; case '<': if (FOR (pvoie->mode)) { send_binary_mess (); } else error = 1; break; case '\r': if (miniserv & 1) { pvoie->mbl = FALSE; texte (T_MBL + 19); /* pvoie->finf.flags |= F_EXP ; */ maj_niv (0, 1, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else error = 1; break; default: if (droits (COSYSOP)) error = maint_fwd (); else error = 1; break; } break; case 'G': if (!ISGRAPH (*indd)) { if (((gate) && nbgate () && (!pvoie->read_only)) || (voiecur == CONSOLE)) { pvoie->temp3 = pvoie->niv1; maj_niv (N_TELL, 0, 0); pvoie->mbl = 0; duplex_tnc (); } else { texte (T_GAT + 8); retour_mbl (); } } else error = 1; break; case 'H': sup_ln (indd); if (*indd) { if (strncmpi (indd, "ELP", 3) == 0) { int nb = 0; while ((*indd) && (!isspace (*indd))) { ++indd; ++nb; } if (nb != 3) { error = 1; break; } } else { error = mbl_hold (); break; } } case '?': while (isspace (*indd)) ++indd; help (indd); break; case 'I': maj_niv (N_MBL, 5, 0); error = menu_wp_search (); break; case 'J': maj_niv (N_MBL, 10, 0); error = mbl_jheard (); break; case 'K': if (!read_only ()) { maj_niv (N_MBL, 4, 0); error = mbl_kill (); } else retour_mbl (); break; case 'L': maj_niv (N_MBL, 1, 0); pvoie->typlist = 0; error = mbl_list (); break; case 'M': c = toupper (*indd); if ((!ISGRAPH (c)) || (c == 'V') || (c == 'H') || (c == 'A')) { error = mess_fic (); } else { if (droits (COSYSOP)) { maj_niv (N_MBL, 1, 0); pvoie->typlist = 1; error = mbl_list (); } else { error = 1; /* cmd_err(--indd) ; */ } } break; case 'N': maj_niv (N_MBL, 7, 0); error = mbl_name (); break; case 'O': maj_niv (N_MBL, 11, 0); error = mbl_options (); retour_mbl (); break; case 'P': if (!p_cmd ()) error = 1; break; /* Added by N1URO for cross-node command set compatability */ case 'Q': if (quit()) { maj_niv (N_MENU, 0, 0); sortie(); } else error = 1; break; case 'R': maj_niv (N_MBL, 2, 0); error = mbl_read (0); break; case 'S': maj_niv (N_MBL, 3, 0); error = mbl_send (); break; case 'T': if (!ISGRAPH (*indd)) { maj_niv (N_MBL, 9, 0); mbl_tell (); } else if (toupper (*indd) == 'H') { maj_niv (N_THEMES, 0, 0); error = themes (); } else error = 1; break; case 'U': if (!ISGRAPH (*indd)) { if (!is_room ()) { outln ("*** Disk full !", 15); retour_mbl (); break; } --indd; pvoie->temp1 = pvoie->niv1; strcpy (pvoie->dos_path, "\\"); maj_niv (N_DOS, 3, 0); receive_file (); } else error = 1; break; case 'V': maj_niv (N_MBL, 6, 0); error = mbl_read (1); break; case 'W': if (!ISGRAPH (*indd)) { --indd; pvoie->temp1 = pvoie->niv1; strcpy (pvoie->dos_path, "\\"); maj_niv (N_DOS, 1, 0); dir (); } else error = 1; break; case 'X': if (!ISGRAPH (*indd)) { if (EXP (pvoie->finf.flags)) { pvoie->finf.flags &= (~F_EXP); texte (T_MBL + 18); } else { pvoie->finf.flags |= F_EXP; texte (T_MBL + 17); } /* pvoie->finf.flags = pvoie->mode ; */ if (!pvoie->read_only) ch_info (); retour_mbl (); } else error = 1; break; case 'Y': if (ISGRAPH (*indd)) { if ((toupper (*indd) == 'D') && (!user_ok ())) { texte (T_ERR + 18); retour_mbl (); } else { maj_niv (N_YAPP, 0, 0); pvoie->temp1 = pvoie->niv1; error = (menu_yapp () == 0); } } else help ("Y"); break; case 'Z': if (!ISGRAPH (*indd)) { --indd; pvoie->temp1 = pvoie->niv1; strcpy (pvoie->dos_path, "\\"); maj_niv (N_DOS, 7, 0); del_file (); } else error = 1; break; case '$': if (droits (COSYSOP)) { incindd (); mbl_disbul (); retour_mbl (); } else error = 1; break; case '[': if (forward_auth (voiecur)) { while (ISGRAPH (*indd)) ++indd; if (*(indd - 1) == ']') { analyse_idnt (pt_err); if (pvoie->prot_fwd & FWD_FBB) { pvoie->temp1 = 0; pvoie->ind_mess = 0; pvoie->temp2 = FALSE; init_rec_fwd (voiecur); maj_niv (N_FORW, 5, 2); return; } else pvoie->mode |= F_BBS; prompt (pvoie->finf.flags, pvoie->niv1); } else cmd_err (pt_err); } else cmd_err (--indd); break; case '*': if ((*indd == '*') && (*(indd + 1) == '*')) { indd += 3; if (test_linked ()) { traite_voie (voiecur); /* Il y a des actions */ } } else { cmd_err (--indd); } cmd = 0; break; case ';': cmd = 0; break; case '\0': cmd = 0; prompt (pvoie->finf.flags, N_MBL); break; default: cmd = 0; --indd; if (defaut () == 0) { ++indd; if (appel_pg (com) == 0) error = 1; } break; } if (error) { cmd_err (com); } } } if (cmd) { pvoie->aut_linked = 0; } } void mbl_emul (void) { df ("mbl_emul", 0); switch (pvoie->niv2) { case N_MENU: menu_mbl (); break; case N_FORW: mbl_send (); break; case 1: mbl_list (); break; case 2: mbl_read (pvoie->recliste.l); break; case 3: break; case 4: mbl_kill (); break; case 5: wp_search (); break; case 6: mbl_read (pvoie->recliste.l); break; case 7: mbl_name (); break; case 8: mbl_dump (); break; case 9: mbl_tell (); break; case 11: mbl_edit (); break; case 13: duplex_tnc (); break; case 14: mbl_passwd (); break; case 16: mess_liste (1); break; case 17: exec_pg (); break; case 18: review (); break; case 19: #ifdef __WINDOWS__ end_win_edit (); #endif #ifdef __FBBDOS__ end_mini_edit (); #endif break; #ifdef __linux__ case 20: exec_cmd (NULL); break; #endif case 98: export_message (io_fich); break; case 99: import_message (io_fich); break; } ff (); } fbb-7.0.10/src/satdoc.c0000644000175000017500000003176313615603431011475 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. *********************************************************************/ /* A faire : traitement special pour le cas de satellites doubles comme RS-12 / RS-13 ayant le meme numero NASA*/ /* #define FRANCAIS */ #define ACCENTS #define VERSION "2.8.9" #ifdef __DOS__ #include #include #include #endif #ifdef __linux__ #include #include #include #include #include #endif /* #include #include #include #include #else #define strncasecmp strncmp */ #define strncasecmp strncmp #include #include #include #include #include #include #include #include #include #define LINE 256 #define TAILLE 256 /********** Prototypes **************/ int lecture(int fd2); int ecriture(int fd1); int repereANS(char *infos); int repereOBJ(char *buf2, char *buf3, char *infos); void cataloguer(FILE *fptr, int lignes, char *infos, char *buf2, short inverse); int lire_option(int argc, char *argv[]); void usage(void); /* SEMAPHORES & VARIABLES GLOBAUX */ int valable = 0; // ce drapeau indique que la 1re ligne est valable int info_satellite = 0; // drapeau chapitre info satellite int info_ans = 0; // drapeau BULLETIN ANS int info_frequence = 0; // drapeau FREQUENCE BALISE int info_generale = 0; // drapeau INFORMATIONS GENERALES par defaut /* structure & variables globales */ struct tm *cejour; // date et time declares dans TIME.H int bulletin_ANS; // nombre de bulletins trouvees int doc_satellites; // nombre de doc satellites traitees long lignes; // nombre de lignes parcourues char ans[TAILLE] = "\0"; // BID ANS $ char nom_objet[TAILLE] = "\0"; // Nom de l'objet char catalogue[TAILLE] = "\0"; // Nom de l'objet void usage() { #ifdef FRANCAIS printf("\nEmploi: SATDOC [-i] (voir documentation)\n"); #else printf("\nUsage: SATDOC [-i] (see doc file)\n"); #endif exit(1); } int lire_option(int argc, char *argv[]) { /* Lecture de l'option retourne -1 si erreur retourne 2 si normale retourne 1 si inverse */ char option[15]; char *opt; char val; if(argc > 1) { strcpy(option,argv[1]); opt=strstr(option,"-"); if(opt != NULL) { opt++; val=toupper(*opt); if(val == 'I') { if(argc == 3) return(2); if(argc == 2) return(-1); } } else return(1); } return(-1); } /* detection d'un bulletin AMSAT Weekly Satellite Report WSR*/ int repereANS(char *infos) { if ((strncasecmp(infos,"BID: $ANS-",10) == 0) || (strncasecmp(infos,"BID: $WSR-",10) == 0)) { info_ans = 1; strcpy(ans, infos); printf("\n%s\n",ans); bulletin_ANS++ ; return 1; } else return 0; } /* detection debut information OBJET NASA * * retourne 0 si non calage * retourne 1 si numéro d'objet présent * retourne -1 si "Catalog:" sans numéro */ int repereOBJ(char *buf2, char *buf3, char *infos) { int i, catalog; valable = 0; if ((strncasecmp(infos, "Catalog number:",15) == 0) ) { /* Controle renforce de la validite du numero d'objet [ Version 1.3 ] */ if (strlen (buf2) != 0) sscanf (buf3,"%[0-9]",buf2); /* Tous les caracteres du champ numerique de catalog number doivent etre des chiffres */ catalog = atoi(buf2); /* if (strlen(buf3) == strlen(buf2) && catalog != 0) { */ if (catalog == 0) valable = -1; else valable = 1; info_satellite = 1; sprintf(buf2,"%d", catalog); /* } */ } i = valable; return (i); } void cataloguer(FILE *fptr, int lignes, char *infos, char *buf2, short inverse) { FILE *fiche; char tampon[LINE]="\0"; // tampon pour chaine de caracteres char buffer[LINE]; char *nom; int fin, k; /* Option fichiers au nom des numeros de catalogues */ if (inverse == 1) strcpy(tampon,buf2); else { /* Option fichiers au nom des satellites */ strcpy(tampon,nom_objet); nom = strchr(tampon,(int)' '); if (nom != NULL) *nom = '\0'; if (tampon[7] == '-') tampon[7] = tampon[8]; if (strlen(tampon) > 8 ) tampon[8] = '\0'; nom = strchr(tampon,(int)'\r'); if (nom != NULL) *nom = '\0'; nom = strchr(tampon,(int)'\n'); if (nom != NULL) *nom = '\0'; } if (strncasecmp(tampon,"INTERNAT",8)== 0) strcpy(tampon,"ARISS"); strcat(tampon,".sat"); #ifdef FRANCAIS printf("Ecriture du fichier document : %s\n",tampon); #else printf("Creating document file : %s\n",tampon); #endif /* Ouvrir le fichier doc correspondant creation - ouverture nouveau fichier */ fiche = fopen(tampon,"wt+") ; if (fiche == NULL) { #ifdef FRANCAIS #ifdef __linux__ #ifdef ACCENTS printf("Erreur: impossible de créer le fichier :'%s' ",tampon); printf("à la ligne %d\n",lignes); #else printf("Erreur: impossible de créer le fichier :'%s' ",tampon); printf("a la ligne %d\n",lignes); #endif #endif #else printf("Error: unable to create file : '%s'\n",tampon); printf("on line %d\n",lignes); #endif exit(1); } /* incremente le nombre de fichiers documentaires crees */ doc_satellites++; /* on commence par ecrire la version de SATDOC et la date de mise jour dans le fichier DOC */ fwrite(ans, strlen(ans), 1, fiche); fprintf(fiche," - SATDOC version %s ",VERSION); #ifdef FRANCAIS fprintf(fiche," - %02d/%02d/%04d ",cejour->tm_mday, cejour->tm_mon +1, cejour->tm_year+1900); fprintf(fiche,"- %02u:%02u:%02u\n",cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #else fprintf(fiche," - %04d/%02d/%02d ",cejour->tm_year+1900, cejour->tm_mon +1,cejour->tm_mday); fprintf(fiche,"- %02u:%02u:%02u\n",cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #endif fwrite("\n", 1, 1, fiche); /* on recopie les deux premieres lignes */ /* nom de l'objet */ strcpy(tampon, nom_objet); fwrite(tampon, strlen(tampon), 1, fiche); /* ligne catalogue number */ strcpy(tampon, infos); strcat(tampon," "); strcat(tampon, buf2); fwrite(tampon, strlen(tampon), 1, fiche); fwrite("\n", 1, 1, fiche); /* lire jusqu'a la fin du paragraphe */ do { if (fgets(buffer, LINE, fptr) == NULL) { fin=1; break; } lignes++; /* sauvegarde pour memoire si ligne avec nom du satellite */ if ((k = sscanf(buffer, "%s \n", tampon) == 1)) fwrite(buffer, strlen(buffer), 1, fiche); } while ((strncasecmp(tampon,"NNNN",4) != 0) && (strncasecmp(tampon,"=====",5) != 0) && (strncasecmp(tampon,"/EX",3) != 0) && (strncasecmp(tampon,"[ANS",4) != 0)); /* while .... && 'strncasecmp(tampon,"-----",5) != 0 enlevé car utilisé parfois en interne */ /* if (strncasecmp(tampon,"/EX",3) == 0)*/ if ((strncasecmp(tampon,"/EX",3) == 0) || (strncasecmp(tampon,"NNNN",4) == 0)) info_ans = 0; /* fin de bulletin ANS */ info_satellite = 0; /* fin du paragraphe du satellite */ /* fermeture fichier documentaire satellite */ fclose(fiche); } int main (int argc, char *argv[]) { time_t temps; /* date et time */ int j, k, succes; short inverse; FILE *fptr; char buffer[LINE]; char infos[LINE]; char document[LINE]; char identification[LINE]="\0"; /* tampon pour ligne nom des satellites */ int fin; /* indicateur fin de fichier */ char buf1[LINE]="\0"; /* tampon pour lecture 1er mot cle */ char buf2[TAILLE]="\0"; /* tampon pour lecture 2eme mot cle */ char buf3[TAILLE]="\0"; /* tampon pour lecture numero catalogue */ /* recupere la date et l'heure systeme */ time(&temps); cejour = gmtime(&temps); #ifdef FRANCAIS #ifdef __linux__ #ifdef ACCENTS printf("\nProgramme DOCumentaire pour BBS F6FBB\n"); printf("à partir des fichiers bulletins AMSAT SATELLITE NEWS WSR\n"); printf("Version %s par f6bvp, Bernard Pidoux\n",VERSION); printf("10 octobre 2009 - f6bvp@amsat.org\n"); #else printf("\nProgramme DOCumentaires pour BBS F6FBB\n"); printf("à partir des fichiers bulletins AMSAT SATELLITE NEWS WSR\n"); printf("Version %s par f6bvp, Bernard Pidoux\n",VERSION); printf("10 octobre 2009 - f6bvp@amsat.org\n"); #endif #endif #else printf("\nSATellite DOCumentation program for F6FBB BBS\n"); printf("using WSR AMSAT SATELLITE NEWS bulletin files\n"); printf("Version %s by f6bvp, Bernard Pidoux\n",VERSION); printf("October 10, 2009 - f6bvp@amsat.org\n"); #endif inverse = lire_option(argc,argv); if (inverse == -1) usage(); /* #ifdef FRANCAIS printf("\n%02d/%02d/%04d ", cejour->tm_mday, cejour->tm_mon +1, cejour->tm_year+1900); printf("- %02u:%02u:%02u\n", cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #else printf("\n%04d/%02d/%02d ", cejour->tm_year+1900, cejour->tm_mon +1, cejour->tm_mday); printf("- %02u:%02u:%02u\n", cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #endif */ /* initialise les tampons */ *infos='\0'; *document='\0'; /* D'abord ouvrir le fichier message, puis le lire */ if (inverse == 2) strcpy(identification, argv[2]); if (inverse == 1) strcpy(identification, argv[1]); /* if (inverse == 0) exit(1); */ fptr = fopen(identification, "rt") ; /* Ouvrir le message recu */ if (fptr == NULL) { #ifdef FRANCAIS #ifdef __linux__ #ifdef ACCENTS printf("\nFichier '%s' non trouvé\n",identification); #else printf("\nFichier '%s' non trouvé\n",identification); #endif #endif #else printf("\nFile '%s' not found\n",identification); #endif exit(1); } /* Initialisation des drapeaux et compteurs... */ valable = 0; lignes = 0; succes = 0; bulletin_ANS = 0; doc_satellites = 0; /* Examiner le fichier message ligne par ligne */ do { info_satellite = 0; fin = 0; /* Aller au debut d'une ligne d'information */ do { if (fgets(buffer, LINE, fptr) == NULL) { fin = 1; } lignes++; /* sauvegarde pour memoire si ligne avec nom du satellite */ if (info_satellite == 0) strcpy (identification, buffer); buf1[0] = '\0'; buf2[0] = '\0'; buf3[0] = '\0'; k = sscanf (buffer, "%s %s %s\n", buf1, buf2, buf3); if (k == 0 || k == -1) break; else { if ((strlen(buf1) + strlen(buf2)) < TAILLE-1) { strcat(buf1," "); //strncat(buf1, buf2, strlen(buf2)); strncat(buf1, buf2, LINE - strlen(buf1) -1); } strcpy(infos, buf1); strcpy(document, buf3); /* recherche si fichier bulletin AMSAT Weekly Satellite Report WSR */ if (repereANS(infos) != 1) { /* Non : verification si fin d'un bulletin general ANS */ if (strncasecmp(infos,"[ANS",4) == 0) { info_ans = 0; info_satellite = 0; /* printf("C'est un bulletin ANS general\n"); */ } else /* verification si presence champ BID d'elements keps satellites */ if (strncasecmp(infos,"BID: ",5) == 0) { info_ans = 0; info_satellite = 0; /* printf("C'est un bulletin d'elements KEPS\n"); */ } else { /* se caler au debut d'une documentation satellite */ j = repereOBJ(buf2, buf3, infos); if (j == 0) { info_satellite = 0; /* si la ligne ne comporte pas de numero de catalogue alors sauvegarder 'identification' du satellite */ strcpy(nom_objet, identification); } else { /* c'est une ligne numero de catalogue */ info_satellite = 1; /* ecrire les deux lignes dans le fichier documentaire de l'objet * et la suite du fichier jusqu'a la ligne ===== */ if (info_ans == 1) { printf("\nSatellite : %s", nom_objet); /* ne pas écrire de fichier si option par numéro et numéro de catalogue absent */ if (!(inverse == 1 && j == -1)) cataloguer(fptr, lignes, infos, buf2, inverse); } } } } /* repereANS */ } /* else */ } while (!fin); /* do fgets */ } while (!feof(fptr)); /* fermeture fichier ANS */ fclose(fptr); #ifdef FRANCAIS printf("\n 6%d bulletins WSR lus\n", bulletin_ANS); #ifdef __linux__ #ifdef ACCENTS printf(" %6d fichier(s) documentaire(s) satellites créés\n", doc_satellites); printf(" %6d lignes traitées\n", lignes); #else printf(" %6d fichier(s) documentaire(s) satellites créés\n", doc_satellites); printf("%7ld lignes traitées\n", lignes); #endif #endif #else printf("\n %6d WSR bulletins read\n", bulletin_ANS); printf(" %6d satellite characteristics file(s) created\n", doc_satellites); printf("%7ld lines processed\n", lignes); #endif return succes; } /* Fin de main() */ fbb-7.0.10/src/init.c0000644000175000017500000005261213615603431011157 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * INIT.C * */ #include "serv.h" static void aff_heure (void); static void cree_tpstat (void); static int init_dir (void); static void init_tpstat (void); static void initarbre (void); static void initmessage (void); static void start_bbs (void); #ifdef __MSDOS__ static void init_bufscreen (Screen *); static void val_screen (void); #endif extern char _video[]; #ifdef __MSDOS__ void initialisations (void) { int bbs_init = 1; fprintf (stderr, "\nMSDOS defined init.c INITIALISATIONS\n"); while (!step_initialisations (bbs_init)) ++bbs_init; } #endif int step_initialisations (int niveau) { int i; #ifdef __WINDOWS__ unsigned long dMem; #endif InitText (""); /* fprintf (stderr, "FBB step_initialisations niveau:%d\n",niveau);*/ switch (niveau) { case 1: { /* Check endian */ long val = 1; moto = (*((char *)(&val)) == '\0'); } debug_ptr = NULL; operationnel = -1; h_ok = 1; MAXTACHE = MAXTASK; init_semaine (); #ifdef __WINDOWS__ /* Allocation du buffer partage ... */ dMem = GlobalDosAlloc (400ul); if (dMem == 0ul) { cprintf ("Can't allocate shared buffer\r\n"); exit (1); } BufSeg = HIWORD (dMem); BufSel = LOWORD (dMem); BufReel = (char far *) ((unsigned long) BufSel << 16); #endif sed = 1; EditorOff = TRUE; editor_request = 0; errno = 0; lastaff = -1; reply = 0; snd_io = 0; test_message = 2; h_screen = 25; bid_ptr = NULL; log_ptr = NULL; throute = NULL; tbroute = NULL; p_port = NULL; def_cur.nbmess = def_cur.nbnew = 0; def_cur.coord = 0xffff; memcpy (def_cur.indic, "NULL", 5); test_fichiers = 0; #ifdef __MSDOS__ ton_bip = 0; kam_timer = 0; #endif vlang = -1; time_bcl = 0; blank = 0; nb_hold = 0; ok_aff = 1; aut_ui = 1; doubl = 0; v_aff = -1; console = 0; editor = 0; cmd_fct = 0; print = 0; def_mask = 0; t_tell = -1; v_tell = 0; ch_fen = 0; inexport = 0; nb_error = 0; temp_sec = SECONDE; d_blanc = 0; include_size = 0; p_forward = 0; time_include = NULL; mem_alloue = 0L; t_bbs = 0L; t_appel = 0L; hour_time = -1; t_iliste.suiv = NULL; tete_fwd = NULL; tete_serv = NULL; tete_pg = NULL; bbs_ptr = NULL; p_port = NULL; *t_iliste.indic = '\0'; p_iliste = &t_iliste; NBVOIES = 1; for (i = 0; i < NBLIG; i++) af_voie[i] = -1; #ifdef __linux__ #ifdef ENGLISH cprintf ("Reading fbb.conf file\n"); #else cprintf ("Lecture du fichier fbb.conf\n"); #endif #else #ifdef ENGLISH cprintf ("Reading INIT.SRV\r\n"); #else cprintf ("Lecture de INIT.SRV\r\n"); #endif #endif init_voie (CONSOLE); /* Init console */ voiecur = CONSOLE; pvoie = svoie[voiecur]; if (!init_admin ()) return (0); if (!init_dir ()) return (0); port_log (0, 0, 'S', "I *** BBS Initialize"); deb_io (); operationnel = 0; window_connect (ALLCHAN); window_connect (CONSOLE); window_connect (MMONITOR); free_mem (); return 0; case 2: init_exms (); initexte (); aff_date (); free_mem (); ferme(ouvre_sat(), 0); return 0; case 3: init_tpstat (); free_mem (); #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("RS232 ports set-up \r\n"); #else cprintf ("Initialisation des ports RS232\r\n"); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("RS232 ports set-up \n"); #else cprintf ("Initialisation des ports RS232\n"); #endif #endif init_watchdog (watchport); initport (); return 0; case 4: initcom (); #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("TNC set-up \r\n"); #else cprintf ("Initialisation des TNC\r\n"); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("TNC set-up \n"); #else cprintf ("Initialisation des TNC\n"); #endif #endif inittnc (); return 0; case 5: affich_serveurs (2); affich_pg (2); t_label(); free_mem (); return 0; case 6: #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("BID set-up \r\n"); #else cprintf ("Initialisation des BID\r\n"); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("BID set-up \n"); #else cprintf ("Initialisation des BID\n"); #endif #endif cree_bid (); free_mem (); return 0; case 7: initarbre (); free_mem (); return 0; case 8: /* epure_messages() ; */ load_dirmes (); initmessage (); return 0; case 9: if (!init_white_pages ()) cree_routes (); else h_ok = 0; free_mem (); #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("Files set-up complete \r\n"); #else cprintf ("Fin des initialisations Fichiers\r\n"); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("Files set-up complete \n"); #else cprintf ("Fin des initialisations Fichiers\n"); #endif #endif return 0; case 10: fwd_file = NULL; fwd_size = 0; #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("FORWARD set-up \r\n"); #else cprintf ("Initialisation du forward\r\n"); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("FORWARD set-up \n"); #else cprintf ("Initialisation du forward\n"); #endif #endif init_buf_fwd (); init_buf_swap (); init_buf_rej (); return 0; case 11: init_bbs (); init_part (); free_mem (); read_heard (); init_etat (); tst_appel (); return 0; case 12: init_hold (); init_pfh(); load_themes (); #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("Set-up complete \r\n"); #else cprintf ("Fin des initialisations\r\n"); #endif #endif #ifdef __linux__ #ifdef ENGLISH cprintf ("Set-up complete \n"); #else cprintf ("Fin des initialisations\n"); #endif #endif vlang = 0; com_error = old_com_error = 0; aff_ind_console (); free_mem (); aff_date (); aff_heure (); fin_io (); canaff = v_aff; winlig = h_screen - 1 - M_LIG; #ifdef TRACE open_trace (); #endif if (*BBS_UP) { char *pptr = BBS_UP; #ifdef __linux__ call_nbdos (&pptr, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #else call_nbdos (&pptr, 1, NO_REPORT_MODE, NULL, NULL, NULL); #endif } start_bbs (); return 1; } return 1; } static void start_bbs (void) { int port = 1; char buffer[300]; int nb; df ("io", 0); deb_io (); voiecur = 1; type_sortie = 1; save_fic = 0; aff_date (); operationnel = 1; env_date (); for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { switch (p_port[port].typort) { case TYP_DED: sprintf (buffer, "H 18"); tnc_commande (port, buffer, PORTCMD); sprintf (buffer, "H 1"); tnc_commande (port, buffer, PORTCMD); sprintf (buffer, "H 2"); tnc_commande (port, buffer, PORTCMD); /* Ajouter la validation des ports */ break; case TYP_PK: break; } } } for (nb = 1; nb < NBVOIES; nb++) { programm_indic (nb); set_bs(nb, TRUE); } test_disque (); sprintf (buffer, "A *** BBS Online (%s)", version()); port_log (0, 0, 'S', buffer); /* port_log (0, 0, 'S', "A *** BBS Online");*/ fin_io (); start_tasks (); mem_alloue = 0L; free_mem (); dde_wp_serv = 1; /* Amorce les TNCs en mode DED */ for (nb = 0; nb < NBPORT; nb++) { int i; /* positionnel le mult_sel au 1er multi dans chaque COM */ for (i = 0; i < 8; i++) { if (p_com[nb].multi[i]) { int port = p_com[nb].multi[i]; p_com[nb].mult_sel = port; break; } } } ff (); } static int dir_found (char *dir) { int nb; char path[256]; char str[256]; strcpy (path, dir); nb = strlen (path); if ((nb > 1) && (path[1] == ':')) { if ((nb > 3) && (path[nb - 1] == '\\')) path[nb - 1] = '\0'; } else { if ((nb > 1) && (path[nb - 1] == '\\')) path[nb - 1] = '\0'; } if (!is_dir (path)) { sprintf (str, "Directory %s not found", back2slash (path)); ShowError ("FBB TREE", str, 0); fbb_quit (0); WinSleep (10); return (0); } return (1); } static int init_dir (void) { /* Cree l'arbre des repertoires */ int i; char dir[128]; /* Arborescence MAIL */ if (!dir_found (MESSDIR)) return (0); for (i = 0; i < 10; i++) { sprintf (dir, "%smail%d", MESSDIR, i); if (!dir_found (dir)) return (0); } /* Arborescence BINMAIL */ if (!dir_found (MBINDIR)) return (0); for (i = 0; i < 10; i++) { sprintf (dir, "%smail%d", MBINDIR, i); if (!dir_found (dir)) return (0); } /* Repertoire WP */ sprintf (dir, "%swp", DATADIR); if (!dir_found (dir)) return (0); /* Repertoire DOCS */ if (!dir_found (DOCSDIR)) return (0); /* Repertoires DOS */ for (i = 1; i < 8; i++) { if (*PATH[i]) if (!dir_found (PATH[i])) return (0); } /* Repertoire YAPP */ if (!dir_found (YAPPDIR)) return (0); /* Repertoire PG */ /* if (!dir_found (PGDIR)) return (0); */ return (1); } void init_semaine (void) { long temps = time (NULL); struct tm *sdate = localtime (&temps); int ny = sdate->tm_yday; /* Numero du jour dans l'annee */ int nw = sdate->tm_wday; /* Numero du jour dans la semaine */ /* if (nw == 0) nw = 6; else --nw; */ /* 0 = dimanche -> 0 = lundi */ if (ny < nw) /* Premiere semaine de l'annee ? */ { temps -= (3600L * 24L * (ny + 1)); sdate = localtime (&temps); ny = sdate->tm_yday; /* Numero du jour de l'annee precedente */ nw = sdate->tm_wday; /* Numero du jour de la semaine avant */ /* if (nw == 0) nw = 6; else --nw; */ /* 0 = dimanche -> 0 = lundi */ } num_semaine = (7 - nw + ny) / 7; } void start_tasks (void) { trait_time = 0; #ifdef ENGLISH cprintf ("Starting multitasking ..."); #else cprintf ("D‚marre le multitƒches..."); #endif #ifdef __MSDOS__ init_keyboard (); #endif #ifdef __linux__ cprintf (" ok\n"); #else cprintf (" ok\r\n"); #endif } void end_voies (void) { int i; /* Inclut la voie Warnings (NBVOIES+1) */ for (i = 0; i < NBVOIES + 1; i++) { if (svoie[i]) m_libere (svoie[i], sizeof (Svoie)); } } void init_voie (int voie) { int i; Svoie *vptr; svoie[voie] = vptr = (Svoie *) m_alloue (sizeof (Svoie)); time_yapp[voie] = -1; vptr->timout = time_n; init_timout (voie); vptr->msg_held = 0; vptr->rzsz_pid = -1; vptr->temp1 = vptr->mess_recu = 1; vptr->fbb = bin_fwd; /* vptr->wp = */ vptr->clock = '\0'; vptr->ret = 0; vptr->sid = vptr->aut_nc = vptr->ind_mess = vptr->warning = 0; vptr->ask = vptr->seq = vptr->dde_int = vptr->stop = 0; vptr->mbl = vptr->sta.stat = vptr->sta.connect = vptr->deconnect = 0; vptr->sta.mem = 32000; vptr->sr_mem = vptr->memoc = vptr->nb_err = 0; vptr->niv1 = vptr->niv2 = vptr->niv3 = 0; vptr->maj_ok = vptr->conf = vptr->dde_marche = 0; vptr->groupe = vptr->kiss = vptr->ch_mon = vptr->cross_connect = -1; vptr->cur_bull = -1L; vptr->localmode = vptr->binary = vptr->sta.ret = vptr->sta.ack = 0; vptr->type_yapp = 0; vptr->maxbuf = 8; vptr->emis = NULL; vptr->ctnc = NULL; vptr->outptr = NULL; vptr->msgtete = NULL; vptr->l_mess = vptr->l_yapp = vptr->entmes.numero = 0L; vptr->inbuf.nblig = vptr->inbuf.nbcar = vptr->inbuf.nocar = 0; vptr->inbuf.tete = NULL; vptr->inbuf.curr = NULL; vptr->inbuf.ptr = NULL; vptr->curfwd = NULL; vptr->t_read = NULL; vptr->t_list = NULL; vptr->llabel = NULL; vptr->r_tete = NULL; vptr->ncur = &def_cur; vptr->mbl_ext = 1; vptr->nb_egal = 0; vptr->nb_prompt = 0; vptr->prot_fwd = prot_fwd; vptr->tete_edit.liste = NULL; vptr->entmes.bid[0] = '\0'; vptr->sta.callsign.call[0] = '\0'; vptr->sta.callsign.num = 0; vptr->sta.indicatif.call[0] = '\0'; vptr->sta.indicatif.num = 0; for (i = 0; i < 8; i++) { vptr->sta.relais[i].call[0] = '\0'; vptr->sta.relais[i].num = 0; } init_fb_mess (voie); } static void aff_heure (void) { struct tm *sdate; long temps = time (NULL); sdate = gmtime (&temps); cprintf ("GMT %02d:%02d", sdate->tm_hour, sdate->tm_min); sdate = localtime (&temps); #ifdef __linux__ cprintf (" - LOCAL %02d:%02d\n", sdate->tm_hour, sdate->tm_min); #else cprintf (" - LOCAL %02d:%02d\r\n", sdate->tm_hour, sdate->tm_min); #endif } void lit_appel (void) { FILE *fptr; sed = 1; fptr = fopen (d_disque ("OPTIONS.SYS"), "rb"); if (fptr) { fread (&bip, sizeof (short), 1, fptr); fread (&ok_tell, sizeof (short), 1, fptr); fread (&ok_aff, sizeof (short), 1, fptr); fread (&separe, sizeof (short), 1, fptr); fread (&doub_fen, sizeof (short), 1, fptr); fread (&gate, sizeof (short), 1, fptr); fread (&just, sizeof (short), 1, fptr); fread (&p_forward, sizeof (short), 1, fptr); fread (&sed, sizeof (short), 1, fptr); fread (&aff_inexport, sizeof (short), 1, fptr); fread (&aff_popsmtp, sizeof (short), 1, fptr); fclose (fptr); } if (separe < M_LIG + 5) separe = M_LIG + 5; if (separe > h_screen - 4) separe = h_screen - 4; /* printf("%d %d %d %d %d\n", bip, ok_tell, ok_aff, separe, doub_fen) ; */ #if defined(__WINDOWS__) || defined(__linux__) maj_menu_options (); #endif } void cree_dir (int erreur) { bullist lbul; FILE *fptr; if ((fptr = fopen (d_disque ("DIRMES.SYS"), "wb")) == NULL) { fbb_error (ERR_CREATE, d_disque ("DIRMES.SYS"), erreur); } lbul.type = '\0'; lbul.numero = 100L; fwrite (&lbul, sizeof (bullist), 1, fptr); fclose (fptr); } void cree_info (void) { FILE *fptr; if ((fptr = fopen (d_disque ("INF.SYS"), "wb")) == NULL) { fbb_error (ERR_CREATE, d_disque ("INF.SYS"), 0); } fclose (fptr); } void cree_stat (void) { FILE *fptr; if ((fptr = fopen (d_disque ("statis.dat"), "wb")) == NULL) { fbb_error (ERR_CREATE, d_disque ("statis.dat"), 0); } fclose (fptr); } void cree_sat (void) { FILE *fptr; if ((fptr = fopen (d_disque ("SAT\\SATEL.DAT"), "wb")) == NULL) { fbb_error (ERR_CREATE, d_disque ("SAT\\SATEL.DAT"), 0); } fclose (fptr); } static void cree_tpstat (void) { int i; FILE *fichier; if ((fichier = fopen (d_disque ("TPSTAT.SYS"), "wb")) == NULL) { fbb_error (ERR_CREATE, d_disque ("TPSTAT.SYS"), 0); } for (i = 0; i < NBRUB; i++) stemps[i] = 0L; fwrite ((char *) stemps, sizeof (*stemps) * NBRUB, 1, fichier); fclose (fichier); } int err_ouvert (char *nomfic) { int c; char s[80]; deb_io (); #ifdef __linux__ #ifdef ENGLISH cprintf ("Cannot open %s \n", nomfic); #else cprintf ("Erreur ouverture %s\n", nomfic); #endif #else #ifdef ENGLISH cprintf ("Cannot open %s \r\n", nomfic); #else cprintf ("Erreur ouverture %s\r\n", nomfic); #endif #endif c = 0; #ifdef ENGLISH sprintf (s, "Creating file %s ", nomfic); #else sprintf (s, "Creation du fichier %s", nomfic); #endif if (sel_option (s, &c)) { #ifdef __linux__ #ifdef ENGLISH cprintf ("\rCreating file %s \n", nomfic); #else cprintf ("\rCreation du fichier %s\n", nomfic); #endif #else #ifdef ENGLISH cprintf ("\rCreating file %s \r\n", nomfic); #else cprintf ("\rCreation du fichier %s\r\n", nomfic); #endif #endif } fin_io (); return (c); } static void init_tpstat (void) { FILE *fichier; fichier = ouvre_stats (); fclose (fichier); while (TRUE) { if ((fichier = fopen (d_disque ("TPSTAT.SYS"), "r+b")) == NULL) { if (err_ouvert ("TPSTAT.SYS")) cree_tpstat (); else fbb_error (ERR_CREATE, d_disque ("TPSTAT.SYS"), 0); } else break; } fread ((char *) stemps, sizeof (*stemps) * NBRUB, 1, fichier); fclose (fichier); } static void initarbre (void) { int offset; int i = 0; info buf2; char buf[40]; FILE *fptr; bloc_indic *bptr; #ifdef __linux__ #ifdef ENGLISH cprintf ("Callsign set-up \n"); #else cprintf ("Initialisation de la nomenclature\n"); #endif #else #ifdef ENGLISH cprintf ("Callsign set-up \r\n"); #else cprintf ("Initialisation de la nomenclature\r\n"); #endif #endif deb_io (); #ifdef __linux__ #ifdef ENGLISH cprintf ("Callsigns set-up \n"); #else cprintf ("Initialisation des indicatifs\n"); #endif #else #ifdef ENGLISH cprintf ("Callsigns set-up \r\n"); #else cprintf ("Initialisation des indicatifs\r\n"); #endif #endif rinfo = 0; racine = bptr = new_bloc_info (); offset = 0; strcpy (bptr->st_ind[0].indic, "TOUS"); bptr->st_ind[0].nbmess = (short) 0; bptr->st_ind[0].nbnew = (short) 0; bptr->st_ind[0].coord = 0xffff; ++offset; fptr = ouvre_nomenc (); *buf2.indic.call = '\0'; while (fread ((char *) &buf2, (int) sizeof (buf2), 1, fptr)) { if (find (buf2.indic.call)) { if (offset == T_BLOC_INFO) { bptr->suiv = new_bloc_info (); bptr = bptr->suiv; offset = 0; } #ifdef __linux__ if ((i++ % 50) == 0) { InitText (itoa (i, buf, 10)); } #endif #ifdef __WINDOWS__ if ((i++ % 50) == 0) { InitText (itoa (i, buf, 10)); } #endif #ifdef __MSDOS__ if (tempo == 0) { cprintf ("%-6s\r\n", buf2.indic.call); tempo = CADENCE; } #endif inscoord (rinfo, &buf2, &(bptr->st_ind[offset])); ++offset; } ++rinfo; } #ifdef __WINDOWS__ InitText (itoa (i, buf, 10)); #else #ifdef __linux__ cprintf ("%-6s\n", buf2.indic.call); #else cprintf ("%-6s\r\n", buf2.indic.call); #endif #endif ferme (fptr, 4); fin_io (); } void fwd_cpy (recfwd * dest, bullist * orig) { int i; dest->type = orig->type; dest->bin = orig->bin; dest->kb = (unsigned char) ((orig->taille + 500) / 1000); dest->date = orig->date; dest->nomess = orig->numero; for (i = 0; i < NBMASK; i++) dest->fbbs[i] = orig->fbbs[i]; strncpy (dest->bbsv, bbs_via (orig->bbsv), 6); } lfwd *cree_bloc_fwd (lfwd * ptr) { int i; if (ptr) { ptr->suite = (lfwd *) m_alloue (sizeof (lfwd)); ptr = ptr->suite; } else ptr = (lfwd *) m_alloue (sizeof (lfwd)); ptr->suite = NULL; for (i = 0; i < NBFWD; i++) ptr->fwd[i].type = '\0'; return (ptr); } int fwd_mask (char *masque) { int i; for (i = 0; i < NBMASK; i++) if (*masque++) return (1); return (0); } bloc_mess *new_bloc_mess (void) { int i; bloc_mess *bptr = (bloc_mess *) m_alloue (sizeof (bloc_mess)); bptr->suiv = NULL; for (i = 0; i < T_BLOC_MESS; i++) { bptr->st_mess[i].noenr = 0; bptr->st_mess[i].nmess = 0L; bptr->st_mess[i].no_indic = 0; } return (bptr); } void end_messages (void) { bloc_mess *bptr; lfwd *ptr_fwd; /* Libere la liste des forwards */ while (tete_fwd) { ptr_fwd = tete_fwd; tete_fwd = tete_fwd->suite; m_libere (ptr_fwd, sizeof (lfwd)); } /* Libere la liste des messages */ while (tete_dir) { bptr = tete_dir; tete_dir = tete_dir->suiv; m_libere (bptr, sizeof (bloc_mess)); } } static void initmessage (void) { char buf[40]; bloc_mess *bptr; unsigned no_indic; unsigned offset = 0; bullist bufdir; unsigned rmess = 0; char stat; int pos, nbfwd; int i = 0; lfwd *ptr_fwd; pos = nbfwd = 0; ptr_fwd = tete_fwd = cree_bloc_fwd (NULL); #ifdef __linux__ #ifdef ENGLISH cprintf ("Message set-up \n"); #else cprintf ("Initialisation des messages\n"); #endif #else #ifdef ENGLISH cprintf ("Message set-up \r\n"); #else cprintf ("Initialisation des messages\r\n"); #endif #endif deb_io (); nbmess = 0; ouvre_dir (); read_dir (rmess++, &bufdir); nomess = bufdir.numero; #ifdef __linux__ #ifdef ENGLISH cprintf ("Next message %ld \n", nomess + 1); #else cprintf ("Prochain message %ld\n", nomess + 1); #endif #else #ifdef ENGLISH cprintf ("Next message %ld \r\n", nomess + 1,); #else cprintf ("Prochain message %ld\r\n", nomess + 1); #endif #endif bptr = tete_dir = new_bloc_mess (); while (read_dir (rmess, &bufdir)) { if (bufdir.type) { #ifdef __linux__ if ((i++ % 50) == 0) { InitText (itoa (i, buf, 10)); } #endif #ifdef __WINDOWS__ if ((i++ % 50) == 0) { InitText (itoa (i, buf, 10)); } #endif #ifdef __MSDOS__ if (tempo == 0) { cprintf ("%ld %-6s %d\r\n", bufdir.numero, bufdir.exped, nbfwd); tempo = CADENCE; } #endif if (offset == T_BLOC_MESS) { bptr->suiv = new_bloc_mess (); bptr = bptr->suiv; offset = 0; } no_indic = insarbre (&bufdir); bptr->st_mess[offset].nmess = bufdir.numero; bptr->st_mess[offset].noenr = rmess; bptr->st_mess[offset].no_indic = no_indic; stat = bufdir.status; if ((stat != 'A') && (stat != 'K')) { ++nbmess; if ((stat != 'F') && (stat != 'X') && (stat != 'H')) { if ((bufdir.numero) && (fwd_mask (bufdir.fbbs))) { if (pos == NBFWD) { pos = 0; ptr_fwd = cree_bloc_fwd (ptr_fwd); } fwd_cpy (&ptr_fwd->fwd[pos], &bufdir); ++pos; ++nbfwd; } } else if (stat == 'H') ++nb_hold; } ins_iliste (&bufdir); ++offset; } ++rmess; } #ifdef __WINDOWS__ InitText (itoa (i, buf, 10)); #else #ifdef __linux__ if (bufdir.type) { cprintf ("%ld %-6s %d\n", bufdir.numero, bufdir.exped, nbfwd); } #else if (bufdir.type) { cprintf ("%ld %-6s %d\r\n", bufdir.numero, bufdir.exped, nbfwd); } #endif #endif ferme_dir (); fin_io (); #ifdef __linux__ #ifdef ENGLISH cprintf ("End - %d forward(s)\n", nbfwd); #else cprintf ("Fin - %d forward(s)\n", nbfwd); #endif #else #ifdef ENGLISH cprintf ("End - %d forward(s)\r\n", nbfwd); #else cprintf ("Fin - %d forward(s)\r\n", nbfwd); #endif #endif } fbb-7.0.10/src/drv_ded.c0000644000175000017500000004766513613360505011637 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #include static int ded_end_host (int); static int ded_send_data (int, int, char *, int); static int ded_send_dt (int, int, char *, int); static int ded_send_ui (int, char *, int, Beacon *); static int ded_sndcmd (int, int, char *, int); static int nb_waiting (int); static int recv_ded (int, int, int *, char *); static void ded_get_ui (int, char *, ui_header *); static void ded_sonde (int, int); static void send_ded (int, int, char, char *); /* * Fonctions g‚n‚riques du driver */ int rcv_ded (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { int lgbuf=0; int can = p_port[*port].cur_can & 0xff; int code; int valid; int next = 1; /* Header provisoire */ static ui_header loc_ui[NBPORT]; *cmd = INVCMD; /* Test si c'est le port correspondant au MUX ... */ if ((operationnel) && (*port != p_com[(int)p_port[*port].ccom].mult_sel)) return (-1); if (p_port[*port].polling == 0) { ded_sonde (*port, next); return (0); } valid = 0; deb_io (); code = recv_ded (*port, can, &lgbuf, buffer); fin_io (); switch (code) { case 0: *cmd = NOCMD; *len = 0; p_port[*port].polling = 0; if (p_port[*port].last_cmde == 'G') { p_port[*port].wait[can] = 0; } break; case 1: switch (p_port[*port].last_cmde) { case 'L': { /* Retour de statistiques */ stat_ch sta; int nbmes, nbtra, nbatt, nback, nbret, con; valid = 2; *cmd = STATS; *canal = can; *len = 0; sscanf (buffer, "%d%d%d%d%d%d", &nbmes, &nbtra, &nbatt, &nback, &nbret, &con); memset (&sta, 0, sizeof (sta)); sta.stat = con; sta.ret = nbret; p_port[*port].wait[can] = nbmes + nbtra; sta.ack = nbatt + nback + nb_waiting (*port); memcpy (buffer, &sta, sizeof (sta)); if (p_port[*port].wait[can]) next = 0; } break; case 'B': { valid = 2; *cmd = NBBUF; *len = 0; *((int *) buffer) = atoi (buffer); break; } default: valid = 2; *len = lgbuf; *cmd = ECHOCMD; break; } p_port[*port].polling = 0; break; case 2: valid = 2; *len = lgbuf; *cmd = ERRCMD; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 3: valid = 2; *cmd = COMMAND; *canal = can; *len = lgbuf; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 4: ded_get_ui (*port, buffer, ui); valid = 1; *cmd = UNPROTO; *canal = can; *len = 0; p_port[*port].idem = 1; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 5: ded_get_ui (*port, buffer, ui); /* Sauvegarde l'UI */ loc_ui[*port] = *ui; valid = 0; next = 0; p_port[*port].polling = 0; break; case 6: /* Recupere l'UI du coup precedant */ *ui = loc_ui[*port]; sprintf (ui->txt, " (%d)", lgbuf); valid = 1; *cmd = UNPROTO; *canal = can; *len = lgbuf; p_port[*port].idem = 1; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 7: valid = 1; *cmd = DATA; *canal = can; *len = lgbuf; p_port[*port].idem = 1; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; } /* Poll du TNC pour la prochaine fois */ if (code != -1) { if (p_port[*port].wait[can]) next = 0; ded_sonde (*port, next); } return (valid); } int opn_ded (int port, int nb) { long bt; int reset = 4; int nb_can; int i; int ok; char s[80]; selcanal (port); while (reset) { ok = 0; sprintf (s, "Init PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif if (p_port[port].moport & 0x80) { sprintf (s, "Init PORT %d COM%d-%d PTCII", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif tncstr (port, "\r", 0); sleep_ (10); tncstr (port, "PTC 31\r", 0); } else { tncstr (port, "\030\033JHOST\r\033MN\r", 0); } bt = btime () + 20; do { if (rec_tnc (port) < 0) { ok = 1; break; } } while (btime () < bt); if (ok == 1) break; #ifdef ENGLISH cprintf ("Reset sent ... Please wait. \r\n"); #else cprintf ("Reset envoy‚... Patientez S.V.P.\r\n"); #endif sprintf (s, "Resync PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif ded_end_host (port); --reset; } sprintf (s, "Clear PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif tncstr (port, "\033JHOST1\r", 0); sprintf (s, "Prog PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); vide (port, 1); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif /* Parametres par defaut */ sprintf (s, "I %s-%d", mycall, myssid); ded_sndcmd (port, 0, (char *) s, 1); ded_sndcmd (port, 0, (char *) s, 1); if (DRSI (port)) { nb_can = 0; for (i = 1; i < NBPORT; i++) { if (p_port[i].ccom == p_port[port].ccom) { nb_can += p_port[i].nb_voies; } } } else { nb_can = p_port[port].nb_voies; } sprintf (s, "Y %d", nb_can); ded_sndcmd (port, 0, (char *) s, 1); if (!DRSI (port)) { sprintf (s, "O %d", p_port[port].frame); ded_sndcmd (port, 0, (char *) s, 1); } return (ok); } int cls_ded (int port) { /* Vide la file des commandes en attente */ selcanal (port); while (p_port[port].cmd) { PortData *cmd = p_port[port].cmd; p_port[port].cur_can = cmd->canal; switch (cmd->cmd) { case COMMAND: send_ded (port, (int) cmd->canal, 1, cmd->buf); break; default: break; } p_port[port].cmd = cmd->next; m_libere (cmd, sizeof (PortData)); p_port[port].last_cmde = '\0'; } /* Fin du mode host */ ded_end_host (port); return (1); } int sta_ded (int port, int canal, int cmd, void *ptr) { switch (cmd) { case TOR: return (ded_sndcmd (port, canal, (char *) ptr, 0) != -1); case SNDCMD: return (ded_sndcmd (port, canal, (char *) ptr, 0) != -1); case ECHOCMD: return (ded_sndcmd (port, canal, (char *) ptr, 1) != -1); case PORTCMD: return (ded_sndcmd (port, 0, (char *) ptr, 1) != -1); case PACLEN: *((int *) ptr) = 250; return (1); } return (0); } int snd_ded (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ret = 0; df ("snd_ded", 8); if (p_port[port].synchro > 256) return (0); switch (cmd) { case COMMAND: break; case DATA: ret = ded_send_dt (port, canal, buffer, len); break; case UNPROTO: ret = ded_send_ui (port, buffer, len, ptr); break; } ff (); return (ret); } /* Fonctions locales */ static int ded_end_host (int port) { static char *mn = "MN"; static char *jhost0 = "JHOST0"; char *ptr; int nb; long bt; int retry = 4; while (retry) { /* Envoie le MN (pas de monitoring) */ send_tnc (port, 0); send_tnc (port, 1); send_tnc (port, strlen (mn) - 1); ptr = mn; while (*ptr) send_tnc (port, *ptr++); bt = btime () + 20; /* Verifie la reception de la reponse */ do { if (rec_tnc (port) >= 0) { /* Envoie le JHOST0 */ send_tnc (port, 0); send_tnc (port, 1); send_tnc (port, strlen (jhost0) - 1); ptr = jhost0; while (*ptr) send_tnc (port, *ptr++); return (1); } } while (btime () < bt); /* Rien recu, on passe en resynchro */ for (nb = 0; nb < 256; nb++) { send_tnc (port, 1); bt = btime () + 5; #if defined(__WINDOWS__) || defined(__linux__) DisplayResync (port, nb + 1); #endif while (btime () < bt); if (rec_tnc (port) >= 0) { #if defined(__WINDOWS__) || defined(__linux__) DisplayResync (port, 0); #else ++com_error; aff_date (); #endif break; } } /* La resynchro n'a rien donne ... On jette l'eponge ! */ if (nb == 256) return (0); vide (port, 0); --retry; } return (0); } static void warning (unsigned numero, char *texte) { } static void ded_sonde (int pp, int next) { static int cptr[NBPORT]; static int first = 1; if ((pp < 0) || (pp >= NBPORT)) return; if (first) { /* Initializes static variables */ int i; for (i = 0; i < NBPORT; i++) { cptr[i] = 0; } first = 0; } if (p_port[pp].cur_can == 0xff) p_port[pp].cur_can = 0; if (p_port[pp].polling) { return; } if (next == 0) { send_ded (pp, p_port[pp].cur_can, 1, "G"); p_port[pp].last_cmde = 'G'; } else if (p_port[pp].cmd) { PortData *cmd = p_port[pp].cmd; p_port[pp].cur_can = cmd->canal; switch (cmd->cmd) { case COMMAND: send_ded (pp, (int) cmd->canal, 1, cmd->buf); break; case DATA: case UNPROTO: ded_send_data (pp, cmd->canal, cmd->buf, cmd->len); cptr[pp] = 0; break; default: break; } p_port[pp].cmd = cmd->next; m_libere (cmd, sizeof (PortData)); p_port[pp].last_cmde = '\0'; } else if (operationnel == 1) { if (cptr[pp] == 0) { send_ded (pp, p_port[pp].cur_can, 1, "@B"); p_port[pp].last_cmde = 'B'; cptr[pp] = 50; } else { /* Passe au canal suivant */ if (p_port[pp].idem == 0) { ++(p_port[pp].cur_can); if (p_port[pp].cur_can > p_port[pp].tt_can) { int mux_ch; int i; int com; int first_mux; int last_mux; /* Passe eventuellement au PORT/MUX suivant */ mux_ch = p_port[pp].ccanal; com = p_port[pp].ccom; first_mux = (DRSI (pp)) ? 0 : 1; last_mux = (DRSI (pp)) ? 7 : 4; for (i = first_mux; i < last_mux; i++) { ++mux_ch; if (mux_ch > last_mux) mux_ch = first_mux; if (p_com[com].multi[mux_ch]) { pp = p_com[com].multi[mux_ch]; p_com[com].mult_sel = pp; break; } } p_port[pp].cur_can = 0; if (DRSI (pp)) { /* Fait la somme des canaux deja balayes (1 seul TNC !!) */ for (i = 1; i < pp; i++) { if (DRSI (i)) p_port[pp].cur_can += p_port[i].nb_voies; } } selcanal (pp); } } else p_port[pp].idem = 0; send_ded (pp, p_port[pp].cur_can, 1, "L"); p_port[pp].last_cmde = 'L'; if (cptr[pp]) --cptr[pp]; } } p_port[pp].polling = 1; p_com[(int)p_port[pp].ccom].delai = 0; } /* int rcv_ded(int *port, int *canal, int *cmd, char *buffer, int *len, ui_header *ptr) { int val; df("snd_ded", 12); val = ded_inbuf(port, canal, cmd, buffer, len, ptr); ff(); return(val); } */ /* * Fonctions locales */ static int ded_sndcmd (int port, int canal, char *buffer, int retour) { PortData *cmd = p_port[port].cmd; if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else cmd = p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->next = NULL; cmd->canal = canal; cmd->cmd = COMMAND; strcpy (cmd->buf, buffer); return (1); } static int ded_send_dt (int port, int canal, char *buffer, int len) { PortData *cmd = p_port[port].cmd; if (len <= 0) return (0); if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else cmd = p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->next = NULL; cmd->canal = canal; cmd->cmd = DATA; cmd->len = len > 256 ? 256 : len; memcpy (cmd->buf, buffer, cmd->len); return (1); } static int ded_send_ui (int port, char *buffer, int len, Beacon * beacon) { char commande[300]; char s[80]; int i; int via = 1; PortData *cmd = p_port[port].cmd; if (DRSI (port)) { sprintf (commande, "C %d:%s-%d", p_port[port].ccanal, beacon->desti.call, beacon->desti.num); } else { sprintf (commande, "C %s-%d", beacon->desti.call, beacon->desti.num); } for (i = 0; i < 8; i++) { if (*beacon->digi[i].call) { if (via) { strcat (commande, " VIA "); via = 0; } else { strcat (commande, ","); } sprintf (s, "%s-%d", beacon->digi[i].call, beacon->digi[i].num); strcat (commande, s); } } if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else cmd = p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->canal = 0; cmd->cmd = COMMAND; cmd->len = 0; strcpy (cmd->buf, commande); cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; cmd->next = NULL; cmd->canal = 0; cmd->cmd = UNPROTO; cmd->len = len > 256 ? 256 : len; memcpy (cmd->buf, buffer, cmd->len); return (1); } static int ded_send_data (int port, int canal, char *buffer, int len) { int i; if (p_port[port].synchro > 256) return (1); selcanal (port); send_tnc (port, canal); send_tnc (port, 0); send_tnc (port, len - 1); for (i = 0; i < len; i++) send_tnc (port, *buffer++); return (1); } static void send_ded (int port, int canal, char type, char *chaine) { if (p_port[port].synchro > 256) return; if (strcmp (chaine, "%O") == 0) sleep_ (1); /* type = 0 : texte. type = 1 : commande */ selcanal (port); send_tnc (port, canal); send_tnc (port, type); send_tnc (port, strlen (chaine) - 1); while (*chaine) send_tnc (port, *chaine++); ff (); } static void resync_port (int port) { long nt = btime (); static int first = 1; static long delai[NBPORT]; if ((port < 0) || (port >= NBPORT)) return; if (first) { /* Initializes static variables */ int i; for (i = 0; i < NBPORT; i++) { delai[i] = 0L; } first = 0; } if ((p_port[port].synchro < 256) && (delai[port] < nt)) { ++p_port[port].synchro; p_port[port].cur_can = 1; send_tnc (port, '\001'); delai[port] = nt + 4L; #if defined(__WINDOWS__) || defined(__linux__) DisplayResync (port, p_port[port].synchro); #else { char s[40]; sprintf (s, "Port %d Resync %-4d", port, p_port[port].synchro); aff_chaine (W_DEFL, 1, 1, s); } #endif } if (p_port[port].synchro == 256) { char txt[80]; sprintf (txt, "Port %d was not resynchronized. Stopped. Error =", port); warning (4, txt); ++p_port[port].synchro; } } static int recv_ded (int port, int canal, int *lgbuf, char *buffer) { int r_canal, code = 0, nb, lg; int c; /* Implementation polling */ int valid = 0; char *ptr = p_port[port].portbuf; int index = p_port[port].portind; while ((c = rec_tnc (port)) >= 0) { if (index == 300) { /* Erreur : Vider le buffer et resynchroniser ? */ vide (port, 0); index = 0; break; } /* Ajoute les caracteres dans le buffer */ ptr[index++] = c; } p_port[port].portind = index; /* Tester si la trame est complete */ if (index >= 2) { /* La trame doit faire au moins 2 octets : canal et code */ /* On tente le decodage ... */ r_canal = *ptr++; code = *ptr++; index -= 2; *lgbuf = 0; if (canal == 0xff) canal = r_canal; if ((r_canal != canal) && (p_port[port].synchro == 0)) { if ((!svoie[CONSOLE]->sta.connect) && (p_port[port].synchro == 0)) { char txt[80]; #ifdef ENGLISH sprintf (txt, "Receive : Error channel number: sent %d - received %d - Error =", canal, r_canal); #else sprintf (txt, "Recoit : Erreur Numero de canal: envoye %d - recu %d - Erreur =", canal, r_canal); #endif warning (1, txt); } if (nb_error++ == 10) fbb_error (ERR_TNC, "DED RCV DATA", port); vide (port, 0); return (-1); } lg = 0; switch (code) { case 0: *buffer = '\0'; valid = 1; break; case 1: case 2: case 3: case 4: case 5: while (index) { *buffer = *ptr++; ++lg; --index; /* Le caractere doit etre un NULL pour finir le paquet */ if ((index == 0) && (*buffer == '\0')) { valid = 1; *buffer = '\n'; *++buffer = '\0'; } ++buffer; } break; case 6: case 7: nb = lg = 1 + (0xff & *ptr++); --index; if (nb == index) { /* Tous les caracteres sont recus */ while (nb--) { *buffer++ = *ptr++; } valid = 1; } break; default: if ((!svoie[CONSOLE]->sta.connect) && (p_port[port].synchro == 0)) { char txt[80]; sprintf (txt, "Erreur code trame = %d. Erreur =", code); warning (2, txt); } if (p_port[port].synchro == 0) { vide (port, 0); p_port[port].portind = 0; } else if ((r_canal == '^') && (code == 'A')) { /* TNC reinitialise en mode normal ??? */ valid = 1; #ifdef __WINDOWS__ if (operationnel) { fbb_quit (0); *lgbuf = 0; return (-1); } #endif } break; } *lgbuf = lg; } if (valid) { /* Une trame complete a ete recue */ if (p_port[port].synchro) { #if defined(__WINDOWS__) || defined(__linux__) char txt[80]; sprintf (txt, "Ending resynchronization on port %d - Error =", port); warning (5, txt); DisplayResync (port, 0); #else ++com_error; aff_date (); #endif } p_port[port].portind = 0; p_port[port].synchro = 0; p_com[(int)p_port[port].ccom].delai = 0; } else code = -1; if (!valid) { /* Rien n'a ete recu... Tester le temps (15 secondes d'attente) */ if (p_com[(int)p_port[port].ccom].delai > 15) { /* Lancer la procedure de resynchronisation */ if (p_port[port].synchro == 0) { char txt[80]; sprintf (txt, "Starting resynchronization on port %d - Error =", port); warning (3, txt); vide (port, 0); } resync_port (port); } } return (code); } static void ded_get_ui (int port, char *buffer, ui_header * ui) { char *ptr; char *scan; memset (ui, 0, sizeof (ui_header)); ui->port = port; scan = buffer; if ((isdigit (scan[0])) && (scan[1] == ':')) { /* port DRSI */ ui->port = drsi_port (port, scan[0] - '0'); scan += 2; if (*scan == ' ') { /* bug TFPCX ... */ ++scan; } } ptr = strtok (scan, " "); /* fm */ if (ptr == NULL) return; ptr = strtok (NULL, " "); /* exped */ if (ptr == NULL) return; n_cpy (11, ui->from, ptr); ptr = strtok (NULL, " "); /* to */ if (ptr == NULL) return; ptr = strtok (NULL, " "); /* desti */ if (ptr == NULL) return; n_cpy (11, ui->to, ptr); ptr = strtok (NULL, " "); /* via ou ctl */ if (ptr == NULL) return; if (strcmp (ptr, "via") == 0) { for (;;) { if (*ui->via) strcat (ui->via, " "); ptr = strtok (NULL, " "); /* digis */ if (ptr == NULL) return; if (strcmp (ptr, "ctl") == 0) break; strncat (ui->via, ptr, 12); } } ptr = strtok (NULL, " "); /* controle */ if (ptr == NULL) return; strn_cpy (11, ui->ctl, ptr); ui->ui = (strncmp (ptr, "UI", 2) == 0); ptr = strtok (NULL, " "); /* pid */ if (ptr == NULL) return; ptr = strtok (NULL, " "); /* pid */ if (ptr == NULL) return; sscanf (ptr, "%x", &ui->pid); } static int nb_waiting (int port) { /* Donne le nombre de trames DATA en attente d'envoi vers le TNC */ int nb = 0; PortData *cmd = p_port[port].cmd; while (cmd) { if (cmd->cmd == DATA) ++nb; cmd = cmd->next; } return (nb); } fbb-7.0.10/src/mbl_opt.c0000644000175000017500000002251513615603431011647 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module emulation WA7MBL */ static int len_bbs (char *); void mbl_disbul (void) { long no; int nobbs, cmpmsk, noctet, debut; char s[80]; bullist *pbul; if ((*indd) && ((no = lit_chiffre (1)) != 0L)) { if ((pbul = ch_record (NULL, no, '\0')) != NULL) { debut = 1; s[0] = ' '; ltoa (no, varx[0], 10); texte (T_MBL + 34); for (nobbs = 0; nobbs < NBBBS; nobbs++) { noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); if ((pbul->type) && (pbul->fbbs[noctet] & cmpmsk)) { strn_cpy (6, s + 1, bbs_ptr + (nobbs - 1) * 7); if (debut) { debut = 0; out ("Fwd:", 4); } out (s, strlen (s)); } } if (!debut) cr (); debut = 1; for (nobbs = 0; nobbs < NBBBS; nobbs++) { noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); if ((pbul->type) && (pbul->forw[noctet] & cmpmsk)) { if (*(bbs_ptr + (nobbs - 1) * 7)) { if (debut) { debut = 0; out ("Ok :", 4); } strn_cpy (6, s + 1, bbs_ptr + (nobbs - 1) * 7); out (s, strlen (s)); } } } if (!debut) cr (); } else { ptmes->numero = no; texte (T_ERR + 10); } } else texte (T_ERR + 3); } void mbl_tell (void) { int sav_voie = voiecur; char s[80]; pvoie->lignes = -1; switch (pvoie->niv3) { case 0: tst_appel (); if ((!ok_tell) || (svoie[CONSOLE]->sta.connect) || (v_tell)) { texte (T_MBL + 12); retour_mbl (); } else { pvoie->sniv1 = N_MBL; pvoie->sniv2 = 0; pvoie->sniv3 = 0; texte (T_MBL + 13); #ifdef ENGLISH sprintf (s, "%6s (%s) calling ", pvoie->sta.indicatif.call, pvoie->finf.prenom); #else sprintf (s, "Appel de %6s (%s)", pvoie->sta.indicatif.call, pvoie->finf.prenom); #endif #if defined(__WINDOWS__) || defined(__linux__) sysop_call (s); #endif #ifdef __FBBDOS__ console_on (); trait (-1, s); #endif v_tell = voiecur; music (1); ch_niv3 (1); } break; case 1: if (t_tell == 0) { #if defined(__WINDOWS__) || defined(__linux__) sysop_end (); #endif #ifdef __FBBDOS__ console_off (); trait (0, " "); #endif t_tell = -1; texte (T_MBL + 14); v_tell = 0; retour_mbl (); } break; case 2: if (v_tell) { if (voiecur == v_tell) { selvoie (CONSOLE); outs (indd, strlen (indd)); } else { selvoie (v_tell); outs (indd, strlen (indd)); } selvoie (sav_voie); } else { console_off (); maj_niv (0, 0, 0); pvoie->deconnect = -1; close_print (); } if (t_tell == 0) t_tell = -1; break; } } int affiche_forward (int nobbs) { int pos, noctet, i, j; int ok = 0; char cmpmsk; char *ptr; char s[80]; recfwd *prec; lfwd *ptr_fwd = tete_fwd; pos = 0; noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); ptr = bbs_ptr + (nobbs - 1) * 7; while (1) { if (pos == NBFWD) { ptr_fwd = ptr_fwd->suite; if (ptr_fwd == NULL) break; pos = 0; } prec = &ptr_fwd->fwd[pos]; if ((prec->type) && ((nobbs == 0) || (prec->fbbs[noctet] & cmpmsk))) { sprintf (s, "%c %6ld %2d KB ", prec->type, prec->nomess, prec->kb); outs (s, strlen (s)); ++ok; if (nobbs == 0) { ptr = bbs_ptr; for (i = 0; i < NBMASK; i++) { cmpmsk = '\001'; for (j = 0; j < 8; j++) { if (prec->fbbs[i] & cmpmsk) { outs (ptr, len_bbs (ptr)); outs (" ", 1); } ptr += 7; cmpmsk <<= 1; } } cr (); } else { outsln (ptr, len_bbs (ptr)); } } pos++; } return (ok); } int bye (void) { sup_ln (indd); return ((strcmpi (indd, "YE") == 0) || (!ISGRAPH (*indd))); } /* added by N1URO for URONode, FlexNet, and Xnet command set compatability */ int quit (void) { sup_ln (indd); return ((strcmpi (indd, "YE") == 0) || (!ISGRAPH (*indd))); } static int len_bbs (char *bbs) { int nb = 0; while (nb < 6) { if (*bbs++ == '\0') break; ++nb; } return (nb); } static void opt_choix (char c) { if (c == Oui) strcpy (varx[0], langue[vlang]->plang[OUI - 1]); else strcpy (varx[0], langue[vlang]->plang[NON - 1]); } int mbl_options (void) { int nb, ok = 0; int error = 0; FILE *fptr; info frec; long base; char c; if (((c = *indd++) != 0) && (ISGRAPH (c))) { switch (toupper (c)) { case 'L': /* Langue */ if (*indd == ' ') { teste_espace (); if (isdigit (*indd)) { nb = atoi (indd); if ((ok = ch_language (nb, pvoie->ncur, &frec)) != 0) { pvoie->finf.lang = nb - 1; init_langue (voiecur); texte (2); } else texte (T_ERR + 22); } else texte (T_ERR + 3); } else { texte (T_MBL + 31); for (nb = 0; nb < maxlang; nb++) { sprintf (varx[0], "%2d", nb + 1); sprintf (varx[1], "%-10s", nomlang + nb * LG_LANG); /* itoa(nb + 1, varx[0], 10) ; var_cpy(1, nomlang + nb * LG_LANG) ; */ texte (T_MBL + 32); if (((nb + 1) % 4) == 0) cr (); } cr_cond (); } break; case 'M': /* Nouveaux messages */ if (NEW (pvoie->finf.flags)) { ch_bit (pvoie->ncur, &frec, F_NEW, Non); pvoie->finf.flags &= (~F_NEW); opt_choix (Non); } else { ch_bit (pvoie->ncur, &frec, F_NEW, Oui); pvoie->finf.flags |= (F_NEW); opt_choix (Oui); } texte (T_MBL + 52); break; case 'N': /* Base messages */ if (*indd == ' ') { teste_espace (); if (isdigit (*indd)) { base = atol (indd); if (base > (nomess >> 7)) base /= 1000L; pvoie->finf.on_base = (int) base; } else texte (T_ERR + 3); } /************ SERA A SUPPRIMER -> REMPLACE PAR $q ************/ ltoa (1000L * (long) pvoie->finf.on_base, varx[0], 10); texte (T_MBL + 26); break; case 'P': /* Pagination */ if (*indd == ' ') { teste_espace (); if (isdigit (*indd)) { ch_bit (pvoie->ncur, &frec, F_PAG, Oui); nb = atoi (indd); if (nb < 4) nb = 4; if (nb > 100) nb = 100; pvoie->finf.nbl = nb; pvoie->finf.flags |= (F_PAG); ok = 1; texte (T_MBL + 23); } else texte (T_ERR + 3); } else { if (PAG (pvoie->finf.flags)) { ch_bit (pvoie->ncur, &frec, F_PAG, Non); pvoie->finf.flags &= (~F_PAG); texte (T_MBL + 22); } else { ch_bit (pvoie->ncur, &frec, F_PAG, Oui); pvoie->finf.flags |= (F_PAG); texte (T_MBL + 23); } } break; case 'R': /* Lecture restreinte */ if (droits (CONSMES)) { if (PRV (pvoie->finf.flags)) { ch_bit (pvoie->ncur, &frec, F_PRV, Non); pvoie->finf.flags &= (~F_PRV); opt_choix (Non); } else { ch_bit (pvoie->ncur, &frec, F_PRV, Oui); pvoie->finf.flags |= (F_PRV); opt_choix (Oui); } texte (T_MBL + 51); } else { sprintf (varx[0], "O%c", c); texte (T_ERR + 1); } break; default: /* Erreur */ error = 1; --indd; /* sprintf(varx[0], "O%c", c) ; texte(T_ERR + 1) ; */ break; } } else { if (PAG (pvoie->finf.flags)) texte (T_MBL + 23); else texte (T_MBL + 22); if (droits (CONSMES)) { if (PRV (pvoie->finf.flags)) opt_choix (Oui); else opt_choix (Non); texte (T_MBL + 51); } if (NEW (pvoie->finf.flags)) opt_choix (Oui); else opt_choix (Non); texte (T_MBL + 52); texte (2); /************ SERA A SUPPRIMER -> REMPLACE PAR $q ************/ ltoa (1000L * (long) pvoie->finf.on_base, varx[0], 10); texte (T_MBL + 26); } if (!pvoie->read_only && ok) { if (pvoie->ncur->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, (long) pvoie->ncur->coord * sizeof (info), 0); fread (&frec, sizeof (info), 1, fptr); frec.nbl = pvoie->finf.nbl; frec.lang = pvoie->finf.lang; fseek (fptr, (long) pvoie->ncur->coord * sizeof (info), 0); fwrite (&frec, sizeof (info), 1, fptr); ferme (fptr, 36); } return (error); } int ch_language (int nb, ind_noeud * noeud, info * frec) { int ok = 1; FILE *fptr; if ((nb < 1) || (nb > maxlang)) ok = 0; else if (!pvoie->read_only) { if (noeud->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fread (frec, sizeof (info), 1, fptr); frec->lang = nb - 1; fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fwrite (frec, sizeof (info), 1, fptr); ferme (fptr, 36); } return (ok); } fbb-7.0.10/src/pac_crc.c0000644000175000017500000000672713613360505011614 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * File transfer protocol "TransIt" * Version 2.00 * Copyright (C) 1987-1989 by ASCII Corporation. * * * crc.c - CRC-16 calculate routine (table look-up) * * cumtomized for mabTerm with LSIC Ver.2.10 * by Jun Mabuchi (pcs24862, msx01508 mab) */ /* CRC table */ static short crc_table[] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; unsigned short calc_crc(unsigned char c, unsigned short crc) { unsigned short hi1, hi2; hi1 = ((crc >> 8) & 0xff); hi2 = ((crc & 0xff) << 8); return ((crc_table[hi1 ^ c] ^ hi2)); } fbb-7.0.10/src/kernel.c0000644000175000017500000002655613613360505011504 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Routines de gestion des voies (Noyau). * */ #include static void choix_suivant (int); static void lit_port (int); static void teste_console (void); static void teste_voies (int); /* Boucle principale du noyau */ void kernel (void) { static int port = 1; static int loc_voie = 1; int i; #ifdef __FBBDOS__ kernel_boucle: #endif if (!operationnel) return; aff_etat ('A'); user_time_out (); is_idle = 1; #ifdef __linux__ pbsv (); #endif watchdog (); teste_console (); deb_io (); fin_io (); #ifdef __FBBDOS__ if (backscroll) { if (t_scroll) goto kernel_boucle; else fin_backscroll (); } #endif #ifdef __linux__ for (i = 1; i < NBPORT; i++) { if (++port == NBPORT) port = 1; if ((p_port[port].pvalid) && (p_port[port].stop == 0)) { lit_port (port); if (!operationnel) return; teste_voies (0); for (i = 1; i < NBVOIES; i++) { if (p_port[no_port (i)].stop == 0) teste_voies (i); } break; } } #elif defined(__WIN32__) for (i = 1; i < NBPORT; i++) { if (++port == NBPORT) port = 1; if ((p_port[port].pvalid) && (p_port[port].stop == 0)) { lit_port (port); if (!operationnel) return; teste_voies (0); if (++loc_voie == NBVOIES) loc_voie = 1; if (p_port[no_port (loc_voie)].stop == 0) teste_voies (loc_voie); } } #elif defined(__MSDOS__) || defined(__WINDOWS__) for (i = 1; i < NBPORT; i++) { if (++port == NBPORT) port = 1; if ((p_port[port].pvalid) && (p_port[port].stop == 0)) { lit_port (port); if (!operationnel) return; teste_voies (0); if (++loc_voie == NBVOIES) loc_voie = 1; if (p_port[no_port (loc_voie)].stop == 0) teste_voies (loc_voie); break; } } #endif if (loc_voie == 1) { k_tasks (); } if (!operationnel) return; #ifdef __FBBDOS__ goto kernel_boucle; #endif } static void teste_console (void) { df ("teste_console", 0); trait_time = 0; /* remet le compteur du watch-dog a 0 */ /***** A SUPPRIMER *****/ selvoie (CONSOLE); switch (traite_console ()) { case 0: break; case 1: if (pvoie->stop == 0) { traite_voie (CONSOLE); } break; case 2: /* Demande de forward */ break; } ff (); } static void tst_ddebcl (int port, uchar * mon, char *exped, char *indic) { int i; int ok = 0; long ltemp; char stemp[80]; char call[80]; uchar checksum; unsigned ck; int ssid = 0; df ("tst_ddebcl", 7); if (*mon++ == '?') { if (*mon++ == ' ') { checksum = 0; for (i = 0; i < 10; i += 2) { if ((!ok) && ((mon[i] != '0') || (mon[i + 1] != '0'))) ok = 1; if ((!isxdigit (mon[i])) && (!isxdigit (mon[i] + 1))) break; sscanf (mon + i, "%2x", &ck); ck &= 0xff; if (i < 8) checksum += (uchar) ck; } if ((!ok) || (i != 10) || (checksum != ck)) { ff (); return; } sscanf (indic, "%[0-9A-Z]-%d", stemp, &ssid); sscanf (exped, "%[0-9A-Z]", call); stemp[6] = '\0'; call[6] = '\0'; if ((ssid != myssid) || (strcmp (stemp, mycall) != 0)) { ff (); return; } strn_cpy (8, stemp, mon); sscanf (stemp, "%lX", <emp); dde_synchro (call, ltemp, port); } } ff (); } static void choix_suivant (int voie) { int choix; df ("choix_suivant", 1); if ((svoie[voie]->curfwd) && (voie == svoie[voie]->curfwd->forward)) { choix = get_link (svoie[voie]->bbsfwd); if (choix < (int) svoie[voie]->nb_choix) { ++choix; set_link (svoie[voie]->bbsfwd, choix); clr_bit_fwd (p_port[no_port (voie)].fwd, svoie[voie]->bbsfwd); svoie[voie]->curfwd->fwdpos = svoie[voie]->curfwd->lastpos; } else set_link (svoie[voie]->bbsfwd, 1); } ff (); return; } static int message (int voie, char *buffer) { char *ptr; int val; df ("message", 3); buffer[2] = '*'; if ((ptr = strtok (buffer, " ")) == NULL) { ff (); return (0); } ptr = strtok (NULL, " "); if (ptr == NULL) return (0); switch (*ptr) { case 'F': case 'D': if (strtok (NULL, " ")) { choix_suivant (voie); val = dec_voie (voie); ff (); return (val); } break; case 'R': if (strlen (ptr) == 8) { /* Readonly */ val = con_voie (voie, ptr); svoie[voie]->read_only = 1; ff (); return (val); } else if (strlen (ptr) == 9) { /* Reconnect */ dec_voie (voie); val = con_voie (voie, ptr); ff (); return (val); } break; case 'C': if (strlen (ptr) == 9) { /* Connected */ val = con_voie (voie, ptr); ff (); return (val); } break; case 'L': ptr = strtok (NULL, " "); /* indicatif */ if (strcmp (ptr, "FAILURE") == 0) { if (svoie[voie]->conf) { svoie[voie]->conf = 0; text_conf (T_CNF + 8); } choix_suivant (voie); val = dec_voie (voie); ff (); return (val); } break; case 'B': if (svoie[voie]->conf) { svoie[voie]->conf = 0; text_conf (T_CNF + 9); } val = dec_voie (voie); ff (); return (val); default: if (svoie[voie]->conf) { svoie[voie]->conf = 0; } break; } ff (); return (0); } void traite_commande (int voie, char *buffer, int len) { if (svoie[voie]->kiss != -1) { if (!svoie[CONSOLE]->sta.connect) aff_header (voie); init_timout (voie); if (svoie[voie]->kiss < 0) { svoie[voie]->kiss = CONSOLE; } selvoie (svoie[voie]->kiss); out ("\n$O: ", 5); if (len >= 4) { outsln (buffer + 4, len - 4); selvoie (voie); message (voie, buffer); } } else { nb_trait = 0; if (message (voie, buffer)) { traite_voie (voie); /* Il y a des actions */ status (voie); } } } void traite_data (int voie, char *buffer, int len) { aff_etat ('R'); if (svoie[voie]->kiss >= 0) { if (!svoie[CONSOLE]->sta.connect) aff_header (voie); init_timout (voie); selvoie (svoie[voie]->kiss); outs (buffer, len); write_capture (buffer, len); selvoie (voie); } else { in_buf (voie, buffer, len); status (voie); } } /* * Ressort un caractere du buffer d'entree * retourne le nb de caracteres (1 ou 0) */ int get_data (int voie) { if (svoie[voie]->kiss >= 0) { /* Rien a faire, la data est deja partie */ return (0); } else { return (get_inbuf (voie)); } } static void lit_port (int port) { char buffer[RCV_BUFFER_SIZE]; int voie; int len = 0; int max; int cmd; ui_header ui; char header[200]; char pid[20]; char to[20]; char ctl[20]; char via[10]; df ("lit_port", 1); memset (buffer, 0, sizeof (buffer)); #ifdef __WINDOWS__ if (p_port[port].typort == TYP_TCP) { ff (); return; } #endif if (p_port[port].typort == TYP_MOD) { lit_port_modem (port); aff_etat ('A'); ff (); return; } max = 30; voie = 0xff; while (rcv_drv (&port, &voie, &cmd, buffer, &len, &ui)) { switch (cmd) { case DISPLAY: break; case NBCHR: p_port[port].cur = *((long *) buffer); break; case NBBUF: p_port[port].mem = *((int *) buffer) << 5; break; case STATS: { int ch_status = 0; int mem = p_port[port].mem >> 5; stat_ch *sta_new = (stat_ch *) buffer; stat_ch *sta = &svoie[voie]->sta; if ((sta_new->stat != -1) && (sta->stat != sta_new->stat)) { sta->stat = sta_new->stat; ch_status = 1; } if ((sta_new->connect != -1) && (sta->connect != sta_new->connect)) { if (sta_new->connect == 1) { sta->connect = 1; } ch_status = 1; } if ((sta_new->ret != -1) && (sta_new->ret != sta->ret)) { sta->ret = sta_new->ret; ch_status = 1; } if ((sta_new->ack != -1) && (sta_new->ack != sta->ack)) { sta->ack = sta_new->ack; ch_status = 1; } if ((sta_new->mem != -1) && (sta->mem != mem)) { sta->mem = mem; ch_status = 1; } svoie[voie]->ch_status = ch_status; } break; case DATA: traite_data (voie, buffer, len); break; case COMMAND: traite_commande (voie, buffer, len); break; case UNPROTO: aff_etat ('M'); if (ui.pid) sprintf (pid, " pid %02X", ui.pid); else *pid = '\0'; if (*ui.ctl) sprintf (ctl, "ctl %s", ui.ctl); else *ctl = '\0'; if (*ui.to) sprintf (to, " to %s ", ui.to); else *to = '\0'; if (*ui.via) strcpy (via, "via "); else *via = '\0'; sprintf (header, "[%d] fm %s%s%s%s%s%s%s", ui.port, ui.from, to, via, ui.via, ctl, pid, ui.txt); add_heard (ui.port, get_indic (ui.from)); monitor (ui.port, header, strlen (header)); put_ui (header, W_MONH, strlen (header)); if (len == 0) break; switch (ui.pid) { case 0x01: put_rose (buffer, W_MOND, len); break; case 0xcf: put_nr (buffer, W_MOND, len); break; case 0xf0: if (ui.ui) tst_ddebcl (ui.port, buffer, ui.from, ui.to); monitor (ui.port, buffer, len); put_ui (buffer, W_MOND, len); break; case 0x0: /* Pactor */ monitor (ui.port, buffer, len); put_ui (buffer, W_MOND, len); break; } break; } if (--max == 0) break; } aff_etat ('A'); ff (); } void teste_voies (int voie) { int ch_stat = 0; long caltemps; static long lock_time = 0L; struct stat statbuf; df ("teste_voies", 0); trait_time = 0; /* remet le compteur du watch-dog a 0 */ #ifdef __linux__ if (is_cmd (voie)) { /* A command is being processed */ traite_voie (voie); } else #endif if (voie == INEXPORT) { time (&caltemps); if ((inexport) && (!backscroll)) { if (stat (LOCK_IN, &statbuf) == -1) { lock_time = 0L; aff_etat ('Y'); selvoie (INEXPORT); traite_voie (INEXPORT); } else { if (lock_time == 0L) lock_time = caltemps; else if ((caltemps - lock_time) > 300L) { lock_time = 0L; unlink (LOCK_IN); } } } return; } if (svoie[voie]->affport.port == 0xff) { ff (); return; } if (svoie[voie]->sta.connect) { ack_suiv (voie); } if ((!svoie[voie]->stop) && (svoie[voie]->seq)) { /* Recharge les bufs de sortie */ if (tot_mem > 10000L) { traite_voie (voie); ch_stat = 1; } ff (); return; } if ((v_tell == 0) || (v_tell != voie) || ((v_tell) && (v_tell == voie))) { while ((!svoie[voie]->seq) && (inbuf_ok (voie))) { ch_stat = 1; traite_voie (voie); } } if (ch_stat) status (voie); ff (); } int min_ok (int voie) { int port; int mini; df ("min_ok", 1); port = no_port (voie); mini = 300; switch (p_port[port].typort) { case TYP_BPQ: mini = (40 * 64); break; case TYP_DED: mini = (70 * 32); case TYP_FLX: p_port[port].mem = svoie[voie]->sta.mem * 250; mini = (250); break; } ff (); return (p_port[port].mem > mini); } fbb-7.0.10/src/mbl_expo.c0000644000175000017500000001537013613360505012021 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #define CTRL_Z '\032' static int out_disk (FILE *, char *); static int mess_export (FILE * fptr, int voie, long temps, long no_message) { char lastchar = '\0'; char type; char s[255]; char ret[2]; char header[160]; char via[80]; FILE *f_mptr; char buffer[300]; ret[0] = 13; ret[1] = 0; if (*svoie[voie]->entmes.bbsv) sprintf (via, "@ %s ", svoie[voie]->entmes.bbsv); else *via = '\0'; type = svoie[voie]->entmes.type; if (type == 'A') type = 'P'; sprintf (s, "S%c %s %s< %s", type, svoie[voie]->entmes.desti, via, svoie[voie]->entmes.exped); if (!out_disk (fptr, s)) return (0); if (*(svoie[voie]->entmes.bid)) { sprintf (s, " $%s", svoie[voie]->entmes.bid); if (!out_disk (fptr, s)) return (0); } if (!out_disk (fptr, ret)) return (0); if (!out_disk (fptr, svoie[voie]->entmes.titre)) return (0); if (!out_disk (fptr, ret)) return (0); deb_io (); make_header (&(svoie[voie]->entmes), header); entete_mess_fwd (&(svoie[voie]->entmes), header); if (!out_disk (fptr, msg_header)) return (0); fin_io (); if ((f_mptr = ouvre_mess (O_TEXT, svoie[voie]->entmes.numero, svoie[voie]->entmes.status)) != NULL) { while (1) { if (fgets (buffer, 256, f_mptr) == NULL) break; lastchar = buffer[strlen (buffer) - 1]; if (!out_disk (fptr, lf_to_cr (buffer))) { ferme (f_mptr, 31); return (0); } } ferme (f_mptr, 31); } else { dde_warning (W_ASC); sprintf (s, "\rMessage file %s missing in %s\r", pvoie->sr_fic, mycall); if (!out_disk (fptr, s)) return (0); } if ((lastchar != '\n') && (!out_disk (fptr, "\r"))) return (0); if (!out_disk (fptr, "/EX\r")) return (0); tst_warning (ptmes); return (1); } static int out_disk (FILE * fptr, char *texte) { int nb = 0; int retour; char buffer[300]; char *optr = buffer; aff_bas (voiecur, W_SNDT, texte, strlen (texte)); while (*texte) { if (*texte == '\r') { *optr = '\r'; ++optr; if (++nb == 300) break; *optr = '\n'; } else if (*texte != '\n') *optr = *texte; ++optr; ++texte; if (++nb == 300) break; } if (nb == 0) return (1); deb_io (); retour = ((int) fwrite (buffer, nb, 1, fptr)); fin_io (); return (retour > 0); } int export_message (char *nom_fich) { int i; int fd; FILE *fptr; char temp[200]; aff_etat ('J'); aff_header (voiecur); aff_forward (); pvoie->lignes = -1; pvoie->finf.lang = langue[0]->numlang; for (i = 0; i < 2; i++) { /* Checks for the lock file and creates it */ fd = open (lfile (nom_fich), O_EXCL | O_CREAT, S_IREAD | S_IWRITE); if (fd == -1) { #ifdef __WIN32__ long tt; WIN32_FIND_DATA ff; SYSTEMTIME t; FILETIME ft; if (errno != EEXIST) { sprintf (temp, "*** error : Cannot create lock file %s\r", lfile (nom_fich)); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); break; } if (FindFirstFile ((char *) lfile (nom_fich), &ff) != (HANDLE) - 1) { GetSystemTime (&t); SystemTimeToFileTime (&t, &ft); /* Add one hour to File time (approximative) */ ff.ftLastWriteTime.dwHighDateTime += 9; if (CompareFileTime (&ft, &ff.ftLastWriteTime) > 0L) { /* If more than 1 hour, delete the lock file if possible */ unlink (lfile (nom_fich)); sprintf (temp, "*** file %s was locked since more than 1 hour, lock deleted !!\r", nom_fich); aff_bas (voiecur, W_SNDT, temp, strlen (temp)); } else { sprintf (temp, "*** file %s locked !!\r", nom_fich); aff_bas (voiecur, W_SNDT, temp, strlen (temp)); break; } } #else /* Checks the date of the lock file */ struct stat statbuf; long t = time (NULL); if (errno != EEXIST) { sprintf (temp, "*** error : Cannot create lock file %s\r", lfile (nom_fich)); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); break; } if ((stat (lfile (nom_fich), &statbuf) == 0) && ((t - statbuf.st_ctime) > 3600L)) { /* If more than 1 hour, delete the lock file if possible */ unlink (lfile (nom_fich)); sprintf (temp, "*** file %s was locked from more than 1 hour (%ld), lock deleted (%ld)!!\r", nom_fich, statbuf.st_ctime, t); aff_bas (voiecur, W_SNDT, temp, strlen (temp)); } else { sprintf (temp, "*** file %s locked !!\r", nom_fich); aff_bas (voiecur, W_SNDT, temp, strlen (temp)); break; } #endif } else break; } if (fd == -1) { aff_bas (voiecur, W_SNDT, "*** done\r", 9); inexport = 0; deconnexion (voiecur, 1); init_etat (); status (voiecur); return (0); } close (fd); if ((fptr = fappend (nom_fich, "b")) == NULL) { #ifdef ENGLISH sprintf (temp, " File error %s ", nom_fich); #else sprintf (temp, "Erreur fichier %s", nom_fich); #endif win_message (5, temp); aff_bas (voiecur, W_RCVT, "*** disk error !!\r", 18); aff_bas (voiecur, W_SNDT, "*** done\r", 9); inexport = 0; deconnexion (voiecur, 1); init_etat (); status (voiecur); unlink (lfile (nom_fich)); return (0); } if (mess_suiv (mail_ch)) { if (mess_export (fptr, mail_ch, svoie[mail_ch]->entmes.date, svoie[mail_ch]->entmes.numero)) { fin_envoi_fwd (mail_ch); aff_bas (voiecur, W_RCVT, "Export>\r", 8); } else { fclose (fptr); unlink (lfile (nom_fich)); #ifdef ENGLISH sprintf (temp, " File error %s ", nom_fich); #else sprintf (temp, "Erreur fichier %s", nom_fich); #endif aff_bas (voiecur, W_RCVT, "*** disk error !!\r", 18); aff_bas (voiecur, W_SNDT, "*** done\r", 9); inexport = 0; deconnexion (voiecur, 1); /* ferme(fptr, 7) ; */ #if defined(__WINDOWS__) || defined(__linux__) window_disconnect (voiecur); #endif init_etat (); status (voiecur); return (0); } } else { aff_bas (voiecur, W_SNDT, "*** done\r", 9); inexport = 0; deconnexion (voiecur, 1); init_etat (); } ferme (fptr, 7); unlink (lfile (nom_fich)); status (voiecur); return (1); } fbb-7.0.10/src/fwdovl4.c0000644000175000017500000003077213615603431011604 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 4 */ #include static long t_msg_fwd_suiv (int, uchar, uchar, uchar, int, char *); #ifdef __FBBDOS__ static char *expand_path (char *cmde) { struct stat statbuf; char str[256]; char *path; /* Cherche en direct */ if (stat (cmde, &statbuf) == 0) { path = cmde; return (path); } sprintf (str, "%s.EXE", cmde); if (stat (str, &statbuf) == 0) { path = str; return (path); } sprintf (str, "%s.COM", cmde); if (stat (str, &statbuf) == 0) { path = str; return (path); } sprintf (str, "%s.BAT", cmde); if (stat (str, &statbuf) == 0) { path = str; return (path); } /* Cherche avec le path */ path = searchpath (cmde); if (path == NULL) { sprintf (str, "%s.EXE", cmde); path = searchpath (str); } if (path == NULL) { sprintf (str, "%s.COM", cmde); path = searchpath (str); } if (path == NULL) { sprintf (str, "%s.BAT", cmde); path = searchpath (str); } /* if (path == NULL) { dprintf("Pas trouve {%s}\n", str); } */ return (path); } #endif /* * send_dos : envoie une commande MsDos * * Type = 0 : * 1 : Sauvegarde la fenetre BBS et affiche le message d'erreur * 2 : Affiche le message d'erreur * 3 : Pas d'affichage, de sauvegarde et de retour. * 4 : Redirige les sorties sur EXECUTE.$$$ et retourne le contenu * 5 : Sauvegarde de la fenetre, pas d'affichage et de retour. */ int send_dos (int type, char *commande, char *data) { #ifdef __linux__ return (-1); #endif #ifdef __WINDOWS__ int err; char log[256]; strcpy (log, commande); if (data) { strcat (log, " "); strcat (log, data); } err = fbb_exec (log); return (err); #endif #ifdef __FBBDOS__ static char option[] = "/C"; char *arg[40]; char log[256]; char deroute[80]; char *path; int duplic, oldstdout, oldstderr; int err, i = 0; fen *sav_fen; int errtemp; int disk; int ofst; char cur_dir[MAXPATH]; int n; if (!*commande) return (0); log[0] = (type == 1) ? 'D' : 'X'; log[1] = ' '; strn_cpy (70, log + 2, commande); fbb_log (voiecur, 'D', log); arg[i++] = getenv ("COMSPEC"); arg[i++] = option; arg[i++] = strtok (commande, " "); while ((arg[i] = strtok (NULL, " ")) != NULL) ++i; if (data) { arg[i++] = data; arg[i] = NULL; } path = expand_path (arg[2]); if (path == NULL) return (-1); arg[2] = path; ofst = 2; if (strstr (arg[2], ".BAT")) { ofst = 0; } deb_io (); disk = getdisk (); strcpy (cur_dir, "X:\\"); cur_dir[0] = 'A' + disk; getcurdir (0, cur_dir + 3); operationnel = FALSE; if ((type == 1) || (type == 5)) { sav_fen = create_win (1, 1, 80, h_screen); if (EGA) ega_close (); puttxt (fen_dos); puttext_info (&(fen_dos->sav_mod)); break_ok (); err = spawnv (P_WAIT, arg[ofst], arg + ofst); if (err == -1) { ofst = 0; err = spawnv (P_WAIT, arg[ofst], arg + ofst); } break_stop (); errtemp = errno; gettext_info (&(fen_dos->sav_mod)); gettxt (1, 1, 80, 25, fen_dos->ptr); if (EGA) ega_open (); close_win (sav_fen); } else { if (type == 4) { /* redirige stdout et stderr sur le fichier EXECUTE.$$$ */ sprintf (deroute, "%s\\EXECUTE.$$$", getcwd (log, 80)); duplic = open (deroute, O_CREAT | O_RDWR, S_IWRITE | S_IREAD); } else { duplic = open ("NUL", O_WRONLY, S_IWRITE | S_IREAD); } oldstdout = dup (1); oldstderr = dup (2); dup2 (duplic, 1); dup2 (duplic, 2); close (duplic); break_ok (); err = spawnv (P_WAIT, arg[ofst], arg + ofst); if (err == -1) { ofst = 0; err = spawnv (P_WAIT, arg[ofst], arg + ofst); } break_stop (); errtemp = errno; dup2 (oldstdout, 1); dup2 (oldstderr, 2); close (oldstdout); close (oldstderr); if (type == 4) { if (err != -1) { outfich (deroute); } unlink (deroute); } } operationnel = TRUE; setdisk (disk); chdir (cur_dir); if ((type < 3) && (err == -1)) { strcpy (log, "DOS Error : "); for (n = ofst; n < i; n++) { strcat (log, arg[n]); strcat (log, " "); } errno = errtemp; perror (log); } fin_io (); return (err); #endif } /* ok_fwd = 0 -> Le message n'est pas marque 'F' */ /* Si nobbs = 0 -> raz flags fwd */ void sup_fwd (long num, int ok_fwd, uchar nobbs) { int i, pos, mode; int del = 0; unsigned num_indic; bullist bul; ind_noeud *noeud; mess_noeud *mptr; lfwd *ptr_fwd = tete_fwd; recfwd *prec = NULL; pos = 0; deb_io (); while (1) { if (pos == NBFWD) { ptr_fwd = ptr_fwd->suite; if (ptr_fwd == NULL) break; pos = 0; } prec = &ptr_fwd->fwd[pos]; if (prec->nomess == num) break; pos++; } if ((mptr = findmess (num)) != NULL) { ouvre_dir (); read_dir (mptr->noenr, &bul); if (nobbs <= NBBBS) { if (nobbs) { /* Bulletin : Marque la BBS */ clr_bit_fwd (prec->fbbs, nobbs); clr_bit_fwd (bul.fbbs, nobbs); set_bit_fwd (bul.forw, nobbs); } else { /* Prive : Marque et supprime les autres routes */ for (i = 0; i < NBMASK; i++) { bul.forw[i] = bul.fbbs[i]; bul.fbbs[i] = '\0'; } /* Supprime le MID */ if (del) delete_bid (bul.bid); } } /* Supprime le message binaire si forwarde */ if (!fwd_mask (bul.fbbs)) { if (ok_fwd) { noeud = insnoeud (bul.desti, &num_indic); if (bul.status == 'N') --(noeud->nbnew); bul.status = 'F'; } prec->type = '\0'; prec->bin = '\0'; mode = pvoie->binary; set_binary (voiecur, 1); /************** Verifier si pas en cours d'envoi ! *********************/ del = 1; for (i = 1; i < NBVOIES; i++) { if ((svoie[i]->sta.connect) && (i != voiecur) && (FOR (svoie[i]->mode)) && (svoie[i]->entmes.numero == num)) { del = 0; } } if (del) supp_mess (num); /* supprime le fichier binaire eventuellement */ set_binary (voiecur, mode); aff_msg_cons (); } write_dir (mptr->noenr, &bul); ferme_dir (); } else { for (i = 0; i < NBMASK; i++) prec->fbbs[i] = '\0'; } fin_io (); } /* Cherche si le destinataire existe dans la base et route sur son homebbs */ void entete_envoi_fwd (int voie) { /* envoie la ligne de commande acheminant message vers bbs */ char s[80]; char type; char *bbs_v; if (HIE (svoie[voie]->mode)) bbs_v = svoie[voie]->entmes.bbsv; else bbs_v = bbs_via (svoie[voie]->entmes.bbsv); type = svoie[voie]->entmes.type; if ((type == 'A') && (!ACQ (svoie[voie]->mode))) type = 'P'; sprintf (s, "S%c %s", type, svoie[voie]->entmes.desti); printf ("S%c %s\n", type, svoie[voie]->entmes.desti); outs (s, strlen (s)); if (*bbs_v) { sprintf (s, " @ %s", bbs_v); outs (s, strlen (s)); } if (*svoie[voie]->entmes.exped) { sprintf (s, " < %s", svoie[voie]->entmes.exped); outs (s, strlen (s)); } if (*(svoie[voie]->entmes.bid)) { if (((svoie[voie]->entmes.status == '$') && (BID (svoie[voie]->mode))) || (MID (svoie[voie]->mode)) || (strcmp (svoie[voie]->entmes.desti, "SYSOP") == 0) ) { sprintf (s, " $%s", svoie[voie]->entmes.bid); printf (" $%s\n", svoie[voie]->entmes.bid); outs (s, strlen (s)); } } cr (); } void entete_fwd (int voie) { char *s; char header[160]; s = svoie[voie]->entmes.titre; outsln (s, strlen (s)); deb_io (); make_header (&(svoie[voie]->entmes), header); entete_mess_fwd (&(svoie[voie]->entmes), header); outs (msg_header, strlen (msg_header)); aff_etat ('E'); send_buf (voiecur); fin_io (); } int fin_envoi_fwd (int voie) { /* Si Nø de message nul retour */ if (svoie[voie]->entmes.numero == 0L) return (FALSE); /* teste si le message est encore a forwarder et enleve de la liste */ if ((svoie[voie]->entmes.status == '$') || (multi_prive)) sup_fwd (svoie[voie]->entmes.numero, TRUE, svoie[voie]->bbsfwd); else sup_fwd (svoie[voie]->entmes.numero, TRUE, 0); return (TRUE); } atfwd *attend_fwd (int nobbs, uchar max, uchar old, uchar typ, int data_mode) { int pos, noctet, ok = 0; char cmpmsk; static atfwd nbmess; recfwd *prec; lfwd *ptr_fwd = tete_fwd; time_t date = time(NULL) - 3600L * (long)old; pos = 0; noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); nbmess.nbpriv = nbmess.nbbul = nbmess.nbkb = 0; while (1) { if (pos == NBFWD) { ptr_fwd = ptr_fwd->suite; if (ptr_fwd == NULL) break; pos = 0; } prec = &ptr_fwd->fwd[pos]; pos++; if (prec->type) { if ((data_mode == 0) && (prec->bin)) continue; if ((data_mode == 3) && (!prec->bin)) continue; if ((data_mode == 2) && (prec->bin) && (!PRIVATE (prec->type))) continue; if ((prec->fbbs[noctet] & cmpmsk) && (prec->date <= date) && (prec->kb <= max)) { if (PRIVATE (prec->type)) { ++nbmess.nbpriv; ok = 1; nbmess.nbkb += prec->kb; } else if (!(typ & FWD_PRIV)) { ++nbmess.nbbul; ok = 1; nbmess.nbkb += prec->kb; } } } } return ((ok) ? &nbmess : NULL); } static int is_egal (long numero) { int i; int nb = pvoie->nb_egal; if (nb > NB_DEL) nb = NB_DEL; for (i = 0; i < nb; i++) { if (pvoie->mess_egal[i] == numero) return (1); } return (0); } int not_in_bloc (long numero, int voie) { if (pvoie->niv1 == N_XFWD) return (not_in_xfwd_mess (numero, voie)); else return (not_in_fb_mess (numero, voie)); } static long t_msg_fwd_suiv (int nobbs, uchar max, uchar old, uchar typ, int voie, char *test) { int pos, noctet; int data_mode = svoie[voie]->data_mode; char cmpmsk; recfwd *prec; recfwd *psel; lfwd *ptr_fwd; time_t date = time(NULL) - 3600L * (long)old; noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); ptr_fwd = tete_fwd; psel = NULL; pos = 0; while (1) { if (pos == NBFWD) { ptr_fwd = ptr_fwd->suite; if (ptr_fwd == NULL) break; pos = 0; } prec = &ptr_fwd->fwd[pos]; pos++; /* Message en cours d'edition */ if ((reply == 4) && (svoie[CONSOLE]->enrcur == prec->nomess)) continue; if ((data_mode == 0) && (prec->bin)) continue; if ((data_mode == 3) && (!prec->bin)) continue; if ((data_mode == 2) && (prec->bin) && (!PRIVATE (prec->type))) continue; if (is_egal (prec->nomess)) { continue; } if ((prec->type) && (prec->fbbs[noctet] & cmpmsk) && (prec->date <= date) && (prec->kb <= max) && (not_in_bloc (prec->nomess, voie))) { if (typ & FWD_SMALL) { if (PRIVATE (prec->type)) { if ((!psel) || (!PRIVATE (psel->type)) || (psel->kb > prec->kb)) psel = prec; } else if ((!(typ & FWD_PRIV)) && ((!psel) || (!PRIVATE (psel->type)))) { if ((test == NULL) || (strncmp (test, prec->bbsv, 6) == 0)) { if ((!psel) || (psel->kb > prec->kb)) psel = prec; } } } else { if (PRIVATE (prec->type)) { if ((!psel) || (!PRIVATE (psel->type)) || (psel->kb > prec->kb)) /* if ((!psel) || (prec->nomess < psel->nomess)) */ psel = prec; } else if ((!(typ & FWD_PRIV)) && ((!psel) || (!PRIVATE (psel->type)))) { if ((test == NULL) || (strncmp (test, prec->bbsv, 6) == 0)) { if ((!psel) || (prec->nomess < psel->nomess)) { psel = prec; } } } } } } if ((psel) && (typ & FWD_PRIV) && (!PRIVATE (psel->type))) psel = NULL; if ((psel) && (!PRIVATE (psel->type)) && (test) && (strncmp (test, psel->bbsv, 6) != 0)) psel = NULL; return ((psel) ? psel->nomess : 0L); } long msg_fwd_suiv (int nobbs, uchar max, uchar old, uchar typ, int voie) { int i; long numero; for (i = 0; i < NB_P_ROUTE; i++) { if (*pvoie->p_route[i]) { numero = t_msg_fwd_suiv (nobbs, max, old, typ, voie, pvoie->p_route[i]); if (numero) { return (numero); } } else break; } numero = t_msg_fwd_suiv (nobbs, max, old, typ, voie, NULL); return (numero); } fbb-7.0.10/src/X11/0000755000175000017500000000000013747536101010500 500000000000000fbb-7.0.10/src/X11/Makefile.in0000644000175000017500000005424513747457130012503 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = : sbin_PROGRAMS = xfbb$(EXEEXT) xfbbX_cl$(EXEEXT) subdir = src/X11 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(sbindir)" PROGRAMS = $(sbin_PROGRAMS) am_xfbb_OBJECTS = xfbbabtd.$(OBJEXT) xfbbcnsl.$(OBJEXT) \ xfbbedtm.$(OBJEXT) xfbbedtu.$(OBJEXT) xfbblcnx.$(OBJEXT) \ xfbbmain.$(OBJEXT) xfbbpndd.$(OBJEXT) xeditor.$(OBJEXT) \ xfbb.$(OBJEXT) xfbb_OBJECTS = $(am_xfbb_OBJECTS) am__DEPENDENCIES_1 = xfbb_DEPENDENCIES = ../libxfbbd.a $(am__DEPENDENCIES_1) am_xfbbX_cl_OBJECTS = md5c.$(OBJEXT) xfbbXabtd.$(OBJEXT) \ xfbbXcnsl.$(OBJEXT) xfbbX.$(OBJEXT) xfbbX_cl_OBJECTS = $(am_xfbbX_cl_OBJECTS) xfbbX_cl_DEPENDENCIES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/md5c.Po ./$(DEPDIR)/xeditor.Po \ ./$(DEPDIR)/xfbb.Po ./$(DEPDIR)/xfbbX.Po \ ./$(DEPDIR)/xfbbXabtd.Po ./$(DEPDIR)/xfbbXcnsl.Po \ ./$(DEPDIR)/xfbbabtd.Po ./$(DEPDIR)/xfbbcnsl.Po \ ./$(DEPDIR)/xfbbedtm.Po ./$(DEPDIR)/xfbbedtu.Po \ ./$(DEPDIR)/xfbblcnx.Po ./$(DEPDIR)/xfbbmain.Po \ ./$(DEPDIR)/xfbbpndd.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(xfbb_SOURCES) $(xfbbX_cl_SOURCES) DIST_SOURCES = $(xfbb_SOURCES) $(xfbbX_cl_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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@ xfbb_SOURCES = xfbbabtd.c xfbbcnsl.c xfbbedtm.c xfbbedtu.c xfbblcnx.c\ xfbbmain.c xfbbpndd.c xeditor.c xfbb.c xfbb_LDADD = ../libxfbbd.a -lXm -lXt -lXpm -lXext -lX11 $(AX25_LIB) xfbbX_cl_SOURCES = ../md5c.c xfbbXabtd.c xfbbXcnsl.c xfbbX.c xfbbX_cl_LDADD = -lXm -lXt -lXpm -lXext -lX11 AM_CPPFLAGS = -I$(top_srcdir)/include -Wstrict-prototypes -funsigned-char -DPROTOTYPES -fstack-check 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/X11/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/X11/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ 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)$(sbindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || 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)$(sbindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(sbindir)" && rm -f $$files clean-sbinPROGRAMS: -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) xfbb$(EXEEXT): $(xfbb_OBJECTS) $(xfbb_DEPENDENCIES) $(EXTRA_xfbb_DEPENDENCIES) @rm -f xfbb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xfbb_OBJECTS) $(xfbb_LDADD) $(LIBS) xfbbX_cl$(EXEEXT): $(xfbbX_cl_OBJECTS) $(xfbbX_cl_DEPENDENCIES) $(EXTRA_xfbbX_cl_DEPENDENCIES) @rm -f xfbbX_cl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xfbbX_cl_OBJECTS) $(xfbbX_cl_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5c.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xeditor.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbb.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbX.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbXabtd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbXcnsl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbabtd.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbcnsl.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbedtm.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbedtu.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbblcnx.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbmain.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xfbbpndd.Po@am__quote@ # am--include-marker $(am__depfiles_remade): @$(MKDIR_P) $(@D) @echo '# dummy' >$@-t && $(am__mv) $@-t $@ am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` md5c.o: ../md5c.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5c.o -MD -MP -MF $(DEPDIR)/md5c.Tpo -c -o md5c.o `test -f '../md5c.c' || echo '$(srcdir)/'`../md5c.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5c.Tpo $(DEPDIR)/md5c.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../md5c.c' object='md5c.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5c.o `test -f '../md5c.c' || echo '$(srcdir)/'`../md5c.c md5c.obj: ../md5c.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT md5c.obj -MD -MP -MF $(DEPDIR)/md5c.Tpo -c -o md5c.obj `if test -f '../md5c.c'; then $(CYGPATH_W) '../md5c.c'; else $(CYGPATH_W) '$(srcdir)/../md5c.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/md5c.Tpo $(DEPDIR)/md5c.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../md5c.c' object='md5c.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o md5c.obj `if test -f '../md5c.c'; then $(CYGPATH_W) '../md5c.c'; else $(CYGPATH_W) '$(srcdir)/../md5c.c'; fi` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ 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-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ 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" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(sbindir)"; 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-generic clean-sbinPROGRAMS mostlyclean-am distclean: distclean-am -rm -f ./$(DEPDIR)/md5c.Po -rm -f ./$(DEPDIR)/xeditor.Po -rm -f ./$(DEPDIR)/xfbb.Po -rm -f ./$(DEPDIR)/xfbbX.Po -rm -f ./$(DEPDIR)/xfbbXabtd.Po -rm -f ./$(DEPDIR)/xfbbXcnsl.Po -rm -f ./$(DEPDIR)/xfbbabtd.Po -rm -f ./$(DEPDIR)/xfbbcnsl.Po -rm -f ./$(DEPDIR)/xfbbedtm.Po -rm -f ./$(DEPDIR)/xfbbedtu.Po -rm -f ./$(DEPDIR)/xfbblcnx.Po -rm -f ./$(DEPDIR)/xfbbmain.Po -rm -f ./$(DEPDIR)/xfbbpndd.Po -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-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinPROGRAMS 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 ./$(DEPDIR)/md5c.Po -rm -f ./$(DEPDIR)/xeditor.Po -rm -f ./$(DEPDIR)/xfbb.Po -rm -f ./$(DEPDIR)/xfbbX.Po -rm -f ./$(DEPDIR)/xfbbXabtd.Po -rm -f ./$(DEPDIR)/xfbbXcnsl.Po -rm -f ./$(DEPDIR)/xfbbabtd.Po -rm -f ./$(DEPDIR)/xfbbcnsl.Po -rm -f ./$(DEPDIR)/xfbbedtm.Po -rm -f ./$(DEPDIR)/xfbbedtu.Po -rm -f ./$(DEPDIR)/xfbblcnx.Po -rm -f ./$(DEPDIR)/xfbbmain.Po -rm -f ./$(DEPDIR)/xfbbpndd.Po -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-sbinPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \ clean-generic clean-sbinPROGRAMS cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ 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-sbinPROGRAMS install-strip installcheck \ installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-sbinPROGRAMS .PRECIOUS: Makefile # 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: fbb-7.0.10/src/X11/xeditor.c0000644000175000017500000017345713613360505012256 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #ifndef __MAIN__ #include #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #include "textedit.h" */ /*********************************************************************** ** ** ** G L O B A L V A R I A B L E S ** ** ** ***********************************************************************/ static Widget save_alert; /* Warning Dialog */ static Atom a_del_win; /* Atom for WM_DELETE_WINDOW */ static Widget find_db, /* The dialog box */ find_lbl, /* Label: "Find:" */ find_txt, /* Find-string Entry Field */ frep_lbl, /* Label: "Repl:" */ frep_txt, /* Replace-string Entry Field */ find_sep, /* Sep between pres & conf */ find_btn_1, /* Action pushbutton */ find_btn_2, /* Go-away pushbutton */ find_btn_3, /* Replace pushbutton */ cantfind_db; /* "Can't Find" Alert */ static XmString find_str, /* XmString for "Find" */ can_str, /* XmString for "Cancel" */ next_str, /* XmString for "Next" */ repl_str, /* XmString for "Replace" */ done_str; /* XmString for "Done" */ static int finding; /* Flag for FindCB() */ static int fd_start, /* Start of the found text */ fd_end; /* End of the found text */ static int curpos; static int line = 0; /* Ligne dans le texte */ static int col = 0; /* Colonne dans le texte */ static int pos = 0; /* Position de l'insertion ds le buffer */ static int wp; static int wrap; /* Mode wrap valide */ static int justif; /* Mode justification demande */ static int efoothelp = 0; static Widget mainwin; /* XmMainWindow */ static Widget menubar; /* MainWindow Menu Bar */ static Widget toolbar; /* MainWindow Menu Bar */ static Widget workwin; /* MainWindow Work Area */ static Widget editshell; /* Shell of the editor */ static Widget textwin; /* Work Window XmText widget */ static Widget footer; /* MainWindow Footer */ static Widget MSave; /* Widget Save */ static Widget MSaveAs; /* Widget SaveAs */ static Widget MCut; /* Widget Cut*/ static Widget MCopy; /* Widget Copy */ static Widget MJustif; /* Widget Justification */ static Widget MWrap; /* Widget AutoWrap */ #define E_NB_ICON 10 static Widget EIcon[E_NB_ICON]; /* Icons of the toolbar */ static int OldIconState[E_NB_ICON]; static Arg arglist[16]; /* For programmatic rsrc stuf */ static Boolean changed; /* Used for save alert */ static int EditorOptions; static char *curfile = NULL; /* The current filename */ static Widget stdfile_db; /* The Standard File dialog */ static Widget find_alert; static void (*fileproc)(void); /* The Read/Write function */ /*********************************************************************** ** ** ** F O R W A R D D E F I N I T I O N S ** ** ** ***********************************************************************/ static void EndEditor(int); static void InitMenuBar(void); /* menu.c */ static void InitOther(void); /* misc.c */ static char *StrFind(char *, char *); static void InitAlerts(void); /* alerts.c */ static void InitFiler(void); /* filer.c */ static void FileNew(void); static void FileOpen(void); static void FileInsert(void); static void FileSave(void); static void FileSaveAs(void); static void InitFindDB(void); /* find.c */ static void ManageFindDB(void); static void InitSaveProto(void); /* saveproto.c */ static void InitMainWindow(char *); static void InitWorkWindow(void); static void InitFileMenu(void); static void InitEditMenu(void); static void InitViewMenu(void); static void InitOptionMenu(void); static void InitHelpMenu(void); static void FileMenuCB(Widget, char *, caddr_t); static void EditMenuCB(Widget, char *, XmAnyCallbackStruct *); static void ViewMenuCB(Widget, char *, XmAnyCallbackStruct *); static void ManageStdFile(char *, XtCallbackProc, char *); static void UnmanageStdFile(void); static void SFProc(Widget, caddr_t, XmFileSelectionBoxCallbackStruct *); static void ReadProc(void); static void InsertProc(void); static void WriteProc(void); static void PreReadProc(void); static void FindCB(Widget, char *, XmAnyCallbackStruct *); static void ReplaceCB(Widget, char *, XmAnyCallbackStruct *); static void FindCanCB(Widget, char *, XmAnyCallbackStruct *); static void SaveProtoCB(Widget, char *, XmAnyCallbackStruct *); static void InitSaveAlert(void); static void AlertSaveCB(Widget, char *, caddr_t); static Boolean AlertSaveWP(caddr_t); static void InitFindAlert(void); /* void CreateEditor(char *file, char *preload, char *title, int options, int autow); */ #ifdef __MAIN__ static Widget toplevel; /* Application Shell */ void PbCB(Widget w, XtPointer client_data, XtPointer call_data) { /* XtManageChild(mainwin); */ CreateEditor(NULL, "filer.c", "Editing : filer.c", 0, 0); } /*********************************************************************** ** ** ** main( argc, argv ) ** ** ** ** Program entry point. Creates shell, calls initialization funcs, ** ** and turns control over to event loop. ** ** ** ***********************************************************************/ void main( argc, argv ) int argc; char *argv[]; { Widget Pb; toplevel = XtInitialize( argv[0], "TextEdit", NULL, 0, &argc, argv ); Pb = XmCreatePushButton(toplevel, "Bouton", NULL, 0 ); XtManageChild(Pb); XtAddCallback(Pb, XmNactivateCallback, PbCB, NULL); XtRealizeWidget( toplevel ); XtMainLoop(); } #endif /* __MAIN__ */ Boolean EditWorkProc(XtPointer data) { int i; int IconState[E_NB_ICON]; static int first = 1; static Pixel TopShadow; static Pixel BottomShadow; if (first) { XtVaGetValues(EIcon[0], XmNtopShadowColor, &TopShadow, XmNbottomShadowColor, &BottomShadow, NULL); XtSetSensitive( EIcon[6], TRUE ); XtSetSensitive( EIcon[7], TRUE ); } *((int *)data) = 0; for (i = 0 ; i < E_NB_ICON ; i++) IconState[i] = FALSE; IconState[0] = TRUE; IconState[1] = changed; IconState[2] = (XmTextGetSelection(textwin) != NULL); IconState[3] = (XmTextGetSelection(textwin) != NULL); IconState[4] = TRUE; IconState[5] = TRUE; IconState[6] = justif; IconState[7] = wrap; IconState[8] = ((EditorOptions & ED_MESSAGE) != 0); /* Help */ IconState[9]= TRUE; for (i = 0 ; i < E_NB_ICON ; i++) { if (OldIconState[i] != IconState[i]) { /* Menues associated to icons */ Widget MenuW; Widget MenuX; MenuW = NULL; MenuX = NULL; switch(i) { case 1: MenuW = MSave; MenuX = MSaveAs; break; case 2: MenuW = MCut; break; case 3: MenuW = MCopy; break; case 6: MenuW = MJustif; break; case 7: MenuW = MWrap; break; } OldIconState[i] = IconState[i]; if ((i == 6) || (i == 7)) { if (IconState[i]) { XtVaSetValues(EIcon[i], XmNtopShadowColor, BottomShadow, XmNbottomShadowColor, TopShadow, NULL); } else { XtVaSetValues(EIcon[i], XmNtopShadowColor, TopShadow, XmNbottomShadowColor, BottomShadow, NULL); } if (MenuW) { /* XmToggleButtonSetValue(MenuW, IconState[i], FALSE); */ XtVaSetValues(MenuW, XmNset, IconState[i], NULL); } } else { XtSetSensitive(EIcon[i], IconState[i]); if (MenuW) XtSetSensitive(MenuW, IconState[i]); if (MenuX) XtSetSensitive(MenuX, IconState[i]); } } } if (!efoothelp) { XmString string; char buf[80]; static int old_lig = 0; static int old_col = 0; if ((old_lig != line) || (old_col != col)) { old_lig = line; old_col = col; sprintf(buf, "Line %-4d column %-4d", line+1, col+1); string = XmStringCreateSimple(buf); XtVaSetValues(footer, XmNlabelString, string, NULL); XmStringFree(string); } } return(True); } static void Update(void) { if (wp == 0) { wp = 1; XtAppAddWorkProc(app_context, EditWorkProc, &wp); } } void CreateEditor(char *file, char *preload, char *title, int options, int autow) { int i; EditorOptions = options; for (i = 0 ; i < E_NB_ICON ; i++) OldIconState[i] = -1; InitMainWindow(title); InitMenuBar(); InitWorkWindow(); XmMainWindowSetAreas( mainwin, menubar, NULL, NULL, NULL, workwin ); InitOther(); XtManageChild(mainwin); XtManageChild(editshell); changed = FALSE; if (curfile) free(curfile); curfile = NULL; if (preload) { curfile = strdup(preload); PreReadProc(); XmTextSetInsertionPosition(textwin, (XmTextPosition) MAXLONG); } if (file) { curfile = strdup(file); ReadProc(); } /* Initialisation sequences */ Update(); EditWorkProc(&wp); } void JustifyCB(Widget w, XtPointer client_data, XtPointer call_data) { justif = !justif; Update(); } void WrapCB(Widget w, XtPointer client_data, XtPointer call_data) { wrap = !wrap; Update(); } void DeliverCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("Deliver\n"); EndEditor(TRUE); } XtEventHandler EHelpCB(Widget w, XtPointer client_data, XEvent *event) { static XmString prev = NULL; if (client_data) { XmString string; if (prev) XmStringFree(prev); XtVaGetValues(footer, XmNlabelString, &prev, NULL); string = XmStringCreateSimple((char *)client_data); XtVaSetValues(footer, XmNlabelString, string, NULL); XmStringFree(string); efoothelp = TRUE; } else { if (prev) XtVaSetValues(footer, XmNlabelString, prev, NULL); efoothelp = FALSE; } return 0; } /*********************************************************************** ** ** ** InitMainWindow() ** ** ** ** This function creates the main window widget and its scrollbars. ** ** The main window is created as a child of the application shell. ** ** The scrollbars are either created along with the main-window (if ** ** its "scrollingPolicy" resource contains TRUE) or separately. ** ** ** ** This function modifies the global "mainwin", and accesses the ** ** global "toplevel". ** ** ** ***********************************************************************/ static void InitMainWindow(char *title) { int n = 0; XtSetArg(arglist[n], XmNallowShellResize, True);n++; XtSetArg(arglist[n], XmNdeleteResponse, XmDO_NOTHING); ++n; XtSetArg(arglist[n], XmNtitle, title); ++n; editshell = XmCreateDialogShell(toplevel, "cnsl", arglist, n); mainwin = XmCreateMainWindow( editshell, "MainWin", NULL, 0 ); } static void ChangedCB(Widget w, XtPointer client_data, XtPointer call_data) { changed = TRUE; Update(); } #define MAXLINE 78 static int Wrap(Widget w) { int i; int debut; int graph; int space; char *pbuf = NULL; if (col < MAXLINE) return(0); if (!justif && !wrap) return(0); pbuf = XmTextGetString(w); printf("pos = %d texte = %02x\n", pos, pbuf[pos]); debut = pos - col; printf("debut de ligne = %02x %02x\n", pbuf[debut], pbuf[debut+1]); /* Recherche le dernier espace de la ligne, sinon tronque */ graph = 0; space = -1; for (i = debut ; i < pos ; i++) { /* Ne tient pas compte des espaces de debut de ligne */ if (isgraph(pbuf[i])) graph = 1; if ((graph) && (isspace(pbuf[i]))) space = i; } printf("Espace en %d\n", space); if (space != -1) { /* remplacer l'espace par un return */ XmTextReplace(w, space, space+1, "\n"); } else { /* inserer un return */ XmTextReplace(w, debut+MAXLINE, debut+MAXLINE, "\n"); debut = pos; } /* Justification eventuelle */ if (justif) { char buffer[1024]; if (pos != debut) { n_cpy(space-debut, buffer, &pbuf[debut]); justifie(buffer); XmTextReplace(w, debut, space ,buffer); } } XtFree(pbuf); return(1); } static void DisplayLC(Widget w) { Position x, y; int xvalue, yvalue; Widget scw, hsb, vsb; Dimension fh, fw; int xbase, ybase; int xinc, yinc; { XmString string; XmFontList font; xbase = 6; XtVaGetValues(w, XmNfontList, &font, NULL); ybase = XmTextGetBaseline(w); string = XmStringCreateSimple("Wy"); XmStringExtent(font, string, &fw, &fh); XmStringFree(string); fw /= 2; /* printf("Font : w = %d h = %d\n", fw, fh); */ } pos = XmTextGetInsertionPosition(w); XmTextPosToXY(w, pos, &x, &y); /* printf("x=%d, y=%d\n", x, y); */ scw = XtParent(w); XtVaGetValues(scw, XmNverticalScrollBar, &vsb, XmNhorizontalScrollBar, &hsb, NULL); if (hsb) XtVaGetValues(hsb, XmNvalue, &xvalue, XmNincrement, &xinc, NULL); else { xvalue = 0; xinc = 1; } if (vsb) XtVaGetValues(vsb, XmNvalue, &yvalue, XmNincrement, &yinc, NULL); else { yvalue = 0; yinc = 1; } /* printf("xvalue = %d %d yvalue = %d %d\n", xvalue, xinc, yvalue, yinc);*/ line = (yvalue/1) + ((y - ybase) / fh); col = (xvalue/fw) + ((x - xbase) / fw); /* printf("lig = %d col = %d\n", line, col); */ Update(); } static void KbHit(Widget w, caddr_t client_data, XEvent *event) { char buf[10]; KeySym keysym; XLookupString(&event->xkey, buf, 1, &keysym, NULL); /* printf("buf[0]=%02x keysym=%x b=%d\n", buf[0], keysym, IsKeypadKey(keysym));*/ if ((keysym < 0xff) && (Wrap(w))) DisplayLC(w); } static void PosMoved(Widget w, caddr_t client_data, XEvent *event) { DisplayLC(w); } /*********************************************************************** ** ** ** InitWorkWindow() ** ** ** ** This function creates the work window and its children. The ** ** work window is created as the child of the main window. ** ** ** ** This function modifies the globals "workwin" and "textwin", and ** ** accesses the global "mainwin". ** ** ** ***********************************************************************/ static void InitWorkWindow() { int n = 0; XmString string; workwin = XmCreateForm( mainwin, "WorkWin", arglist, n ); n = 0; XtSetArg(arglist[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg(arglist[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(arglist[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(arglist[n], XmNorientation, XmHORIZONTAL);n++; toolbar = XmCreateRowColumn( workwin, "tool_bar", arglist, n ); XtManageChild( toolbar ); EIcon[0] = add_item(TOOLBUTTON, toolbar, "Open", FileMenuCB, "Opn", "Opens a file", EHelpCB); EIcon[1] = add_item(TOOLBUTTON, toolbar, "Save", FileMenuCB, "Sav", "Saves the edited file", EHelpCB); EIcon[2] = add_item(TOOLBUTTON, toolbar, "Cut", EditMenuCB, "Cut", "Cuts the selection", EHelpCB); EIcon[3] = add_item(TOOLBUTTON, toolbar, "Copy", EditMenuCB, "Cpy", "Copies the selection to the clipboard", EHelpCB); EIcon[4] = add_item(TOOLBUTTON, toolbar, "Paste", EditMenuCB, "Pst", "Pastes the clipboard to the cursor position", EHelpCB); EIcon[5] = add_item(TOOLBUTTON, toolbar, "Replace", EditMenuCB, "Fnd", "Finds and replace the selected text", EHelpCB); EIcon[6] = add_item(TOOLBUTTON, toolbar, "Justify", JustifyCB, NULL, "Justifies the text", EHelpCB); EIcon[7] = add_item(TOOLBUTTON, toolbar, "Wrap", WrapCB, NULL, "Auto wraps at 78 characters", EHelpCB); EIcon[8] = add_item(TOOLBUTTON, toolbar, "Deliver", DeliverCB, NULL, "Delivers the message", EHelpCB); EIcon[9] = add_item(TOOLBUTTON, toolbar, "B16", NULL, NULL, "On-line help", EHelpCB); XtVaSetValues(toolbar, XmNmenuHelpWidget, EIcon[9], NULL); if (EditorOptions & ED_MESSAGE) { XtUnmanageChild(EIcon[0]); } else { XtUnmanageChild(EIcon[8]); } string = XmStringCreateSimple(" "); n = 0; XtSetArg(arglist[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(arglist[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(arglist[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(arglist[n], XmNlabelString, string);n++; footer = XmCreateLabel(workwin, "footer", arglist, n); XtManageChild(footer); XmStringFree(string); n = 0; XtSetArg(arglist[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg(arglist[n], XmNtopWidget, toolbar); n++; XtSetArg(arglist[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg(arglist[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg(arglist[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(arglist[n], XmNbottomWidget, footer);n++; textwin = XmCreateScrolledText(workwin, "TextWin", arglist, n); XtManageChild( textwin ); XtAddCallback(textwin, XmNvalueChangedCallback, ChangedCB, NULL); XtAddEventHandler(textwin, KeyPressMask, FALSE, (XtPointer)KbHit, NULL); XtAddEventHandler(textwin, ButtonReleaseMask|KeyReleaseMask, FALSE, (XtPointer)PosMoved, NULL); XtManageChild( workwin ); } /*********************************************************************** ** ** ** InitMenuBar() ** ** ** ** This function creates the menu bar and all pulldown menus. The ** ** menu bar is created as the child of the main window. ** ** ** ** This function modifies the global "menubar", and accesses the ** ** global "mainwin". ** ** ** ***********************************************************************/ static void InitMenuBar(void) { menubar = XmCreateMenuBar( mainwin, "menu_bar", NULL, 0 ); XtManageChild( menubar ); InitFileMenu(); InitEditMenu(); InitViewMenu(); InitOptionMenu(); InitHelpMenu(); } /*********************************************************************** ** ** ** InitFileMenu() ** ** ** ** Creates the File menu: cascade button, pull-down menu pane, and ** ** all menu-pane choices. Attaches callbacks to menu-pane choices. ** ** ** ***********************************************************************/ static void InitFileMenu(void) { Widget topic, pane, choices[8]; pane = XmCreatePulldownMenu( menubar, "FilePane", NULL, 0 ); choices[0] = XmCreatePushButton( pane, "File_New", NULL, 0 ); choices[1] = XmCreatePushButton( pane, "File_Open", NULL, 0 ); choices[2] = XmCreatePushButton( pane, "File_Insert", NULL, 0 ); choices[3] = XmCreatePushButton( pane, "File_Save", NULL, 0 ); choices[4] = XmCreatePushButton( pane, "File_SaveAs", NULL, 0 ); choices[5] = XmCreateSeparator( pane, "File_Sep1", NULL, 0 ); choices[6] = XmCreatePushButton( pane, "File_Deliver", NULL, 0 ); choices[7] = XmCreatePushButton( pane, "File_Exit", NULL, 0 ); XtManageChildren( choices, 8 ); XtSetArg( arglist[0], XmNsubMenuId, pane ); topic = XmCreateCascadeButton( menubar, "FileTopic", arglist, 1 ); XtManageChild( topic ); XtAddCallback( choices[0], XmNactivateCallback, (XtPointer)FileMenuCB, "New" ); XtAddCallback( choices[1], XmNactivateCallback, (XtPointer)FileMenuCB, "Opn" ); XtAddCallback( choices[2], XmNactivateCallback, (XtPointer)FileMenuCB, "Ins" ); XtAddCallback( choices[3], XmNactivateCallback, (XtPointer)FileMenuCB, "Sav" ); XtAddCallback( choices[4], XmNactivateCallback, (XtPointer)FileMenuCB, "SAs" ); XtAddCallback( choices[6], XmNactivateCallback, (XtPointer)FileMenuCB, "Del" ); XtAddCallback( choices[7], XmNactivateCallback, (XtPointer)FileMenuCB, "Ext" ); if (EditorOptions & ED_MESSAGE) { XtSetSensitive( choices[0], FALSE ); XtSetSensitive( choices[1], FALSE ); XtSetSensitive( choices[3], FALSE ); wrap = justif = TRUE; } else { XtSetSensitive( choices[6], FALSE ); wrap = justif = FALSE; } MSave = choices[3]; MSaveAs = choices[4]; printf("wrap=%d justif=%d\n", wrap, justif); } /*********************************************************************** ** ** ** InitEditMenu() ** ** ** ** Creates the Edit menu: cascade button, pull-down menu pane, and ** ** all menu-pane choices. Attaches callbacks to menu-pane choices. ** ** ** ***********************************************************************/ static void InitEditMenu(void) { Widget topic, pane, choices[7]; pane = XmCreatePulldownMenu( menubar, "Edit_Pane", NULL, 0 ); choices[0] = XmCreatePushButton( pane, "Edit_Cut", NULL, 0 ); choices[1] = XmCreatePushButton( pane, "Edit_Copy", NULL, 0 ); choices[2] = XmCreatePushButton( pane, "Edit_Paste", NULL, 0 ); choices[3] = XmCreateSeparator( pane, "Edit_Sep1", NULL, 0 ); choices[4] = XmCreatePushButton( pane, "Edit_Find", NULL, 0 ); XtManageChildren( choices, 5 ); XtSetArg( arglist[0], XmNsubMenuId, pane ); topic = XmCreateCascadeButton( menubar, "EditTopic", arglist, 1 ); XtManageChild( topic ); XtAddCallback( choices[0], XmNactivateCallback, (XtPointer)EditMenuCB, "Cut" ); XtAddCallback( choices[1], XmNactivateCallback, (XtPointer)EditMenuCB, "Cpy" ); XtAddCallback( choices[2], XmNactivateCallback, (XtPointer)EditMenuCB, "Pst" ); XtAddCallback( choices[4], XmNactivateCallback, (XtPointer)EditMenuCB, "Fnd" ); XtSetSensitive( choices[2], FALSE ); MCopy = choices[1]; MCut = choices[0]; } /*********************************************************************** ** ** ** InitViewMenu() ** ** ** ** Creates the View menu: cascade button, pull-down menu pane, and ** ** all menu-pane choices. Attaches callbacks to menu-pane choices. ** ** ** ***********************************************************************/ static void InitViewMenu(void) { Widget pane, choices[4]; pane = XmCreatePulldownMenu( menubar, "View_Pane", NULL, 0 ); choices[0] = XmCreatePushButton( pane, "View_Top", NULL, 0 ); choices[1] = XmCreatePushButton( pane, "View_Bot", NULL, 0 ); /* choices[2] = XmCreateSeparator( pane, "View_Sep1", NULL, 0 ); choices[3] = XmCreatePushButton( pane, "View_Page", NULL, 0 ); */ XtManageChildren( choices, 2 ); XtAddCallback( choices[0], XmNactivateCallback, (XtPointer)ViewMenuCB, "Top" ); XtAddCallback( choices[1], XmNactivateCallback, (XtPointer)ViewMenuCB, "Bot" ); /* XtSetArg( arglist[0], XmNsubMenuId, pane ); topic = XmCreateCascadeButton( menubar, "ViewTopic", arglist, 1 ); XtManageChild( topic ); */ } /*********************************************************************** ** ** ** InitOptionMenu() ** ** ** ** Creates the Option menu: cascade button, pull-down menu pane, and ** ** all menu-pane choices. Attaches callbacks to menu-pane choices. ** ** ** ***********************************************************************/ static void InitOptionMenu() { Arg args[1]; Widget topic, pane, choices[1]; pane = XmCreatePulldownMenu( menubar, "Option_Pane", NULL, 0 ); XtSetArg(args[0], XmNvisibleWhenOff, True); choices[0] = XmCreateToggleButton( pane, "Option_Justif", args, 1 ); choices[1] = XmCreateToggleButton( pane, "Option_Wrap", args, 1 ); XtManageChildren( choices, 2 ); XtAddCallback( choices[0], XmNvalueChangedCallback, JustifyCB, "Top" ); XtAddCallback( choices[1], XmNvalueChangedCallback, WrapCB, "Bot" ); XtSetArg( arglist[0], XmNsubMenuId, pane ); topic = XmCreateCascadeButton( menubar, "OptionTopic", arglist, 1 ); XtManageChild( topic ); MJustif = choices[0]; MWrap = choices[1]; } /*********************************************************************** ** ** ** InitHelpMenu() ** ** ** ** Creates the Help menu: cascade button, pull-down menu pane, and ** ** all menu-pane choices. Attaches callbacks to menu-pane choices. ** ** ** ***********************************************************************/ static void InitHelpMenu() { Widget topic, pane, choices[1]; pane = XmCreatePulldownMenu( menubar, "Help_Pane", NULL, 0 ); choices[0] = XmCreateLabel( pane, "Help_Lbl", NULL, 0 ); XtManageChildren( choices, 1 ); XtSetArg( arglist[0], XmNsubMenuId, pane ); topic = XmCreateCascadeButton( menubar, "HelpTopic", arglist, 1 ); XtManageChild( topic ); XtSetArg( arglist[0], XmNmenuHelpWidget, topic ); XtSetValues( menubar, arglist, 1 ); } static void EndEditor(int send) { /* exit( 0 ); */ XtUnmanageChild(mainwin); XtDestroyWidget(editshell); #ifndef __MAIN__ if (EditorOptions & ED_MESSAGE) { if (send) { char *txtbuf = XmTextGetString( textwin ); int size = strlen(txtbuf); int i; for (i = 0 ; i < size ; i++) { if (txtbuf[i] == '\n') txtbuf[i] = '\r'; } record_message(txtbuf, size); XtFree( txtbuf ); } else { record_message(NULL, 0); } } if ((EditorOptions & ED_MESSAGE) || (EditorOptions & ED_EDITMSG)) end_edit(FALSE); else end_edit(TRUE); #endif } /*********************************************************************** ** ** ** FileMenuCB( w, client_data, call_data ) ** ** ** ** Callback procedure for the "File" pull-down. This function is ** ** called when any of the file menu buttons are activated. The ** ** particular operation is identified by a string accessed by the ** ** "client_data" param. ** ** ** ** Note: This callback is only invoked on Activate, so the call ** ** data (which describes the reason) is superfluous. It is ** ** therefore not declared as a specific type in the func hdr. ** ** ** ***********************************************************************/ static void FileMenuCB( w, client_data, call_data ) Widget w; char *client_data; caddr_t call_data; { if (!strcmp(client_data, "New")) FileNew(); else if (!strcmp(client_data, "Opn")) FileOpen(); else if (!strcmp(client_data, "Ins")) FileInsert(); else if (!strcmp(client_data, "Sav")) FileSave(); else if (!strcmp(client_data, "SAs")) FileSaveAs(); else if (!strcmp(client_data, "Del")) { EndEditor(FALSE); } else if (!strcmp(client_data, "Ext")) { if (changed) XtManageChild( save_alert ); else EndEditor(FALSE); } } /*********************************************************************** ** ** ** ViewMenuCB( w, client_data, call_data ) ** ** ** ** Callback procedure for the "Edit" pull-down. This function is ** ** called when any of the menu buttons are activated. The choice ** ** is identified by a string pointed-to by the "client_data" parm. ** ** "client_data" param. ** ** ** ** Note: This callback is only invoked on Activate, so the call ** ** data (which describes the reason) is superfluous. It is ** ** therefore not declared as a specific type in the func hdr. ** ** ** ***********************************************************************/ static void ViewMenuCB( w, client_data, call_data ) Widget w; char *client_data; XmAnyCallbackStruct *call_data; { if (!strcmp(client_data, "Top")) { XmTextSetInsertionPosition(textwin, (XmTextPosition) 0); } else if (!strcmp(client_data, "Bot")) { XmTextSetInsertionPosition(textwin, (XmTextPosition) MAXLONG); } } /*********************************************************************** ** ** ** EditMenuCB( w, client_data, call_data ) ** ** ** ** Callback procedure for the "Edit" pull-down. This function is ** ** called when any of the menu buttons are activated. The choice ** ** is identified by a string pointed-to by the "client_data" parm. ** ** "client_data" param. ** ** ** ** Note: This callback is only invoked on Activate, so the call ** ** data (which describes the reason) is superfluous. It is ** ** therefore not declared as a specific type in the func hdr. ** ** ** ***********************************************************************/ static void EditMenuCB( w, client_data, call_data ) Widget w; char *client_data; XmAnyCallbackStruct *call_data; { XButtonEvent *event = (XButtonEvent *)call_data->event; if (!strcmp(client_data, "Cut")) XmTextCut( textwin, event->time ); else if (!strcmp(client_data, "Cpy")) XmTextCopy( textwin, event->time ); else if (!strcmp(client_data, "Pst")) XmTextPaste( textwin ); else if (!strcmp(client_data, "Del")) { } else if (!strcmp(client_data, "Fnd")) { ManageFindDB(); } else if (!strcmp(client_data, "Rpl")) { } } /*********************************************************************** ** ** ** InitFiler() ** ** ** ** This function initializes the filer module: it clears the current ** ** filename, disables the File/Save menu choice, and creates the ** ** Standard File dialog. ** ** ** ***********************************************************************/ void InitFiler() { stdfile_db = XmCreateFileSelectionDialog( mainwin, "StdFile", NULL, 0 ); XtAddCallback( stdfile_db, XmNokCallback, (XtPointer)SFProc, NULL ); XtAddCallback( stdfile_db, XmNcancelCallback, (XtPointer)UnmanageStdFile, NULL ); XtAddCallback( stdfile_db, XmNhelpCallback, (XtPointer)UnmanageStdFile, NULL ); } /*********************************************************************** ** ** ** ManageStdFile( title, proc, defspec ) ** ** ** ** This function manages the Standard File dialog. It sets the ** ** dialog's title to the string passed as "title", installs the ** ** function passed as "proc" in the "fileproc" variable (it gets ** ** called by the StdFile callback handler), and stores the string ** ** passed in "defspec" in the "dirSpec" resource. ** ** ** ***********************************************************************/ static void ManageStdFile( title, proc, defspec ) char *title; XtCallbackProc proc; char *defspec; { XmString temp1, temp2; temp1 = XmStringCreate( title, XmSTRING_DEFAULT_CHARSET ); if (defspec == NULL) temp2 = XmStringCreate( "", XmSTRING_DEFAULT_CHARSET ); else temp2 = XmStringCreate( defspec, XmSTRING_DEFAULT_CHARSET ); XtSetArg( arglist[0], XmNdialogTitle, temp1 ); XtSetArg( arglist[1], XmNdirSpec, temp2 ); XtSetValues( stdfile_db, arglist, 2 ); XmStringFree( temp1 ); XmStringFree( temp2 ); XmFileSelectionDoSearch( stdfile_db, NULL ); XtManageChild( stdfile_db ); fileproc = (XtPointer)proc; } /*********************************************************************** ** ** ** UnmanageStdFile() ** ** ** ** This function unmanages the Standard File dialog. It is attached ** ** to the "Cancel" and "Help" buttons, because XmFileSelectionBox ** ** does not handle the "autoUnmanage" resource. ** ** ** ***********************************************************************/ static void UnmanageStdFile() { XtUnmanageChild( stdfile_db ); } /*********************************************************************** ** ** ** SFProc( w, client_data, call_data ) ** ** ** ** This function is the callback procedure for the Standard File ** ** dialog. It stores the chosen filename in "curfile", and then ** ** calls the function pointed-to by "fileproc". ** ** ** ***********************************************************************/ static void SFProc(w, client_data, call_data ) Widget w; caddr_t client_data; XmFileSelectionBoxCallbackStruct *call_data; { if (curfile != NULL) free( curfile ); XmStringGetLtoR( call_data->value, XmSTRING_DEFAULT_CHARSET, &curfile ); UnmanageStdFile(); (*fileproc)(); } /*********************************************************************** ** ** ** ReadProc() ** ** ** ** This function reads the file specified by "curfile" into the ** ** editor's text buffer. ** ** ** ***********************************************************************/ static void ReadProc() { FILE *infile = fopen( curfile, "rt" ); char *txtbuf; char *ptr; long size; int i; if (infile == NULL) /* Should display error */ return; fseek( infile, 0L, 2 ); size = ftell( infile ); rewind( infile ); txtbuf = XtMalloc( size+1 ); fread( txtbuf, sizeof(char), size, infile ); ptr = txtbuf; for (i = 0 ; i < size ; i++) { if (txtbuf[i] == '\r') continue; *ptr++ = txtbuf[i]; } *ptr = '\0'; XmTextSetString( textwin, txtbuf ); XtFree( txtbuf ); changed = FALSE; Update(); } /*********************************************************************** ** ** ** PreReadProc() ** ** ** ** This function reads the file specified by "curfile" into the ** ** editor's text buffer. Each line is preceeded with ">" ** ** ** ***********************************************************************/ #define SBUF 65000 static void PreReadProc() { FILE *infile; FILE *tmpfile; char *txtbuf; long size; char tmpname[80]; sprintf(tmpname, "/tmp/xfbbtmp.%d", getpid()); infile = fopen( curfile, "rt" ); if (infile == NULL) /* Should display error */ return; tmpfile = fopen( tmpname, "w+t"); if (tmpfile == NULL) { perror("open"); /* Should display error */ return; } txtbuf = XtMalloc( SBUF+1 ); txtbuf[0] = '>'; while (fgets(txtbuf+1, SBUF, infile)) { fputs(txtbuf, tmpfile); } XtFree( txtbuf ); fclose(infile); fseek( tmpfile, 0L, 2 ); size = ftell( tmpfile ); rewind( tmpfile ); txtbuf = XtMalloc( size+1 ); fread( txtbuf, sizeof(char), size, tmpfile ); XmTextSetString( textwin, txtbuf ); XtFree( txtbuf ); fclose ( tmpfile ); unlink( tmpname ); changed = FALSE; Update(); } /*********************************************************************** ** ** ** InsertProc() ** ** ** ** This function reads the file specified by "curfile" into the ** ** editor's text buffer. ** ** ** ***********************************************************************/ static void InsertProc() { FILE *infile = fopen( curfile, "rt" ); char *txtbuf; char *ptr; long size; int i; XmTextPosition position; if (infile == NULL) /* Should display error */ return; fseek( infile, 0L, 2 ); size = ftell( infile ); rewind( infile ); txtbuf = XtMalloc( size+1 ); fread( txtbuf, sizeof(char), size, infile ); ptr = txtbuf; for (i = 0 ; i < size ; i++) { if (txtbuf[i] == '\r') continue; *ptr++ = txtbuf[i]; } *ptr = '\0'; position = XmTextGetInsertionPosition( textwin); XmTextInsert( textwin, position, txtbuf ); XtFree( txtbuf ); changed = TRUE; Update(); } /*********************************************************************** ** ** ** WriteProc() ** ** ** ** This function writes the editor's text buffer into a file named ** ** by "curfile". ** ** ** ***********************************************************************/ static void WriteProc() { FILE *outfile; char *txtbuf; long size; outfile = fopen( curfile, "wt" ); if (outfile == NULL) /* Should display error */ return; txtbuf = XmTextGetString( textwin ); size = strlen(txtbuf); fwrite( txtbuf, sizeof(char), size, outfile ); fclose( outfile ); XtFree( txtbuf ); changed = FALSE; Update(); } /*********************************************************************** ** ** ** FileNew() ** ** ** ** This function is called from the File/New menu choice. It clears ** ** the text buffer, resets the current file, and disables the File/ ** ** Save menu choice. ** ** ** ***********************************************************************/ void FileNew() { XmTextSetString( textwin, "" ); if (curfile != NULL) free( curfile ); curfile = NULL; changed = FALSE; Update(); } /*********************************************************************** ** ** ** FileOpen() ** ** ** ** This function is called from the File/Open menu choice. All it ** ** does is invoke the Standard File dialog -- SFProc and ReadProc ** ** do the real work. ** ** ** ***********************************************************************/ void FileOpen() { ManageStdFile( "Open...", (XtPointer)ReadProc, NULL ); } /*********************************************************************** ** ** ** FileInsert() ** ** ** ** This function is called from the File/Open menu choice. All it ** ** does is invoke the Standard File dialog -- SFProc and ReadProc ** ** do the real work. ** ** ** ***********************************************************************/ void FileInsert() { ManageStdFile( "Insert...", (XtPointer)InsertProc, NULL ); } /*********************************************************************** ** ** ** FileSave() ** ** ** ** This function is a link to WriteProc(), which writes the text ** ** buffer into a file using the current filename. ** ** ** ***********************************************************************/ void FileSave() { if (curfile == NULL) FileSaveAs(); else WriteProc(); } /*********************************************************************** ** ** ** FileSaveAs() ** ** ** ** This function is called from the File/Save-As menu choice. It ** ** invokes the Standard File dialog, and links it to WriteProc. ** ** ** ***********************************************************************/ void FileSaveAs() { ManageStdFile( "Save As...", (XtPointer)WriteProc, curfile ); } /*********************************************************************** ** ** ** InitFindDB() ** ** ** ** Creates the "Find" dialog box, which is controlled by the ** ** Edit/Find... pull-down menu choice. ** ** ** ** Modifies the global variable "find_db", and local variables ** ** "find_txt", "find_ok_btn", and "find_nxt_btn". ** ** ** ***********************************************************************/ void InitFindDB() { Widget temp; find_db = XmCreateBulletinBoardDialog( mainwin, "FindDB", NULL, 0 ); find_lbl = XmCreateLabel( find_db, "Find_Lbl", NULL, 0 ); XtManageChild( find_lbl ); find_txt = XmCreateText( find_db, "Find_Txt", NULL, 0 ); XtManageChild( find_txt ); frep_lbl = XmCreateLabel( find_db, "Rep_Lbl", NULL, 0 ); XtManageChild( frep_lbl ); frep_txt = XmCreateText( find_db, "Rep_Txt", NULL, 0 ); XtManageChild( frep_txt ); find_sep = XmCreateSeparator( find_db, "Find_Sep", NULL, 0 ); XtManageChild( find_sep ); find_btn_1 = XmCreatePushButton( find_db, "Find_Btn1", NULL, 0 ); XtManageChild( find_btn_1 ); find_btn_2 = XmCreatePushButton( find_db, "Find_Btn2", NULL, 0 ); XtManageChild( find_btn_2 ); find_btn_3 = XmCreatePushButton( find_db, "Find_Btn3", NULL, 0 ); XtManageChild( find_btn_3 ); XtAddCallback( find_btn_1, XmNactivateCallback, (XtPointer)FindCB, NULL ); XtAddCallback( find_btn_2, XmNactivateCallback, (XtPointer)FindCanCB, NULL ); XtAddCallback( find_btn_3, XmNactivateCallback, (XtPointer)ReplaceCB, NULL ); XtSetArg( arglist[0], XmNdefaultButton, find_btn_1 ); XtSetValues( find_db, arglist, 1 ); find_str = XmStringCreate( "Find", XmSTRING_DEFAULT_CHARSET ); can_str = XmStringCreate( "Cancel", XmSTRING_DEFAULT_CHARSET ); next_str = XmStringCreate( "Next", XmSTRING_DEFAULT_CHARSET ); repl_str = XmStringCreate( "Replace",XmSTRING_DEFAULT_CHARSET ); done_str = XmStringCreate( "Done", XmSTRING_DEFAULT_CHARSET ); cantfind_db = XmCreateMessageDialog( mainwin, "CantFind", NULL, 0 ); temp = XmMessageBoxGetChild( cantfind_db, XmDIALOG_CANCEL_BUTTON ); XtUnmanageChild( temp ); temp = XmMessageBoxGetChild( cantfind_db, XmDIALOG_HELP_BUTTON ); XtUnmanageChild( temp ); } /*********************************************************************** ** ** ** ManageFindDB() ** ** ** ** Called when the dialog box is first presented, this function ** ** manages the DB and sets the labels of its buttons to "Find" ** ** and "Cancel". It also sets the "finding" flag FALSE, for the ** ** first call to FindCB. ** ** ** ***********************************************************************/ void ManageFindDB() { char *findstr; XtManageChild( find_db ); _XmGrabTheFocus( find_txt ); findstr = XmTextGetSelection( textwin ); if (findstr) { XtSetArg( arglist[0], XmNvalue, findstr ); XtSetValues( find_txt, arglist, 1 ); } XtSetArg( arglist[0], XmNlabelString, find_str ); XtSetValues( find_btn_1, arglist, 1 ); XtSetArg( arglist[0], XmNlabelString, can_str ); XtSetValues( find_btn_2, arglist, 1 ); XtSetArg( arglist[0], XmNlabelString, repl_str ); XtSetValues( find_btn_3, arglist, 1 ); XtSetSensitive( find_btn_3, FALSE); finding = FALSE; fd_start = fd_end = -1; } /*********************************************************************** ** ** ** FindCB( w, client_data, call_data ) ** ** ** ** Called from the "Find" or "Next" buttons of the Find DB. This ** ** function searches for the first/next occurrence of the search ** ** string. The "client_data" param points to a string -- "Fnd" or ** ** "Nxt" -- which indicates which button this is called from; it ** ** must initialize its local variables for the first call. ** ** ** ** In operation, this function searches for the next occurrence of ** ** the target string in the text buffer, and selects it. ** ** ** ***********************************************************************/ static void FindCB( w, client_data, call_data ) Widget w; char *client_data; XmAnyCallbackStruct *call_data; { char *findstr, *txtbuf, *txtptr; if (!finding) { finding = TRUE; curpos = 0; XtSetArg( arglist[0], XmNlabelString, next_str ); XtSetValues( find_btn_1, arglist, 1 ); XtSetArg( arglist[0], XmNlabelString, done_str ); XtSetValues( find_btn_2, arglist, 1 ); } findstr = XmTextGetString( find_txt ); txtbuf = XmTextGetString( textwin ); txtptr = StrFind( (txtbuf + curpos), findstr ); if (txtptr == NULL) { XtUnmanageChild( find_db ); XtManageChild( cantfind_db ); } else { fd_start = txtptr - txtbuf; fd_end = fd_start + strlen(findstr); XtSetArg( arglist[0], XmNcursorPosition, fd_end ); XtSetValues( textwin, arglist, 1 ); XmTextSetSelection( textwin, fd_start, fd_end, call_data->event->xbutton.time ); curpos = fd_start + 1; XtSetSensitive( find_btn_3, TRUE); } XtFree( txtbuf ); XtFree( findstr ); DisplayLC(textwin); } /*********************************************************************** ** ** ** ReplaceCB( w, client_data, call_data ) ** ** ** ** Called from the "Replace" button of the Find DB. This ** ** replaces the found text. ** ** ** ***********************************************************************/ static void ReplaceCB( w, client_data, call_data ) Widget w; char *client_data; XmAnyCallbackStruct *call_data; { char *replstr; if (fd_start == -1) return; replstr = XmTextGetString( frep_txt ); XmTextReplace( textwin, fd_start, fd_end, replstr ); curpos += (strlen(replstr) - (fd_end - fd_start)) ; XtFree( replstr ); DisplayLC(textwin); } /*********************************************************************** ** ** ** FindCanCB( w, client_data, call_data ) ** ** ** ** Called from the "Cancel" or "OK" buttons of the Find DB. This ** ** simply unmanages the DB. ** ** ** ***********************************************************************/ static void FindCanCB( w, client_data, call_data ) Widget w; char *client_data; XmAnyCallbackStruct *call_data; { XtUnmanageChild( find_db ); } /*********************************************************************** ** ** ** InitSaveProto() ** ** ** ** This function sets up the callback for the WM_DELETE_WINDOW ** ** protocol. To make this work, it must also modify the shell's ** ** deleteResponse resource -- otherwise the shell kills the job. ** ** ** ***********************************************************************/ void InitSaveProto(void) { a_del_win = XInternAtom( XtDisplay(editshell), "WM_DELETE_WINDOW", FALSE ); XmAddWMProtocolCallback( editshell, a_del_win, (XtPointer)SaveProtoCB, NULL ); XtSetArg( arglist[0], XmNdeleteResponse, XmDO_NOTHING ); XtSetValues( editshell, arglist, 1 ); InitSaveAlert(); } /*********************************************************************** ** ** ** InitSaveAlert() ** ** ** ** Creates the "Quit without Saving?" message box. ** ** ** ** Note: The "Help" button is changed to "Quit" for this dialog. ** ** ** ***********************************************************************/ static void InitSaveAlert() { Widget temp; if (EditorOptions & ED_MESSAGE) { save_alert = XmCreateWarningDialog( mainwin, "SendAlert", NULL, 0 ); temp = XmMessageBoxGetChild( save_alert, XmDIALOG_OK_BUTTON ); XtUnmanageChild(temp); temp = XmMessageBoxGetChild( save_alert, XmDIALOG_HELP_BUTTON ); XtAddCallback( temp, XmNactivateCallback, (XtPointer)AlertSaveCB, "Quit" ); } else { save_alert = XmCreateWarningDialog( mainwin, "SaveAlert", NULL, 0 ); temp = XmMessageBoxGetChild( save_alert, XmDIALOG_OK_BUTTON ); XtAddCallback( temp, XmNactivateCallback, (XtPointer)AlertSaveCB, "Save" ); temp = XmMessageBoxGetChild( save_alert, XmDIALOG_HELP_BUTTON ); XtAddCallback( temp, XmNactivateCallback, (XtPointer)AlertSaveCB, "Quit" ); } } /*********************************************************************** ** ** ** SaveProtoCB( w, client_data, call_data ) ** ** ** ** This function handles the callback for the WM_DELETE_WINDOW ** ** protocol. It displays a dialog, which queries whether or not ** ** the workspace should be saved. ** ** ** ***********************************************************************/ static void SaveProtoCB( w, client_data, call_data ) Widget w; caddr_t client_data; XmAnyCallbackStruct *call_data; { if (changed) XtManageChild( save_alert ); else EndEditor(FALSE); } /*********************************************************************** ** ** ** AlertSaveCB( w, client_data, call_data ) ** ** ** ** Callback for the "Quit without Saving?" message box. ** ** This function either quits or saves then quits. ** ** ** ***********************************************************************/ static void AlertSaveCB( w, client_data, call_data ) Widget w; char *client_data; caddr_t call_data; { if (!strcmp(client_data, "Save")) { changed = FALSE; XtAppAddWorkProc(app_context, (XtPointer)AlertSaveWP, NULL ); FileSave(); } else EndEditor(FALSE); } /*********************************************************************** ** ** ** AlertSaveWP( client_data ) ** ** ** ** Workproc to handle wait while user saves file. This function ** ** simply waits until the global variable "saved" becomes TRUE. ** ** ** ***********************************************************************/ static Boolean AlertSaveWP( client_data ) caddr_t client_data; { if (!changed) { EndEditor(FALSE); return(TRUE); } else return( FALSE ); } /*********************************************************************** ** ** ** InitOther() ** ** ** ** This function performs other program initialization, such as ** ** loading any default data. ** ** ** ***********************************************************************/ void InitOther(void) { InitAlerts(); InitFiler(); InitFindDB(); InitSaveProto(); } /*********************************************************************** ** ** ** StrFind( s1, s2 ) ** ** ** ** Returns a pointer to the first occurrence of string s2 in ** ** string s1. Returns NULL is s2 does not occur in s1. ** ** ** ***********************************************************************/ char *StrFind( s1, s2 ) char *s1; char *s2; { char *tmps1; char *tmps2; for ( ; *s1 != '\0' ; s1++) { if (*s1 == *s2) { tmps1 = s1; tmps2 = s2; for ( ; (*s1 == *tmps2) && (*s1 != '\0') ; s1++, tmps2++) ; if (*tmps2 == '\0') return( tmps1 ); } } return( NULL ); } /*********************************************************************** ** ** ** InitAlerts() ** ** ** ** Creates all message boxes. ** ** ** ***********************************************************************/ void InitAlerts(void) { InitFindAlert(); } /*********************************************************************** ** ** ** InitFindAlert() ** ** ** ** Creates the "Search Failed" message box for Find. ** ** ** ***********************************************************************/ static void InitFindAlert(void) { Widget temp; find_alert = XmCreateMessageDialog( mainwin, "FindAlert", NULL, 0 ); temp = XmMessageBoxGetChild( find_alert, XmDIALOG_CANCEL_BUTTON ); XtUnmanageChild( temp ); temp = XmMessageBoxGetChild( find_alert, XmDIALOG_HELP_BUTTON ); XtUnmanageChild( temp ); } /*********************************************************************** ** ** ** AlertFindFailed() ** ** ** ** Manages the "Search Failed" message box. ** ** ** ***********************************************************************/ /* void AlertFindFailed(void) { XtManageChild( find_alert ); } */ fbb-7.0.10/src/X11/xfbbX.c0000644000175000017500000012774413613360505011647 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #define __MAIN__ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define TOT_VOIES 256 #define SEPARATOR 0 #define BUTTON 1 #define TOGGLE 2 #define RADIO 3 #define TOOLBUTTON 4 static void HelpAct (Widget, XEvent *, String *, Cardinal *); static void ConsoleAct (Widget, XEvent *, String *, Cardinal *); static void DisconnAct (Widget, XEvent *, String *, Cardinal *); static void PendingAct (Widget, XEvent *, String *, Cardinal *); static void MonitorAct (Widget, XEvent *, String *, Cardinal *); static void SetCallAct (Widget, XEvent *, String *, Cardinal *); static void ProgTncAct (Widget, XEvent *, String *, Cardinal *); static void GatewayAct (Widget, XEvent *, String *, Cardinal *); static void TalkToAct (Widget, XEvent *, String *, Cardinal *); static void MsgScanAct (Widget, XEvent *, String *, Cardinal *); static void EditorAct (Widget, XEvent *, String *, Cardinal *); static void ListCnxAct (Widget, XEvent *, String *, Cardinal *); static void SndTextAct (Widget, XEvent *, String *, Cardinal *); static void ConnectItem (int, char *); static void makekey (char *, char *, char *); static void end_wait (void); static void cursor_wait (void); static XtActionsRec actionsTable[] = { {"Help", HelpAct}, {"Console", ConsoleAct}, {"Disconnect", DisconnAct}, {"PendingFwd", PendingAct}, {"Monitor", MonitorAct}, {"SetCall", SetCallAct}, {"ProgTnc", ProgTncAct}, {"Gateway", GatewayAct}, {"TalkTo", TalkToAct}, {"MsgScan", MsgScanAct}, {"Editor", EditorAct}, {"ListCnx", ListCnxAct}, {"SndText", SndTextAct} }; #define NB_PITEM 4 #define NB_ICON 16 #define NB_INIT_B 11 static int prints = 0; static int comm_ok = 1; static int filters; static int fbb_sock = -1; static int first = 1; static XtInputId InputId = 0; static Widget MCons; static Widget MAllc; static Widget MMon; static FILE *p_fptr; static int r_index; static XtAppContext app_context; static Pixel df_pixel; static Pixel rf_pixel; static Pixel vf_pixel; static Pixel bf_pixel; static Pixel no_pixel; static Pixel rc_pixel; static Pixel vc_pixel; static Pixel bc_pixel; static XmRendition r_rend[10]; static Widget BIcon[NB_ICON]; static Widget form; static Widget Footer; static int foothelp; static Widget ConnectLabel; static Widget ConnectList; static Widget MsgsToggle; static Widget StatusToggle; static Widget MenuBar; static Widget ToolBar; static Widget MenuWindow; static Widget MenuRemote; static Widget MenuConfig; static Widget MenuHelp; static Widget ListForm; static Widget StatForm; static Widget ConnectString; static Widget StatList; static Widget MenuFile; /* Liste des widgets de status */ static Widget TxtUsed; static Widget TxtGMem; static Widget TxtDisk1; static Widget TxtDisk2; static Widget TxtMsgs; static Widget TxtResync; static Widget TxtState; static Widget TxtHold; static Widget TxtPriv; static Widget Used; static Widget GMem; static Widget Disk1; static Widget Disk2; static Widget Msgs; static Widget Resync; static Widget State; static Widget Hold; static Widget Priv; static Widget Popup; static Widget PItem[NB_PITEM]; void TalkToCB (Widget w, XtPointer client_data, XtPointer call_data); void OneChanCB (Widget w, XtPointer client_data, XtPointer call_data); void DisconnectCB (Widget w, XtPointer client_data, XtPointer call_data); int is_connected (void) { return (fbb_sock > 0); } int close_connection (void) { if (fbb_sock > 0) { HideFbbWindow (ALLCHANN, toplevel); HideFbbWindow (CONSOLE, toplevel); HideFbbWindow (MONITOR, toplevel); close (fbb_sock); fbb_sock = -1; if (InputId) XtRemoveInput (InputId); InputId = 0; } Caption (1); return 1; } static int open_connection (char *tcp_addr, int tcp_port, int mask) { int sock; struct sockaddr_in sock_addr; struct hostent *phe; if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } if ((phe = gethostbyname (tcp_addr)) == NULL) { perror ("gethostbyname"); return (-1); } sock_addr.sin_family = AF_INET; sock_addr.sin_port = htons (tcp_port); memcpy ((char *) &sock_addr.sin_addr, phe->h_addr, phe->h_length); if (connect (sock, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) == -1) { perror ("connect"); close_connection (); return (-1); } return (sock); } static int do_filter (char *ptr, int len) { char *scan = ptr; int lg = 0; while (len) { if ((*ptr == '\n') || isprint (*ptr)) scan[lg++] = *ptr; ++ptr; --len; } return (lg); } void Received (int channel, char *text, int len) { window_write (CONSOLE, text, len, 0, 0); } void ReceiveMonitor (int channel, char *text, int len, int color, int header) { if (channel == 255) channel = MONITOR; else channel = ALLCHANN; window_write (channel, text, len, color, header); } void ReceiveList (int channel, char *text) { ConnectItem (channel, text); } void ReceiveNbCh (int nb) { char buffer[80]; if (nb == 0) strcpy (buffer, "No connected station"); else sprintf (buffer, "%d connected station%c", nb, (nb > 1) ? 's' : '\0'); LabelSetString (ConnectLabel, buffer, NULL); } void ReceiveNbMsg (int priv, int hold, int nbmess) { static int old_nbmess = -1L; static int old_priv = -1L; static int old_hold = -1L; char texte[80]; if (!(conf[curconf].mask & FBB_MSGS)) priv = hold = nbmess = 0; if (old_nbmess != nbmess) { sprintf (texte, ": %d", nbmess); LabelSetString (Msgs, texte, NULL); old_nbmess = nbmess; } if (priv != old_priv) { sprintf (texte, ": %d", priv); LabelSetString (TxtPriv, "Priv msgs", (priv > 0) ? "RC" : NULL); LabelSetString (Priv, texte, (priv > 0) ? "RC" : NULL); old_priv = priv; } if (hold != old_hold) { sprintf (texte, ": %d", hold); LabelSetString (TxtHold, "Hold msgs", (hold > 0) ? "RC" : NULL); LabelSetString (Hold, texte, (hold > 0) ? "RC" : NULL); old_hold = hold; } } void ReceiveStatus (int lmem, int gmem, int disk1, int disk2) { static int old_lmem = -1L; static int old_gmem = -1L; static int old_disk1 = -1L; static int old_disk2 = 0L; char texte[80]; if (!(conf[curconf].mask & FBB_STATUS)) disk1 = disk2 = 9999; if (old_lmem != lmem) { sprintf (texte, ": %d", lmem); LabelSetString (Used, texte, NULL); old_lmem = lmem; } if (old_gmem != gmem) { sprintf (texte, ": %d K", gmem << 4); LabelSetString (GMem, texte, NULL); old_gmem = gmem; } if (disk1 != old_disk1) { sprintf (texte, ": %d K", disk1); LabelSetString (TxtDisk1, "Disk#1 free", (disk1 < 1000) ? "RC" : NULL); LabelSetString (Disk1, texte, (disk1 < 1000) ? "RC" : NULL); old_disk1 = disk1; } if (disk2 != old_disk2) { if (disk2 == -1L) { LabelSetString (TxtDisk2, "", NULL); LabelSetString (Disk2, "", NULL); } else { sprintf (texte, ": %d K", disk2); LabelSetString (TxtDisk2, "Disk#2 free", (disk2 < 1000) ? "RC" : NULL); LabelSetString (Disk2, texte, (disk2 < 1000) ? "RC" : NULL); } old_disk2 = disk2; } } static int orb_input (Widget w, int *sock, XtInputId * id) { int nb; char buffer[4096]; char save; unsigned int service; unsigned int len; char *scan; static int in_input = 0; static int pos = 0; if (in_input) return 0; ++in_input; nb = read (*sock, buffer + pos, sizeof (buffer) - pos); if (nb == -1) { perror ("read"); --in_input; close_connection (); return 0; } if (nb == 0) { MessageBox (0, "Connection closed", "End", MB_OK | MB_ICONEXCLAMATION); --in_input; close_connection (); return 0; } scan = buffer; nb += pos; while (nb >= 4) { /* Read header first. Be sure the 4 bytes are read */ service = (unsigned int) scan[0]; len = ((unsigned int) scan[3] << 8) + (unsigned int) scan[2]; if (nb < len + 4) break; scan += 4; nb -= 4; /* Read the data following the header. Be sure all bytes are read */ save = scan[len]; /* decodes and displays the services */ switch (service) { case FBB_CONSOLE: if (len > 3) Received (scan[0], scan + 3, len - 3); scan[len - 3] = '\0'; if (first && len == 30) MessageBox (0, scan + 3, "status", MB_OK | MB_ICONEXCLAMATION); first = 0; break; case FBB_MONITOR: if (len > 3) { int n = len; if (filters) n = do_filter (scan + 3, len - 3) + 3; ReceiveMonitor (scan[0], scan + 3, n - 3, scan[1], scan[2]); } break; case FBB_CHANNEL: if (len > 3) ReceiveMonitor (scan[0], scan + 3, len - 3, scan[1], scan[2]); break; case FBB_MSGS: { int nbPriv, nbHeld, nbTotal; scan[len] = '\0'; sscanf (scan, "%d %d %d", &nbPriv, &nbHeld, &nbTotal); ReceiveNbMsg (nbPriv, nbHeld, nbTotal); } break; case FBB_STATUS: { int MemUsed, MemAvail, Disk1, Disk2; scan[len] = '\0'; sscanf (scan, "%d %d %d %d", &MemUsed, &MemAvail, &Disk1, &Disk2); ReceiveStatus (MemUsed, MemAvail, Disk1, Disk2); } break; case FBB_NBCNX: scan[len] = '\0'; ReceiveNbCh (atoi (scan)); break; case FBB_LISTCNX: scan[len] = '\0'; ReceiveList (atoi (scan + 1), scan); break; case FBB_XFBBX: switch (scan[0]) { case 0: /* Deconnecte */ HideFbbWindow (CONSOLE, toplevel); conf[curconf].mask &= ~FBB_CONSOLE; break; case 1: /* Connecte */ conf[curconf].mask |= FBB_CONSOLE; ShowFbbWindow (CONSOLE, toplevel); break; case 2: /* Console busy */ conf[curconf].mask &= ~FBB_CONSOLE; MessageBox (0, "Remote console is already connected", "Connect", MB_OK | MB_ICONEXCLAMATION); break; } end_wait (); break; } scan[len] = save; scan += len; nb -= len; } if (nb > 0) { int i; /* All data was not received. */ /* Copy the rest to the beginning of the buffer */ for (i = 0; i < nb; i++) buffer[i] = scan[i]; } pos = nb; --in_input; return 0; } int init_orb (char *msg) { char buffer[300]; int sock; int console; int channel; int nb; char key[256]; XmListDeleteAllItems (ConnectList); cursor_wait (); /* End the current connection */ close_connection (); console = 0; channel = 0; filters = 0; sock = open_connection (conf[curconf].host, conf[curconf].port, conf[curconf].mask); if (sock == -1) { sprintf (msg, "Cannot connect xfbbd at %s:%d", conf[curconf].host, conf[curconf].port); Caption (1); end_wait (); return 0; } sprintf (buffer, "%d %d %s\n", conf[curconf].mask, channel, conf[curconf].mycall); write (sock, buffer, strlen (buffer)); nb = read (sock, buffer, 20); if (nb <= 0) { sprintf (msg, "Connection closed"); close (sock); Caption (1); end_wait (); return (0); } buffer[nb] = '\0'; sscanf (buffer, "%s", key); makekey (key, conf[curconf].pass, buffer); strcat (buffer, "\n"); write (sock, buffer, strlen (buffer)); InputId = XtAppAddInput (app_context, sock, (XtPointer) XtInputReadMask, (XtInputCallbackProc) orb_input, NULL); fbb_sock = sock; first = 1; XmToggleButtonSetState (MsgsToggle, ((conf[curconf].mask & FBB_MSGS) != 0), True); XmToggleButtonSetState (StatusToggle, ((conf[curconf].mask & FBB_STATUS) != 0), True); Caption (1); /* Open windows depending of the mask */ if (conf[curconf].mask & FBB_MONITOR) ShowFbbWindow (MONITOR, toplevel); else HideFbbWindow (MONITOR, toplevel); if (conf[curconf].mask & FBB_CHANNEL) ShowFbbWindow (ALLCHANN, toplevel); else HideFbbWindow (ALLCHANN, toplevel); end_wait (); return (1); } int console_input (char *buffer, int len) { int i; for (i = 0; i < len; i++) if (buffer[i] == '\r') buffer[i] = '\n'; write (fbb_sock, buffer, len); return (1); } #include void cursor_wait (void) { static Cursor lcursor = 0; if (lcursor == 0) { lcursor = XCreateFontCursor (XtDisplay (toplevel), XC_watch); } XDefineCursor (XtDisplay (toplevel), XtWindow (toplevel), lcursor); XFlush (XtDisplay (toplevel)); } void end_wait (void) { XUndefineCursor (XtDisplay (toplevel), XtWindow (toplevel)); } void DialogHelpCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 2; } void DialogOkCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 1; } void DialogCancelCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 0; } void RaiseEV (Widget w, XtPointer client_data, XEvent * event) { if (event->type != VisibilityNotify) return; XRaiseWindow (XtDisplay (w), XtWindow (XtParent (w))); } int MessageBox (int sec, char *texte, char *titre, int flags) { Arg args[20]; Cardinal n; Widget dialog; XEvent event; XmString string; int type; time_t temps; int retour = -1; n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNtitle, titre); n++; dialog = XmCreateMessageDialog (toplevel, "Warning", args, n); XtAddCallback (dialog, XmNokCallback, DialogOkCB, (XtPointer) & retour); XtAddCallback (dialog, XmNcancelCallback, DialogCancelCB, (XtPointer) & retour); XtAddCallback (dialog, XmNhelpCallback, DialogHelpCB, (XtPointer) & retour); XtAddEventHandler (dialog, VisibilityChangeMask, FALSE, (XtEventHandler) RaiseEV, NULL); switch (flags & 0xf0) { case 0x10: type = XmDIALOG_ERROR; break; case 0x20: type = XmDIALOG_QUESTION; break; case 0x30: type = XmDIALOG_WARNING; break; case 0x40: type = XmDIALOG_INFORMATION; break; default: type = XmDIALOG_MESSAGE; break; } string = XmStringCreateSimple ("No"); n = 0; XtSetArg (args[n], XmNdialogType, type); n++; XtSetArg (args[n], XmNhelpLabelString, string); n++; XtSetValues (dialog, args, n); XmStringFree (string); flags &= 0xf; if (flags == MB_OK) { XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON)); } else if (flags == MB_OKCANCEL) { XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON)); } else { /* YESNO et YESNOCANCEL */ string = XmStringCreateSimple ("Yes"); n = 0; XtSetArg (args[n], XmNokLabelString, string); n++; XtSetValues (dialog, args, n); XmStringFree (string); if (flags == MB_YESNO) { XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON)); } } string = XmStringCreateSimple (texte); n = 0; XtSetArg (args[n], XmNmessageString, string); n++; XtSetValues (dialog, args, n); XmStringFree (string); XtManageChild (dialog); XtAddGrab (dialog, TRUE, TRUE); if (sec > 0) { temps = time (NULL) + (time_t) sec; } else { temps = 0; } while (retour == -1) { if (XtAppPending (app_context)) { XtAppNextEvent (app_context, &event); XtDispatchEvent (&event); } else usleep (100000); if ((temps) && (temps < time (NULL))) { retour = 1; break; } } XtRemoveGrab (dialog); XtUnmanageChild (dialog); XtDestroyWidget (XtParent (dialog)); return (retour); } static void sig_fct (int sig) { int pid, pstatus; sig &= 0xff; printf ("Signal received = %d\n", sig); pid = wait (&pstatus); signal (sig, sig_fct); switch (sig) { case SIGHUP: /* reload system files */ break; case SIGTERM: /* end of session */ exit (0); break; case SIGBUS: /* end of session */ fprintf (stderr, "xfbbd : Bus error\n"); exit (5); break; case SIGSEGV: /* end of session */ fprintf (stderr, "xfbb : Segmentation violation\n"); exit (5); break; } } int SetChList (int clean) { return 1; } int GetChList (void) { return 1; } static int cherche_pos (int ch, int *items) { int i; for (i = 1; i < TOT_VOIES + 1; i++) { if (items[i] == ch) return (i); } return (0); } static int insere_pos (int ch, int *items) { int i; int pos = 0; for (i = 1; i < TOT_VOIES + 1; i++) { if ((items[i] > ch) || (items[i] == 0)) { pos = i; break; } } for (i = TOT_VOIES; i > pos; i--) { items[i] = items[i - 1]; } items[pos] = ch; return (pos); } static void delete_pos (int position, int *items) { int i; for (i = position; i < TOT_VOIES + 1; i++) { items[i] = items[i + 1]; } } void ConnectItem (int ch, char *texte) { static int items[TOT_VOIES + 1]; int pos; XmString str; if (ch <= 0) return; if (*texte == '<') str = XmStringGenerate (texte + 1, NULL, XmCHARSET_TEXT, "RC"); else if (*texte == '>') str = XmStringGenerate (texte + 1, NULL, XmCHARSET_TEXT, "BC"); else str = XmStringGenerate (texte + 1, NULL, XmCHARSET_TEXT, "NO"); pos = cherche_pos (ch, items); if (texte[3]) { if (pos) { /* Mise a jour */ XmListReplaceItemsPos (ConnectList, &str, 1, pos); } else { /* Creation */ pos = insere_pos (ch, items); XmListAddItemUnselected (ConnectList, str, pos); } } else if (pos) { /* supression */ XmListDeletePos (ConnectList, pos); delete_pos (pos, items); } XmStringFree (str); } static Pixel CreeCouleur (Widget w, int couleur) { XColor tcolor; tcolor.pixel = 0; tcolor.red = ((couleur >> 16) & 0xff) << 8; tcolor.green = ((couleur >> 8) & 0xff) << 8; tcolor.blue = (couleur & 0xff) << 8; tcolor.flags = DoRed | DoGreen | DoBlue; if (XAllocColor (XtDisplay(w), DefaultColormapOfScreen(XtScreen(w)), &tcolor)) return (tcolor.pixel); return couleur; } static XmRendition CreeCouleurRendition (Widget w, Pixel couleur, char *nom) { Arg args[10]; Cardinal n; n = 0; XtSetArg (args[n], XmNrenditionForeground, couleur); n++; return XmRenditionCreate (w, nom, args, n); } void CreateRendition (Widget w) { r_index = 0; XtVaGetValues (form, XmNbackground, &df_pixel, NULL); rc_pixel = CreeCouleur (w, 0xff0000); r_rend[r_index++] = CreeCouleurRendition (w, rc_pixel, "RC"); vc_pixel = CreeCouleur (w, 0x00ff00); r_rend[r_index++] = CreeCouleurRendition (w, vc_pixel, "VC"); bc_pixel = CreeCouleur (w, 0x0000ff); r_rend[r_index++] = CreeCouleurRendition (w, bc_pixel, "BC"); no_pixel = CreeCouleur (w, 0x000000); r_rend[r_index++] = CreeCouleurRendition (w, no_pixel, "NO"); rf_pixel = CreeCouleur (w, 0x800000); r_rend[r_index++] = CreeCouleurRendition (w, rf_pixel, "RF"); vf_pixel = CreeCouleur (w, 0x008000); r_rend[r_index++] = CreeCouleurRendition (w, vf_pixel, "VF"); bf_pixel = CreeCouleur (w, 0x000080); r_rend[r_index++] = CreeCouleurRendition (w, bf_pixel, "BF"); } void ToolIcons (void) { int i; int connected = is_connected (); static int OldIconState[NB_ICON]; int IconState[NB_ICON]; static int conn = 0; static int first = 1; static Pixel TopShadow; static Pixel BottomShadow; if (!comm_ok) return; if (first) { XtVaGetValues (BIcon[0], XmNtopShadowColor, &TopShadow, XmNbottomShadowColor, &BottomShadow, NULL); XtSetSensitive (BIcon[15], TRUE); first = 0; } if (connected != conn) { conn = connected; XtSetSensitive (BIcon[0], connected); XtSetSensitive (BIcon[2], connected); XtSetSensitive (BIcon[3], connected); XtSetSensitive (MCons, connected); XtSetSensitive (MMon, connected); XtSetSensitive (MAllc, connected); } for (i = 0; i < NB_ICON; i++) IconState[i] = FALSE; IconState[0] = fenetre[CONSOLE]; IconState[2] = fenetre[MONITOR]; IconState[3] = fenetre[ALLCHANN]; IconState[15] = TRUE; for (i = 0; i < NB_ICON; i++) { if (BIcon[i] == NULL) continue; if (OldIconState[i] != IconState[i]) { if (i < 4) { if (IconState[i]) { XtVaSetValues (BIcon[i], XmNtopShadowColor, BottomShadow, XmNbottomShadowColor, TopShadow, NULL); } else { XtVaSetValues (BIcon[i], XmNtopShadowColor, TopShadow, XmNbottomShadowColor, BottomShadow, NULL); } } OldIconState[i] = IconState[i]; } } } void Caption (int update) { time_t temps; struct tm tmg; struct tm tml; char buf[80]; char conn[80]; static int lmin = -1; if (update) lmin = -1; temps = time (NULL); tmg = *(gmtime (&temps)); tml = *(localtime (&temps)); if (tmg.tm_min != lmin) { if (is_connected ()) sprintf (conn, "%s (%s:%d)", conf[curconf].name, conf[curconf].host, conf[curconf].port); else sprintf (conn, "%s : not connected", conf[curconf].name); lmin = tmg.tm_min; sprintf (buf, "XFBB - %s - %s - %02d:%02d UTC", conf[curconf].mycall, conn, tmg.tm_hour, tmg.tm_min); XtVaSetValues (toplevel, XmNtitle, buf, NULL); } } void ItemCB (Widget w, XtPointer client_data, XtPointer call_data) { } void ActiveListCB (Widget w, XtPointer client_data, XtPointer call_data) { CurrentSelection = GetChList (); } void SelectListCB (Widget w, XtPointer client_data, XtPointer call_data) { CurrentSelection = GetChList (); if (CurrentSelection != -1) { /* Selection d'un canal */ /* ShowFbbWindow(CurrentSelection, toplevel); */ } } void ConsoleCB (Widget w, XtPointer client_data, XtPointer call_data) { char buffer[3]; /* Connexion en console */ cursor_wait (); /* Demande de connexion */ if (conf[curconf].mask & FBB_CONSOLE) conf[curconf].mask &= ~FBB_CONSOLE; else conf[curconf].mask |= FBB_CONSOLE; buffer[0] = 0; buffer[1] = 0; buffer[2] = (char) conf[curconf].mask; write (fbb_sock, buffer, 3); } void GatewayCB (Widget w, XtPointer client_data, XtPointer call_data) { /* ShowFbbWindow(CONSOLE, toplevel); */ } void AllChanCB (Widget w, XtPointer client_data, XtPointer call_data) { char buffer[3]; if (!fenetre[ALLCHANN]) { conf[curconf].mask |= FBB_CHANNEL; ShowFbbWindow (ALLCHANN, toplevel); } else { conf[curconf].mask &= ~FBB_CHANNEL; HideFbbWindow (ALLCHANN, toplevel); } buffer[0] = 0; buffer[1] = 0; buffer[2] = (char) conf[curconf].mask; write (fbb_sock, buffer, 3); } void OneChanCB (Widget w, XtPointer client_data, XtPointer call_data) { } void DisconnectCB (Widget w, XtPointer client_data, XtPointer call_data) { } void DisconnectConsole (void) { HideFbbWindow (CONSOLE, toplevel); } void MonitorCB (Widget w, XtPointer client_data, XtPointer call_data) { char buffer[3]; if (!fenetre[MONITOR]) { conf[curconf].mask |= FBB_MONITOR; ShowFbbWindow (MONITOR, toplevel); } else { conf[curconf].mask &= ~FBB_MONITOR; HideFbbWindow (MONITOR, toplevel); } buffer[0] = 0; buffer[1] = 0; buffer[2] = (char) conf[curconf].mask; write (fbb_sock, buffer, 3); } void ScanSysCB (Widget w, XtPointer client_data, XtPointer call_data) { cursor_wait (); end_wait (); } void ScanMsgCB (Widget w, XtPointer client_data, XtPointer call_data) { printf ("ScanMsg = %d\n", ((XmToggleButtonCallbackStruct *) call_data)->set); } void EditFileCB (Widget w, XtPointer client_data, XtPointer call_data) { } void ListCnxCB (Widget w, XtPointer client_data, XtPointer call_data) { } void EditUsrCB (Widget w, XtPointer client_data, XtPointer call_data) { } void EditMsgCB (Widget w, XtPointer client_data, XtPointer call_data) { } void PendingCB (Widget w, XtPointer client_data, XtPointer call_data) { } void StatMemCB (Widget w, XtPointer client_data, XtPointer call_data) { /* Infos status */ int flag = (((XmToggleButtonCallbackStruct *) call_data)->set != 0); char buffer[4]; if (flag) { conf[curconf].mask |= FBB_STATUS; XtMapWidget (TxtUsed); XtMapWidget (TxtGMem); XtMapWidget (TxtDisk1); XtMapWidget (TxtDisk2); XtMapWidget (Used); XtMapWidget (GMem); XtMapWidget (Disk1); XtMapWidget (Disk2); } else { conf[curconf].mask &= ~FBB_STATUS; XtUnmapWidget (TxtUsed); XtUnmapWidget (TxtGMem); XtUnmapWidget (TxtDisk1); XtUnmapWidget (TxtDisk2); XtUnmapWidget (Used); XtUnmapWidget (GMem); XtUnmapWidget (Disk1); XtUnmapWidget (Disk2); } buffer[0] = 0; buffer[1] = 0; buffer[2] = (char) conf[curconf].mask; write (fbb_sock, buffer, 3); ReceiveStatus (0, 0, 0, 0); PutConfig (); } void StatMsgCB (Widget w, XtPointer client_data, XtPointer call_data) { /* Infos Messages */ int flag = (((XmToggleButtonCallbackStruct *) call_data)->set != 0); char buffer[4]; if (flag) { conf[curconf].mask |= FBB_MSGS; XtMapWidget (TxtMsgs); XtMapWidget (TxtHold); XtMapWidget (TxtPriv); XtMapWidget (Msgs); XtMapWidget (Hold); XtMapWidget (Priv); } else { conf[curconf].mask &= ~FBB_MSGS; XtUnmapWidget (TxtMsgs); XtUnmapWidget (TxtHold); XtUnmapWidget (TxtPriv); XtUnmapWidget (Msgs); XtUnmapWidget (Hold); XtUnmapWidget (Priv); } buffer[0] = 0; buffer[1] = 0; buffer[2] = (char) conf[curconf].mask; write (fbb_sock, buffer, 3); ReceiveNbMsg (0, 0, 0); PutConfig (); } void InfoDialog (Widget w, XtPointer client_data, XtPointer call_data) { } void RemoteCB (Widget w, XtPointer client_data, XtPointer call_data) { char msg[256]; int val = (uintptr_t) client_data; int flag = (((XmToggleButtonCallbackStruct *) call_data)->set != 0); if (val == curconf) return; if (flag == 0) return; curconf = (uintptr_t) client_data; PutConfig (); init_orb (msg); } void TalkToCB (Widget w, XtPointer client_data, XtPointer call_data) { } void MaintCB (Widget w, XtPointer client_data, XtPointer call_data) { } void RerunCB (Widget w, XtPointer client_data, XtPointer call_data) { } void ExitCB (Widget w, XtPointer client_data, XtPointer call_data) { exit (0); } void StopCB (Widget w, XtPointer client_data, XtPointer call_data) { } void ConnectCB (Widget w, XtPointer client_data, XtPointer call_data) { } void PrintCB (Widget w, XtPointer client_data, XtPointer call_data) { prints = !prints; printf ("print = %d\n", prints); } void LabelSetString (Widget label, char *text, char *attr) { Arg args[10]; Cardinal n = 0; XmString string; if (text == NULL) return; if (attr) string = XmStringGenerate (text, NULL, XmCHARSET_TEXT, attr); else string = XmStringCreateSimple (text); n = 0; XtSetArg (args[n], XmNlabelString, string); n++; XtSetValues (label, args, n); XmStringFree (string); } void FHelpCB (Widget w, XtPointer client_data, XEvent * event) { static XmString prev = NULL; if (client_data) { XmString string; if (prev) XmStringFree (prev); XtVaGetValues (Footer, XmNlabelString, &prev, NULL); string = XmStringCreateSimple ((char *) client_data); XtVaSetValues (Footer, XmNlabelString, string, NULL); XmStringFree (string); foothelp = TRUE; } else { if (prev) XtVaSetValues (Footer, XmNlabelString, prev, NULL); foothelp = FALSE; } } Widget add_item (int type, Widget menu_pane, char *nom, XtCallbackProc callback, XtPointer data, char *help, XtEventHandler HelpCB) { Arg args[10]; Cardinal n = 0; Widget bouton = NULL; if ((callback == NULL) && (type != SEPARATOR) && (type != TOOLBUTTON)) { XtSetArg (args[n], XmNsensitive, False); n++; } switch (type) { case SEPARATOR: bouton = XmCreateSeparator (menu_pane, nom, args, n); break; case BUTTON: bouton = XmCreatePushButton (menu_pane, nom, args, n); if (callback) XtAddCallback (bouton, XmNactivateCallback, callback, data); break; case TOGGLE: XtSetArg (args[n], XmNvisibleWhenOff, True); n++; bouton = XmCreateToggleButton (menu_pane, nom, args, n); if (callback) XtAddCallback (bouton, XmNvalueChangedCallback, callback, data); break; case RADIO: XtSetArg (args[n], XmNvisibleWhenOff, False); n++; bouton = XmCreateToggleButton (menu_pane, nom, args, n); if (callback) XtAddCallback (bouton, XmNvalueChangedCallback, callback, data); break; case TOOLBUTTON: if (nom[0] != ' ') { XtSetArg (args[n], XmNlabelType, XmPIXMAP); n++; } XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNsensitive, FALSE); n++; bouton = XmCreatePushButton (menu_pane, nom, args, n); if (callback) XtAddCallback (bouton, XmNactivateCallback, callback, data); break; } if (help) { XtAddEventHandler (bouton, EnterWindowMask, FALSE, HelpCB, (XtPointer) help); XtAddEventHandler (bouton, LeaveWindowMask, FALSE, HelpCB, NULL); } XtManageChild (bouton); return (bouton); } void AddRT (Widget w) { XmRenderTable rt; XtVaGetValues (w, XmNrenderTable, &rt, NULL, NULL); /* Make a copy so that setvalues will work correctly */ rt = XmRenderTableCopy (rt, NULL, 0); rt = XmRenderTableAddRenditions (rt, r_rend, r_index, XmMERGE_NEW); XtVaSetValues (w, XmNrenderTable, rt, NULL, NULL); XmRenderTableFree (rt); } /* Translations */ static void HelpAct (Widget w, XEvent * event, String * parms, Cardinal * num) { AboutDialog (w, NULL, NULL); } static void ConsoleAct (Widget w, XEvent * event, String * parms, Cardinal * num) { ConsoleCB (w, NULL, NULL); } static void DisconnAct (Widget w, XEvent * event, String * parms, Cardinal * num) { DisconnectCB (w, NULL, NULL); } static void PendingAct (Widget w, XEvent * event, String * parms, Cardinal * num) { } static void MonitorAct (Widget w, XEvent * event, String * parms, Cardinal * num) { MonitorCB (w, NULL, NULL); } static void SetCallAct (Widget w, XEvent * event, String * parms, Cardinal * num) { CallsignDialog (w, NULL, NULL); } static void ProgTncAct (Widget w, XEvent * event, String * parms, Cardinal * num) { } static void GatewayAct (Widget w, XEvent * event, String * parms, Cardinal * num) { GatewayCB (w, NULL, NULL); } static void TalkToAct (Widget w, XEvent * event, String * parms, Cardinal * num) { TalkToCB (w, NULL, NULL); } static void MsgScanAct (Widget w, XEvent * event, String * parms, Cardinal * num) { TalkToCB (w, NULL, NULL); } static void EditorAct (Widget w, XEvent * event, String * parms, Cardinal * num) { } static void ListCnxAct (Widget w, XEvent * event, String * parms, Cardinal * num) { } static void SndTextAct (Widget w, XEvent * event, String * parms, Cardinal * num) { printf ("SndText <%s>\n", parms[0]); } Boolean KernelWorkProc (XtPointer data) { ToolIcons (); Caption (0); usleep (10); return (FALSE); } int main (int ac, char **av) { Pixmap pixmap; Widget bouton; Arg args[20]; Cardinal n; XmString string; int i; Atom DelWindow; Widget FormRC; char msg[256]; int res; CurrentSelection = -1; p_fptr = NULL; for (i = 1; i < NSIG; i++) { signal (i, sig_fct); } XtToolkitInitialize (); app_context = XtCreateApplicationContext (); display = XtOpenDisplay (app_context, NULL, av[0], "xfbbX", NULL, 0, &ac, av); if (display == NULL) { XtWarning ("xfbb : cannot open display, exiting..."); exit (0); } XtAppAddActions (app_context, actionsTable, XtNumber (actionsTable)); toplevel = XtAppCreateShell (av[0], "xfbbX", applicationShellWidgetClass, display, NULL, 0); fenetre[CONSOLE] = fenetre[MONITOR] = fenetre[ALLCHANN] = 0; n = 0; XtSetArg (args[n], XmNallowShellResize, True); n++; XtSetArg (args[n], XmNdeleteResponse, XmDO_NOTHING); ++n; XtSetValues (toplevel, args, n); DelWindow = XInternAtom (XtDisplay (toplevel), "WM_DELETE_WINDOW", FALSE); XmAddWMProtocolCallback (toplevel, DelWindow, ExitCB, NULL); n = 0; XtSetArg (args[n], XmNmarginHeight, 5); n++; XtSetArg (args[n], XmNmarginWidth, 5); n++; form = XmCreateForm (toplevel, "form", args, n); CreateRendition (toplevel); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; MenuBar = XmCreateMenuBar (form, "menu_bar", args, n); XtManageChild (MenuBar); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, MenuBar); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNorientation, XmHORIZONTAL); n++; ToolBar = XmCreateRowColumn (form, "tool_bar", args, n); /* Initialisation des boutons du menubar */ bouton = 0; n = 0; XtSetArg (args[0], XmNradioBehavior, True); MenuFile = XmCreatePulldownMenu (MenuBar, "file", args, 0); MenuWindow = XmCreatePulldownMenu (MenuBar, "window", args, 0); MenuRemote = XmCreatePulldownMenu (MenuBar, "remote", args, 1); MenuConfig = XmCreatePulldownMenu (MenuBar, "config", args, 0); MenuHelp = XmCreatePulldownMenu (MenuBar, "help", args, 0); XtSetArg (args[0], XmNsubMenuId, MenuFile); bouton = XmCreateCascadeButton (MenuBar, "file", args, 1); XtManageChild (bouton); XtSetArg (args[0], XmNsubMenuId, MenuWindow); bouton = XmCreateCascadeButton (MenuBar, "window", args, 1); XtManageChild (bouton); XtSetArg (args[0], XmNsubMenuId, MenuRemote); bouton = XmCreateCascadeButton (MenuBar, "remote", args, 1); XtManageChild (bouton); XtSetArg (args[0], XmNsubMenuId, MenuConfig); bouton = XmCreateCascadeButton (MenuBar, "config", args, 1); XtManageChild (bouton); XtSetArg (args[0], XmNsubMenuId, MenuHelp); bouton = XmCreateCascadeButton (MenuBar, "help", args, 1); XtManageChild (bouton); /* Bouton help a droite */ XtVaSetValues (MenuBar, XmNmenuHelpWidget, bouton, NULL); XtManageChild (MenuFile); XtManageChild (MenuWindow); XtManageChild (MenuRemote); XtManageChild (MenuConfig); add_item (BUTTON, MenuFile, "exit", ExitCB, NULL, "End of the session", (XtEventHandler) FHelpCB); MCons = add_item (BUTTON, MenuWindow, "console", ConsoleCB, NULL, "Console connection", (XtEventHandler) FHelpCB); MMon = add_item (BUTTON, MenuWindow, "monitoring", MonitorCB, NULL, "Shows monitoring", (XtEventHandler) FHelpCB); MAllc = add_item (BUTTON, MenuWindow, "all_channels", AllChanCB, NULL, "Shows the traffic of all users", (XtEventHandler) FHelpCB); for (i = 0; i < MAX_CONF; i++) { char name[20]; sprintf (name, "xfbb %d", i + 1); Rmt[i] = add_item (RADIO, MenuRemote, name, RemoteCB, (XtPointer)(intptr_t) i, "Select remote xfbb BBS", (XtEventHandler) FHelpCB); } add_item (BUTTON, MenuConfig, "main_parameters", SetupDialog, NULL, "Main configuration of the software", (XtEventHandler) FHelpCB); add_item (BUTTON, MenuHelp, "copyright", CopyDialog, NULL, "Displays copyright informations", (XtEventHandler) FHelpCB); add_item (SEPARATOR, MenuHelp, "", NULL, NULL, NULL, NULL); add_item (BUTTON, MenuHelp, "about", AboutDialog, NULL, "Informations on WinFBB software", (XtEventHandler) FHelpCB); BIcon[0] = add_item (TOOLBUTTON, ToolBar, "B1", ConsoleCB, NULL, "Console connection", (XtEventHandler) FHelpCB); BIcon[2] = add_item (TOOLBUTTON, ToolBar, "B3", MonitorCB, NULL, "Monitoring window", (XtEventHandler) FHelpCB); BIcon[3] = add_item (TOOLBUTTON, ToolBar, "B4", AllChanCB, NULL, "Shows the traffic of all users", (XtEventHandler) FHelpCB); add_item (TOOLBUTTON, ToolBar, " ", NULL, NULL, " ", NULL); BIcon[15] = add_item (TOOLBUTTON, ToolBar, "B16", AboutDialog, NULL, "On-line help", (XtEventHandler) FHelpCB); XtVaSetValues (ToolBar, XmNmenuHelpWidget, BIcon[15], NULL); string = XmStringCreateSimple (" "); n = 0; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNlabelString, string); n++; Footer = XmCreateLabel (form, "footer", args, n); XtManageChild (Footer); XmStringFree (string); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, ToolBar); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; ConnectLabel = XmCreateLabel (form, "list_label", args, n); AddRT (ConnectLabel); XtManageChild (ConnectLabel); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, ConnectLabel); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, Footer); n++; StatForm = XmCreateForm (form, "stat_form", args, n); XtManageChild (StatForm); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, ConnectLabel); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, StatForm); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, Footer); n++; ListForm = XmCreateForm (form, "list_form", args, n); XtManageChild (ListForm); string = XmStringCreateSimple ("Ch Callsign Start Time Rt Buf C/Fwd"); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNlabelString, string); n++; ConnectString = XmCreateLabel (ListForm, "list_label", args, n); XmStringFree (string); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, ConnectString); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNscrollBarDisplayPolicy, XmSTATIC); n++; ConnectList = XmCreateScrolledList (ListForm, "connect_list", args, n); XtAddCallback (ConnectList, XmNdefaultActionCallback, SelectListCB, NULL); XtAddCallback (ConnectList, XmNbrowseSelectionCallback, ActiveListCB, NULL); AddRT (ConnectList); XtManageChild (ConnectLabel); XtManageChild (ConnectString); XtManageChild (ConnectList); Popup = XmCreatePopupMenu (ConnectList, "popup", NULL, 0); PItem[0] = XmCreatePushButtonGadget (Popup, "Talk", NULL, 0); PItem[1] = XmCreatePushButtonGadget (Popup, "Show", NULL, 0); PItem[2] = XmCreatePushButtonGadget (Popup, "Infos", NULL, 0); PItem[3] = XmCreatePushButtonGadget (Popup, "Disconnect", NULL, 0); for (i = 0; i < NB_PITEM; i++) XtAddCallback (PItem[i], XmNactivateCallback, ItemCB, (XtPointer)(intptr_t) i); XtManageChildren (PItem, NB_PITEM); n = 0; XtSetArg (args[n], XmNborderWidth, 0); n++; XtSetArg (args[n], XmNshadowThickness, 0); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNmarginHeight, 1); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNindicatorOn, XmINDICATOR_CHECK_BOX); n++; XtSetArg (args[n], XmNvisibleWhenOff, True); n++; StatusToggle = XmCreateToggleButton (StatForm, "status_toggle", args, n); XtAddCallback (StatusToggle, XmNvalueChangedCallback, StatMemCB, NULL); XtManageChild (StatusToggle); n = 0; XtSetArg (args[n], XmNborderWidth, 0); n++; XtSetArg (args[n], XmNshadowThickness, 0); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNmarginHeight, 1); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNleftWidget, StatusToggle); n++; XtSetArg (args[n], XmNindicatorOn, XmINDICATOR_CHECK_BOX); n++; XtSetArg (args[n], XmNvisibleWhenOff, True); n++; MsgsToggle = XmCreateToggleButton (StatForm, "message_toggle", args, n); XtAddCallback (MsgsToggle, XmNvalueChangedCallback, StatMsgCB, NULL); XtManageChild (MsgsToggle); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNtopWidget, StatusToggle); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftOffset, 2); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightOffset, 2); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNshadowThickness, 1); n++; XtSetArg (args[n], XmNshadowType, XmSHADOW_IN); n++; FormRC = XmCreateForm (StatForm, "stat_Flist", args, n); XtManageChild (FormRC); n = 0; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNpacking, XmPACK_COLUMN); n++; XtSetArg (args[n], XmNnumColumns, 2); n++; StatList = XmCreateRowColumn (FormRC, "stat_list", args, n); XtManageChild (StatList); n = 0; XtSetArg (args[n], XmNmarginHeight, 1); n++; XtSetArg (args[n], XmNmappedWhenManaged, 0); n++; TxtUsed = XmCreateLabel (StatList, "txt_used", args, n); AddRT (TxtUsed); XtManageChild (TxtUsed); TxtGMem = XmCreateLabel (StatList, "txt_gmem", args, n); AddRT (TxtGMem); XtManageChild (TxtGMem); TxtDisk1 = XmCreateLabel (StatList, "txt_disk1", args, n); AddRT (TxtDisk1); XtManageChild (TxtDisk1); TxtDisk2 = XmCreateLabel (StatList, "txt_disk2", args, n); AddRT (TxtDisk2); XtManageChild (TxtDisk2); TxtResync = XmCreateLabel (StatList, "", args, n); AddRT (TxtResync); XtManageChild (TxtResync); TxtState = XmCreateLabel (StatList, "", args, n); AddRT (TxtState); XtManageChild (TxtState); TxtMsgs = XmCreateLabel (StatList, "txt_msgs", args, n); AddRT (TxtMsgs); XtManageChild (TxtMsgs); TxtHold = XmCreateLabel (StatList, "txt_hold", args, n); AddRT (TxtHold); XtManageChild (TxtHold); TxtPriv = XmCreateLabel (StatList, "txt_priv", args, n); AddRT (TxtPriv); XtManageChild (TxtPriv); Used = XmCreateLabel (StatList, "used", args, n); AddRT (Used); XtManageChild (Used); GMem = XmCreateLabel (StatList, "gmem", args, n); AddRT (GMem); XtManageChild (GMem); Disk1 = XmCreateLabel (StatList, "disk1", args, n); AddRT (Disk1); XtManageChild (Disk1); Disk2 = XmCreateLabel (StatList, "disk2", args, n); AddRT (Disk2); XtManageChild (Disk2); Resync = XmCreateLabel (StatList, "", args, n); AddRT (Resync); XtManageChild (Resync); State = XmCreateLabel (StatList, "", args, n); AddRT (State); XtManageChild (State); Msgs = XmCreateLabel (StatList, "msgs", args, n); AddRT (Msgs); XtManageChild (Msgs); Hold = XmCreateLabel (StatList, "hold", args, n); AddRT (Hold); XtManageChild (Hold); Priv = XmCreateLabel (StatList, "private", args, n); AddRT (Priv); XtManageChild (Priv); XtManageChild (ToolBar); XtManageChild (form); /* Icone de la fenetre */ pixmap = XCreateBitmapFromData (XtDisplay (toplevel), XtScreen (toplevel)->root, fbb_bits, fbb_width, fbb_height); XtVaSetValues (toplevel, XmNiconPixmap, pixmap, NULL); XtRealizeWidget (toplevel); XtSetSensitive (MCons, FALSE); XtSetSensitive (MMon, FALSE); XtSetSensitive (MAllc, FALSE); window_init (); set_win_colors (); curconf = 0; if (!GetConfig ()) SetupDialog (NULL, NULL, NULL); else { res = init_orb (msg); if (res == 0) { MessageBox (0, msg, "Client connection", MB_OK | MB_ICONEXCLAMATION); comm_ok = 0; /* return (res); */ } } /* Initialisation sequences */ XtAppAddWorkProc (app_context, KernelWorkProc, NULL); /* Main Loop */ XtAppMainLoop (app_context); /* Never reached */ return 0; } char *itoa (int val, char *buffer, int base) { sprintf (buffer, "%d", val); return buffer; } char *ltoa (long lval, char *buffer, int base) { sprintf (buffer, "%ld", lval); return buffer; } #define PROTOTYPES 1 #include "global.h" #include "md5.h" void MD5String (uchar *dest, uchar *source) { int i; MD5_CTX context; uchar digest[16]; unsigned int len = strlen (source); MD5Init (&context); MD5Update (&context, source, len); MD5Final (digest, &context); *dest = '\0'; for (i = 0; i < 16; i++) { char tmp[5]; sprintf (tmp, "%02X", digest[i]); strcat (dest, tmp); } } static void makekey (char *cle, char *pass, char *buffer) { char source[1024]; strcpy (source, cle); strcat (source, pass); MD5String (buffer, source); } fbb-7.0.10/src/X11/xfbblcnx.c0000644000175000017500000001661013613360505012371 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include static int LgList; static int filtre_port; static Widget CnxDialog; static Widget CnxList; static Widget ListPorts; static Widget ToggleFilter; static Widget TextFilter; static void AfficheListe(void) { long record ; FILE *fptr ; char *ptr ; int valvoie; uchar valport; char valcall[8]; char buffer[80]; statis buffstat; int sub_mask = 0; int affich = 0; XmString string; char call_mask[10]; XmListDeleteAllItems(CnxList); fptr = ouvre_stats() ; record = filelength(fileno(fptr)) ; record -= (long) (sizeof(statis) * 500) ; if (record < 0L) record = 0L; sub_mask = XmToggleButtonGetState(ToggleFilter); ptr = XmTextFieldGetString(TextFilter); strn_cpy(6, call_mask, ptr); XtFree(ptr); fseek(fptr, record, 0) ; for (;;) { if (fread((char *) &buffstat, sizeof(statis), 1, fptr) == 0) break; valport = buffstat.port + 'A' ; if ((filtre_port == 0) || (filtre_port == (buffstat.port + 1))) { valvoie = buffstat.voie ; n_cpy(6, valcall, buffstat.indcnx); if (*call_mask == '\0') affich =1; else if (sub_mask) affich = (strstr(valcall, call_mask) != 0); else affich = (strcmp(valcall, call_mask) == 0); if (affich) { sprintf(buffer, "%c %-2d %6ld %-6s %s %3d'%02d", valport, valvoie, record / (long) sizeof(statis), valcall, strdt(buffstat.datcnx), buffstat.tpscnx / 60, buffstat.tpscnx % 60 ) ; string = XmStringCreateSimple(buffer); XmListAddItem(CnxList, string, 0); XmStringFree(string); } } record += (long) sizeof(statis); } XmListSetBottomPos(CnxList, 0); ferme(fptr, 43) ; } void ListeConnexions(void) { XmString tstring[NBPORT+1]; int i; int nb; Arg args[20] ; Cardinal n; tstring[0] = XmStringCreateSimple("All ports"); nb = 1; for (i = 1 ; i < NBPORT ; i++) { if (p_port[i].pvalid) { printf("Port %d = %s\n", i, p_port[i].freq); tstring[nb] = XmStringCreateSimple(p_port[i].freq); ++nb; } } n = 0; XtSetArg(args[n], XmNitems, tstring); n++; XtSetArg(args[n], XmNitemCount, nb); n++; XtSetArg(args[n], XmNvisibleItemCount, nb); n++; XtSetValues(XtNameToWidget(ListPorts,"*List"), args, n); } void ListCnxCB(Widget w, XtPointer client_data, XtPointer call_data) { if (XtIsManaged(CnxDialog)) { /* Passer la fenetre au 1er plan */ XRaiseWindow(XtDisplay(CnxDialog),XtWindow(XtParent(CnxDialog))); return; } cursor_wait(); printf("PendingCB\n"); LgList = 0; ListeConnexions(); AfficheListe(); XtManageChild(CnxDialog); end_wait(); } static void CloseCB(Widget w, XtPointer client_data, XtPointer call_data) { XtUnmanageChild(CnxDialog); } static void PortCB(Widget w, XtPointer client_data, XtPointer call_data) { XmComboBoxCallbackStruct *cb = (XmComboBoxCallbackStruct *)call_data; filtre_port = cb->item_position - 1; AfficheListe(); } static void ToggleFilterCB(Widget w, XtPointer client_data, XtPointer call_data) { AfficheListe(); } static void TextFilterCB(Widget w, XtPointer client_data, XtPointer call_data) { AfficheListe(); } void ListCnx(Widget toplevel) { Arg args[20] ; Cardinal n; XmString string; Widget w; filtre_port = 0; n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; CnxDialog = XmCreateFormDialog(toplevel, "cnx_dialog", args, n); string = XmStringCreateSimple("All ports"); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; ToggleFilter = XmCreateToggleButton(CnxDialog, "toggle_filter", args, n); XtAddCallback (ToggleFilter, XmNvalueChangedCallback, ToggleFilterCB, NULL); XtManageChild(ToggleFilter); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftWidget, ToggleFilter);n++; TextFilter = XmCreateTextField(CnxDialog, "text_filter", args, n); XtAddCallback (TextFilter, XmNvalueChangedCallback, TextFilterCB, NULL); XtManageChild(TextFilter); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftWidget, TextFilter);n++; XtSetArg(args[n], XmNitems, &string); n++; XtSetArg(args[n], XmNitemCount, 1); n++; XtSetArg(args[n], XmNeditable, FALSE); n++; XtSetArg(args[n], XmNcursorPositionVisible, FALSE);n++; ListPorts = XmCreateDropDownComboBox(CnxDialog, "combo_ports", args, n); XtAddCallback (ListPorts, XmNselectionCallback, PortCB, NULL); XtManageChild(ListPorts); n= 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, ListPorts);n++; XtSetArg(args[n], XmNbottomOffset, 5);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; XtSetArg(args[n], XmNvisibleItemCount, 20);n++; CnxList = XmCreateScrolledList(CnxDialog, "cnx_list", args, n); XtManageChild(CnxList); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, CnxList);n++; XtSetArg(args[n], XmNleftWidget, ListPorts);n++; XtSetArg(args[n], XmNtopOffset, 5);n++; w = XmCreatePushButton(CnxDialog, "close", args, n); XtAddCallback(w, XmNactivateCallback, CloseCB, (XtPointer)CnxDialog); XtManageChild(w); } #if 0 main(int ac, char **av) { Arg args[20] ; Cardinal n; Widget toplevel; Widget rc; Widget bp; Widget EditUsrDialog; XtAppContext app_context; toplevel = XtAppInitialize(&app_context, "TM", NULL, 0, &ac, av, NULL,NULL, 0); n = 0; XtSetArg(args[n], XmNallowShellResize, True);n++; XtSetValues(toplevel, args, n); EditUsrDialog = EditUser(toplevel); rc = XmCreateRowColumn(toplevel, "rc", NULL, 0); bp = XmCreatePushButton(rc, "Edit User", NULL, 0); XtAddCallback(bp, XmNactivateCallback, EditUsrCB, (XtPointer)EditUsrDialog); XtManageChild(bp); XtManageChild(rc); XtRealizeWidget(toplevel); /* Main Loop */ XtAppMainLoop(app_context); } #endif fbb-7.0.10/src/X11/xfbbedtu.c0000644000175000017500000004742513613360505012376 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #define LG_TBLIST 100 static int LgList; static char *TbList; static int NbLang; static Widget EditUsrDialog; static Widget Callsign; static Widget CallList; static Widget LangList; static Widget Add; static Widget Del; static Widget Home; static Widget Name; static Widget Pass; static Widget Prvt; static Widget Zip; static Widget Stat[11]; static int AddMode; static info user; void EditUsrCB(Widget w, XtPointer client_data, XtPointer call_data) { int i; XmString string; if (XtIsManaged(EditUsrDialog)) { /* Passer la fenetre au 1er plan */ XRaiseWindow(XtDisplay(EditUsrDialog),XtWindow(XtParent(EditUsrDialog))); return; } AddMode = FALSE; cursor_wait(); NbLang = 0; XmListDeleteAllItems(CallList); XmListDeleteAllItems(LangList); FbbRequestUserList(); /* Tri de la liste */ qsort(TbList, LgList, 7, (int (*)(const void *, const void *))strcmp); for (i = 0 ; i < LgList ; i++) { string = XmStringCreateSimple(TbList + (i * 7)); XmListAddItem(CallList, string, 0); XmStringFree(string); } /* Liberation de la liste */ free(TbList); LgList = 0; TbList = NULL; XmListSelectPos(CallList, 1, TRUE); XtManageChild(EditUsrDialog); end_wait(); } void TextFieldGetString(Widget w, char *str, int len, int upcase) { char *text; text = XmTextFieldGetString(w); if (upcase) { strn_cpy(len, str, text); } else { n_cpy(len, str, text); } XtFree(text); } void RefreshUser(void) { int i; XmString string; cursor_wait(); XmListDeleteAllItems(CallList); XmListDeleteAllItems(LangList); NbLang = 0; FbbRequestUserList(); /* Tri de la liste */ qsort(TbList, LgList, 7, (int (*)(const void *, const void *))strcmp); for (i = 0 ; i < LgList ; i++) { string = XmStringCreateSimple(TbList + (i * 7)); XmListAddItem(CallList, string, 0); XmStringFree(string); } /* Liberation de la liste */ free(TbList); LgList = 0; TbList = NULL; string = XmStringCreateSimple(user.indic.call); XmListSelectItem(CallList, string, TRUE); XmListSetItem(CallList, string); XmStringFree(string); end_wait(); } static void ApplyCB(Widget w, XtPointer client_data, XtPointer call_data) { int count; int *list; if (AddMode) { Widget scroll = NULL; /* Inserer le nouvel indicatif */ char Call[8]; indicat indic; unsigned num_indic; FILE *fptr ; info frec ; /* Lire l'indicatif */ TextFieldGetString(Callsign, Call, 7, TRUE); if (!find(Call)) { char text[80]; /* Erreur call */ sprintf(text, "Invalid callsign \"%s\"", Call); MessageBox(20, text, "Add User", MB_ICONEXCLAMATION|MB_OK); return; } indic.num = 0; extind(Call, indic.call); pvoie->emis = insnoeud(indic.call, &num_indic) ; if (pvoie->emis->coord == 0xffff) { /* L'indicatif n'existe pas ... Creer le record */ pvoie->emis->coord = rinfo++; pvoie->emis->val = 1; strcpy(pvoie->emis->indic, Call); init_info(&frec, &indic) ; fptr = ouvre_nomenc() ; fseek(fptr, (long)pvoie->emis->coord * ((long) sizeof(info)), 0) ; fwrite((char *) & frec, (int) sizeof(info), 1, fptr) ; ferme(fptr, 40) ; } GetUserInfos(indic.call, &user); /* Devalider l'indicatif */ XtUnmapWidget(Callsign); /* Revalider la liste ... */ XtMapWidget(CallList); XtVaGetValues(CallList, XmNverticalScrollBar, &scroll, NULL); if (scroll) XtMapWidget(scroll); XtSetSensitive(Add, TRUE); XtSetSensitive(Del, TRUE); AddMode = FALSE; } /* Modification de l'utilisateur */ XmListGetSelectedPos(LangList, &list, &count); if (count) { user.lang = list[0]-1; free(list); } TextFieldGetString(Name, user.prenom, 12, FALSE); TextFieldGetString(Pass, user.pass, 12, TRUE); TextFieldGetString(Zip, user.zip, 8, TRUE); TextFieldGetString(Prvt, user.priv, 12, TRUE); TextFieldGetString(Home, user.home, 40, TRUE); user.flags = 0; if (XmToggleButtonGetState(Stat[0])) user.flags |= F_PRV; if (XmToggleButtonGetState(Stat[1])) user.flags |= F_PAG; if (XmToggleButtonGetState(Stat[2])) user.flags |= F_BBS; if (XmToggleButtonGetState(Stat[3])) user.flags |= F_PMS; if (XmToggleButtonGetState(Stat[4])) user.flags |= F_SYS; if (XmToggleButtonGetState(Stat[5])) user.flags |= F_EXP; if (XmToggleButtonGetState(Stat[6])) user.flags |= F_LOC; if (XmToggleButtonGetState(Stat[7])) user.flags |= F_EXC; if (XmToggleButtonGetState(Stat[8])) user.flags |= F_MOD; if (XmToggleButtonGetState(Stat[9])) user.flags |= F_UNP; if (XmToggleButtonGetState(Stat[10])) user.flags |= F_NEW; SetUserInfos(user.indic.call, &user); RefreshUser(); } static void CloseCB(Widget w, XtPointer client_data, XtPointer call_data) { if (AddMode) { Widget scroll = NULL; /* Devalider l'indicatif */ XtUnmapWidget(Callsign); XtMapWidget(CallList); XtVaGetValues(CallList, XmNverticalScrollBar, &scroll, NULL); if (scroll) XtMapWidget(scroll); XtSetSensitive(Add, TRUE); XtSetSensitive(Del, TRUE); AddMode = FALSE; } XtUnmanageChild((Widget)client_data); XmListDeleteAllItems(CallList); XmListDeleteAllItems(LangList); } static void AddUserCB(Widget w, XtPointer client_data, XtPointer call_data) { Widget scroll = NULL; XtVaGetValues(CallList, XmNverticalScrollBar, &scroll, NULL); XtUnmapWidget(CallList); if (scroll) XtUnmapWidget(scroll); /* Valider l'indicatif */ XtMapWidget(Callsign); XmTextFieldSetString(Callsign, "CALLSIGN"); XtSetSensitive(Add, FALSE); XtSetSensitive(Del, FALSE); AddMode = TRUE; XmListDeselectAllItems(LangList); XmTextFieldSetString(Name, ""); XmTextFieldSetString(Pass, ""); XmTextFieldSetString(Zip, ""); XmTextFieldSetString(Prvt, ""); XmTextFieldSetString(Home, ""); XmToggleButtonSetState(Stat[0], (PRV(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[1], (PAG(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[2], (BBS(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[3], (PMS(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[4], (SYS(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[5], (EXP(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[6], (LOC(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[7], (EXC(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[8], (MOD(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[9], (UNP(def_mask) != 0), FALSE); XmToggleButtonSetState(Stat[10],(NEW(def_mask) != 0), FALSE); } static void DelUserCB(Widget w, XtPointer client_data, XtPointer call_data) { XmString string; ind_noeud *noeud; unsigned num_indic; FILE *fptr ; info frec ; char text[80]; /* Message box ... */ sprintf(text, "Delete %s. Are you sure ?", user.indic.call); if (!MessageBox(20, text, "Delete user", MB_ICONQUESTION|MB_OKCANCEL)) return; noeud = insnoeud(user.indic.call, &num_indic) ; if (noeud->coord == 0xffff) return; string = XmStringCreateSimple(user.indic.call); XmListDeleteItem(CallList, string); XmStringFree(string); fptr = ouvre_nomenc() ; fseek(fptr, (long)noeud->coord * sizeof(info) , 0) ; fread((char *) & frec, sizeof(info), 1, fptr) ; *(frec.indic.call) = '\0' ; fseek(fptr, (long)noeud->coord * sizeof(info) , 0) ; fwrite((char *) & frec, (int) sizeof(info), 1, fptr) ; ferme(fptr, 41) ; noeud->coord = 0xffff ; XmListSelectPos(CallList, 1, TRUE); } static void SelectCallCB(Widget w, XtPointer client_data, XtPointer call_data) { XmListCallbackStruct *cd = (XmListCallbackStruct *)call_data; char *callsign; XmStringGetLtoR(cd->item, XmSTRING_DEFAULT_CHARSET, &callsign); if (!GetUserInfos(callsign, &user)) return; if (user.lang < NbLang) XmListSelectPos(LangList, user.lang+1, FALSE); else XmListDeselectAllItems(LangList); XmTextFieldSetString(Name, user.prenom); XmTextFieldSetString(Pass, user.pass); XmTextFieldSetString(Zip, user.zip); XmTextFieldSetString(Prvt, user.priv); XmTextFieldSetString(Home, user.home); XmToggleButtonSetState(Stat[0], (PRV(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[1], (PAG(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[2], (BBS(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[3], (PMS(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[4], (SYS(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[5], (EXP(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[6], (LOC(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[7], (EXC(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[8], (MOD(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[9], (UNP(user.flags) != 0), FALSE); XmToggleButtonSetState(Stat[10],(NEW(user.flags) != 0), FALSE); } static void SelectLangCB(Widget w, XtPointer client_data, XtPointer call_data) { XmListCallbackStruct *cd = (XmListCallbackStruct *)call_data; char *text; XmStringGetLtoR(cd->item, XmSTRING_DEFAULT_CHARSET, &text); } void EditUser(Widget toplevel) { Arg args[20] ; Cardinal n; Widget w; Widget rcHome; Widget rcPrvt; Widget rcZip; Widget rcPass; Widget rcName; Widget rcStat; LgList = 0; TbList = NULL; n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; EditUsrDialog = XmCreateFormDialog(toplevel, "edit_user", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNmappedWhenManaged, FALSE);n++; XtSetArg(args[n], XmNcolumns, 8);n++; Callsign = XmCreateTextField(EditUsrDialog, "callsign", args, n); XtManageChild(Callsign); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 2);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 22);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditUsrDialog, "apply", args, n); XtAddCallback(w, XmNactivateCallback, ApplyCB, 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 27);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 47);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; Add = XmCreatePushButton(EditUsrDialog, "add_user", args, n); XtAddCallback(Add, XmNactivateCallback, AddUserCB, 0); XtManageChild(Add); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 52);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 72);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; Del = XmCreatePushButton(EditUsrDialog, "del_user", args, n); XtAddCallback(Del, XmNactivateCallback, DelUserCB, 0); XtManageChild(Del); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 77);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 97);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditUsrDialog, "close", args, n); XtAddCallback(w, XmNactivateCallback, CloseCB, (XtPointer)EditUsrDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, w);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcHome = XmCreateRowColumn(EditUsrDialog, "rcHome", args, n); n = 0; XtSetArg(args[n], XmNwidth, 70);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcHome, "home_bbs", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 40);n++; Home = XmCreateTextField(rcHome, "TextF", args, n); XtManageChild(Home); XtManageChild(rcHome); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcHome);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcPrvt = XmCreateRowColumn(EditUsrDialog, "rcPriv", args, n); n = 0; XtSetArg(args[n], XmNwidth, 70);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcPrvt, "private_dir", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 40);n++; Prvt = XmCreateTextField(rcPrvt, "TextF", args, n); XtManageChild(Prvt); XtManageChild(rcPrvt); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcPrvt);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcZip = XmCreateRowColumn(EditUsrDialog, "rcZip", args, n); n = 0; XtSetArg(args[n], XmNwidth, 70);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcZip, "zip_code", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 20);n++; Zip = XmCreateTextField(rcZip, "TextF", args, n); XtManageChild(Zip); XtManageChild(rcZip); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcZip);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcPass = XmCreateRowColumn(EditUsrDialog, "rcPass", args, n); n = 0; XtSetArg(args[n], XmNwidth, 70);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcPass, "password", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 20);n++; Pass = XmCreateTextField(rcPass, "TextF", args, n); XtManageChild(Pass); XtManageChild(rcPass); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcPass);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcName = XmCreateRowColumn(EditUsrDialog, "rcName", args, n); n = 0; XtSetArg(args[n], XmNwidth, 70);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcName, "name", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 20);n++; Name = XmCreateTextField(rcName, "TextF", args, n); XtManageChild(Name); XtManageChild(rcName); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNtopOffset, 5);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftOffset, 5);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcName);n++; XtSetArg(args[n], XmNbottomOffset, 5);n++; XtSetArg(args[n], XmNvisibleItemCount, 10);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; CallList = XmCreateScrolledList(EditUsrDialog, "callsign_list", args, n); XtAddCallback(CallList, XmNbrowseSelectionCallback, SelectCallCB, NULL); XtManageChild(CallList); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNtopOffset, 5);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNleftOffset, 5);n++; XtSetArg(args[n], XmNleftWidget, CallList);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcName);n++; XtSetArg(args[n], XmNbottomOffset, 5);n++; XtSetArg(args[n], XmNvisibleItemCount, 10);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; LangList = XmCreateScrolledList(EditUsrDialog, "language_list", args, n); XtAddCallback(LangList, XmNbrowseSelectionCallback, SelectLangCB, NULL); XtManageChild(LangList); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNleftOffset, 5);n++; XtSetArg(args[n], XmNleftWidget, rcName);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcPrvt);n++; XtSetArg(args[n], XmNbottomOffset, 5);n++; XtSetArg(args[n], XmNradioBehavior, FALSE);n++; rcStat = XmCreateRadioBox(EditUsrDialog, "rcStat", args, n); n = 0; XtSetArg(args[n], XmNhighlightThickness, 0);n++; Stat[0] = XmCreateToggleButton(rcStat, "read_all", args, n); Stat[1] = XmCreateToggleButton(rcStat, "paging", args, n); Stat[2] = XmCreateToggleButton(rcStat, "bbs", args, n); Stat[3] = XmCreateToggleButton(rcStat, "pms", args, n); Stat[4] = XmCreateToggleButton(rcStat, "sysop", args, n); Stat[5] = XmCreateToggleButton(rcStat, "expert", args, n); Stat[6] = XmCreateToggleButton(rcStat, "local", args, n); Stat[7] = XmCreateToggleButton(rcStat, "excluded", args, n); Stat[8] = XmCreateToggleButton(rcStat, "modem", args, n); Stat[9] = XmCreateToggleButton(rcStat, "unproto", args, n); Stat[10]= XmCreateToggleButton(rcStat, "private_msg", args, n); XtManageChildren(Stat, 11); XtManageChild(rcStat); } #if 0 main(int ac, char **av) { Arg args[20] ; Cardinal n; Widget toplevel; Widget rc; Widget bp; Widget EditUsrDialog; XtAppContext app_context; toplevel = XtAppInitialize(&app_context, "TM", NULL, 0, &ac, av, NULL,NULL, 0); n = 0; XtSetArg(args[n], XmNallowShellResize, True);n++; XtSetValues(toplevel, args, n); EditUsrDialog = EditUser(toplevel); rc = XmCreateRowColumn(toplevel, "rc", NULL, 0); bp = XmCreatePushButton(rc, "Edit User", NULL, 0); XtAddCallback(bp, XmNactivateCallback, EditUsrCB, (XtPointer)EditUsrDialog); XtManageChild(bp); XtManageChild(rc); XtRealizeWidget(toplevel); /* Main Loop */ XtAppMainLoop(app_context); } #endif void AddUserList(char *callsign) { if ((LgList % LG_TBLIST) == 0) { if (LgList) TbList = realloc(TbList, (LgList + LG_TBLIST) * 7); else TbList = malloc(LG_TBLIST * 7); } strn_cpy(6, TbList + (LgList * 7), callsign); ++LgList; } void AddUserLang(char *langue) { XmString string; string = XmStringCreateSimple(langue); XmListAddItem(LangList, string, 0); XmStringFree(string); ++NbLang; } fbb-7.0.10/src/X11/Makefile.am0000644000175000017500000000066713613360505012460 00000000000000sbin_PROGRAMS = xfbb xfbbX_cl xfbb_SOURCES = xfbbabtd.c xfbbcnsl.c xfbbedtm.c xfbbedtu.c xfbblcnx.c\ xfbbmain.c xfbbpndd.c xeditor.c xfbb.c xfbb_LDADD = ../libxfbbd.a -lXm -lXt -lXpm -lXext -lX11 $(AX25_LIB) xfbbX_cl_SOURCES = ../md5c.c xfbbXabtd.c xfbbXcnsl.c xfbbX.c xfbbX_cl_LDADD = -lXm -lXt -lXpm -lXext -lX11 AM_CPPFLAGS = -I$(top_srcdir)/include -Wstrict-prototypes -funsigned-char -DPROTOTYPES -fstack-check fbb-7.0.10/src/X11/xfbb.c0000644000175000017500000012102713613360505011503 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #define PUBLIC #include #include #include /* Added Satoshi Yasuda for NLS */ #include #include #include #include static void HelpAct (Widget, XEvent *, String *, Cardinal*); static void ConsoleAct(Widget, XEvent *, String *, Cardinal*); static void DisconnAct(Widget, XEvent *, String *, Cardinal*); static void PendingAct(Widget, XEvent *, String *, Cardinal*); static void MonitorAct(Widget, XEvent *, String *, Cardinal*); static void SetCallAct(Widget, XEvent *, String *, Cardinal*); static void ProgTncAct(Widget, XEvent *, String *, Cardinal*); static void GatewayAct(Widget, XEvent *, String *, Cardinal*); static void TalkToAct (Widget, XEvent *, String *, Cardinal*); static void MsgScanAct(Widget, XEvent *, String *, Cardinal*); static void EditorAct (Widget, XEvent *, String *, Cardinal*); static void ListCnxAct(Widget, XEvent *, String *, Cardinal*); static void SndTextAct(Widget, XEvent *, String *, Cardinal*); static void ChoCB(Widget, XtPointer, XtPointer); static void ScanCB(Widget, XtPointer, XtPointer); static void FHelpCB(Widget, XtPointer, XEvent *); static XtActionsRec actionsTable[] = { { "Help", HelpAct }, { "Console", ConsoleAct }, { "Disconnect", DisconnAct }, { "PendingFwd", PendingAct }, { "Monitor", MonitorAct }, { "SetCall", SetCallAct }, { "ProgTnc", ProgTncAct }, { "Gateway", GatewayAct }, { "TalkTo", TalkToAct }, { "MsgScan", MsgScanAct }, { "Editor", EditorAct }, { "ListCnx", ListCnxAct }, { "SndText", SndTextAct } }; static int init_phase = 1; static int StopOn = FALSE; static Widget MTalkTo; static Widget MShow; static Widget MInfos; static Widget MDiscon; static Widget MImDisc; static Widget MEdit; static Widget MScan; static Widget MCho; void TalkToCB(Widget w, XtPointer client_data, XtPointer call_data); void OneChanCB(Widget w, XtPointer client_data, XtPointer call_data); void DisconnectCB(Widget w, XtPointer client_data, XtPointer call_data); static void sig_fct(int sig) { /* int pid, pstatus; */ sig &= 0xff; signal(sig, sig_fct); printf("Signal received = %d\n", sig); /* pid = wait(&pstatus); */ switch(sig) { case SIGHUP : /* reload system files */ printf("Update system files\n"); init_buf_fwd(); init_buf_swap(); init_buf_rej(); init_bbs(); break; case SIGTERM: /* end of session */ printf("Closing connections\n"); maintenance() ; fbb_quit(1); break; case SIGBUS: /* end of session */ fprintf(stderr, "xfbbd : Bus error\n"); exit(5); break; case SIGSEGV: /* end of session */ fprintf(stderr, "xfbb : Segmentation violation\n"); exit(5); break; } } int SetChList(int clean) { int i; int ok = 0; int pos = 0; for (i = 0; i < NBVOIES ; i++) { if ((svoie[i]->sta.connect)) { ++pos; if (i == CurrentSelection) { XmListSelectPos(ConnectList, pos, TRUE); ok = 1; break; } } } if ((clean) && (!ok)) XmListDeselectAllItems(ConnectList); return 1; } int GetChList(void) { int numero = -1; int *array; int pos; int nb; int i; if ((XmListGetSelectedPos(ConnectList, &array, &nb)) && (nb > 0)) { /* position de la selection */ nb = array[0]; /* recherche du numero de canal */ pos = 1; for (i = 0; i < NBVOIES ; i++) { if (svoie[i]->sta.connect) { if (pos == nb) { numero = i; break; } ++pos; } } free(array); } return(numero); } static Pixel CreeCouleur(Widget w, int couleur) { XColor tcolor; tcolor.pixel = 0; tcolor.red = ((couleur >> 16) & 0xff) << 8; tcolor.green = ((couleur >> 8 ) & 0xff) << 8; tcolor.blue = (couleur & 0xff) << 8; tcolor.flags = DoRed|DoGreen|DoBlue; XAllocColor(XtDisplay(w), DefaultColormapOfScreen(XtScreen(w)), &tcolor); return(tcolor.pixel); } static XmRendition CreeCouleurRendition(Widget w, Pixel couleur, char *nom) { Arg args[10] ; Cardinal n; n = 0; XtSetArg(args[n], XmNrenditionForeground, couleur); n++; return XmRenditionCreate(w, nom, args, n); } void CreateRendition(Widget w) { r_index = 0; XtVaGetValues(form, XmNbackground, &df_pixel, NULL); rc_pixel = CreeCouleur(w, 0xff0000); r_rend[r_index++] = CreeCouleurRendition(w, rc_pixel, "RC"); vc_pixel = CreeCouleur(w, 0x00ff00); r_rend[r_index++] = CreeCouleurRendition(w, vc_pixel, "VC"); bc_pixel = CreeCouleur(w, 0x0000ff); r_rend[r_index++] = CreeCouleurRendition(w, bc_pixel, "BC"); no_pixel = CreeCouleur(w, 0x000000); r_rend[r_index++] = CreeCouleurRendition(w, no_pixel, "NO"); rf_pixel = CreeCouleur(w, 0x800000); r_rend[r_index++] = CreeCouleurRendition(w, rf_pixel, "RF"); vf_pixel = CreeCouleur(w, 0x008000); r_rend[r_index++] = CreeCouleurRendition(w, vf_pixel, "VF"); bf_pixel = CreeCouleur(w, 0x000080); r_rend[r_index++] = CreeCouleurRendition(w, bf_pixel, "BF"); } void ToolIcons(void) { int i; int numero; static int OldIconState[NB_ICON]; int IconState[NB_ICON]; static int first = 1; static int cho = -1; static int scanning = -1; static Pixel TopShadow; static Pixel BottomShadow; int port = is_pactor(); if (first) { XtVaGetValues(BIcon[0], XmNtopShadowColor, &TopShadow, XmNbottomShadowColor, &BottomShadow, NULL); XtSetSensitive(BIcon[13], TRUE); } if (MenuPactor) { if (scanning != pactor_scan[port]) { scanning = pactor_scan[port]; XmToggleButtonSetState(MScan, scanning, FALSE); } if ((ONLINE(port)) && (cho != 1)) XtSetSensitive(MCho, TRUE); else if (cho != 0); XtSetSensitive(MCho, FALSE); cho = ONLINE(port);; } for (i = 0 ; i < NB_ICON ; i++) IconState[i] = FALSE; IconState[0] = TRUE; IconState[1] = TRUE; IconState[2] = TRUE; IconState[3] = TRUE; IconState[8] = TRUE; IconState[9] = TRUE; IconState[10] = TRUE; IconState[11] = TRUE; IconState[12] = !editor_on(); IconState[13] = print; /* IconState[14] = TRUE; */ IconState[15] = TRUE; numero = GetChList(); if (numero == -1) { IconState[4] = FALSE; IconState[5] = FALSE; IconState[6] = FALSE; IconState[7] = FALSE; } else if (numero == CONSOLE) { IconState[4] = (svoie[CONSOLE]->sta.connect); IconState[5] = TRUE; } else { IconState[4] = TRUE; IconState[5] = TRUE; IconState[6] = TRUE; IconState[7] = (svoie[CONSOLE]->sta.connect == 0) && (can_talk(numero)); } for (i = 0 ; i < NB_ICON ; i++) { if (OldIconState[i] != IconState[i]) { /* Menues associated to icons */ Widget MenuW = NULL; Widget MenuX = NULL; switch(i) { case 4: MenuW = MShow; break; case 5: MenuW = MInfos; break; case 6: MenuW = MDiscon; MenuX = MImDisc; break; case 7: MenuW = MTalkTo; break; case 12: MenuW = MEdit; break; default: MenuW = NULL; break; } if (i == 13) { /* Bouton PRINT */ if (IconState[i]) { XtVaSetValues(BIcon[i], XmNtopShadowColor, BottomShadow, XmNbottomShadowColor, TopShadow, NULL); } else { XtVaSetValues(BIcon[i], XmNtopShadowColor, TopShadow, XmNbottomShadowColor, BottomShadow, NULL); } } else { XtSetSensitive(BIcon[i], IconState[i]); if (MenuW) XtSetSensitive(MenuW, IconState[i]); if (MenuX) XtSetSensitive(MenuX, IconState[i]); } OldIconState[i] = IconState[i]; } } } void Caption(void) { time_t temps; struct tm tmg; struct tm tml; char buf[80]; static int lmin = -1; temps = time(NULL); tmg = *(gmtime(&temps)); tml = *(localtime(&temps)); if (tmg.tm_min != lmin) { lmin = tmg.tm_min; sprintf(buf, "XFBB - %s-%d - %02d:%02d UTC", mycall, myssid, tmg.tm_hour, tmg.tm_min); XtVaSetValues(toplevel, XmNtitle, buf, NULL); } } void InitText(char *text) { static char *initext[NB_INIT_B] = { "Reading BBS config file", "Reading Texts (%s)", "Ports configuration (%s)", "TNC configuration (%s)", "Servers & PG (%s)", "Loading BIDs (%s)", "Callsigns set-up (%s)", "Messages set-up (%s)", "WP set-up (%s)", "Forward set-up (%s)", "BBS set-up (%s)" }; char str[80]; Arg args[10] ; Cardinal n = 0; int rouge = ((DEBUG) && ((init_phase == 2) || (init_phase == 3))); if (init_phase > NB_INIT_B) return; n = 0; XtSetArg(args[n], XmNset, TRUE); n++; XtSetValues(Tb[init_phase-1], args, n); sprintf(str, initext[init_phase-1], text); LabelSetString(Tb[init_phase-1], str, (rouge) ? "RC" : NULL); } Boolean InitWorkProc(XtPointer data) { if (step_initialisations (init_phase)) { /* Initialisation is finished */ int i; /* Delete init window and map main window */ for (i = 0 ; i < NB_INIT_B ; i++) { XtUnmapWidget(Tb[i]); } XtManageChild(ConnectLabel); XtManageChild(ConnectString); XtManageChild(ConnectList); if (is_pactor()) { Widget bouton; Arg args[10] ; MenuPactor = XmCreatePulldownMenu(MenuBar,"pactor", args, 0); XtSetArg(args[0], XmNsubMenuId, MenuPactor); bouton = XmCreateCascadeButton(MenuBar,"pactor", args, 1); XtManageChild(bouton); MScan = add_item(TOGGLE, MenuPactor, "scanning", ScanCB, NULL, "Start/stop frequency scanning", FHelpCB); MCho = add_item(BUTTON, MenuPactor, "changeover", ChoCB, NULL, "Send a change-over", FHelpCB); } return (TRUE); } /* Next step */ ++init_phase; return(FALSE); } Boolean KernelWorkProc(XtPointer data) { static int running = 0; if (running) { /* printf("Kernel %d\n", ++val); */ ToolIcons(); Caption(); kernel(); FbbMem(0); if (is_idle) { usleep(1); } else { is_idle = 1; } } else { running = InitWorkProc(NULL); } return(FALSE); } /* right click in the list */ void PostIt(Widget w, Widget popup, XButtonEvent *event) { int i; int nb; int numero; int pos; xprintf("YPos = %d\n", event->y); pos = XmListYToPos(ConnectList, event->y); nb = 0; for (i = 0 ; i < NBVOIES ; i++) { if (svoie[i]->sta.connect) ++nb; } if ((pos == 0) || (pos > nb)) { XmListDeselectAllItems(ConnectList); CurrentSelection = -1; return; } if (event->button != Button3) return; XmListSelectPos(ConnectList, pos, TRUE); numero = GetChList(); CurrentSelection = numero; if (numero == -1) { for (i = 0 ; i < NB_PITEM ; i++) XtSetSensitive(PItem[i], FALSE); } else if (numero == CONSOLE) { XtSetSensitive(PItem[0], FALSE); XtSetSensitive(PItem[1], TRUE); XtSetSensitive(PItem[2], TRUE); XtSetSensitive(PItem[3], FALSE); XtSetSensitive(PItem[4], FALSE); } else { int val; val = (svoie[CONSOLE]->sta.connect == 0) && (can_talk(numero)); XtSetSensitive(PItem[0], val); XtSetSensitive(PItem[1], TRUE); XtSetSensitive(PItem[2], TRUE); XtSetSensitive(PItem[3], TRUE); XtSetSensitive(PItem[4], TRUE); } XmMenuPosition(popup, event); XtManageChild(popup); } static void EditFileCB(Widget w, XtPointer client_data, XtPointer call_data) { if (EditorOff) { EditorOff = FALSE; CreateEditor(NULL, NULL, "Edit system file", 0, 0); } } void ItemCB(Widget w, XtPointer client_data, XtPointer call_data) { int numero = (uintptr_t ) client_data; printf("ItemCB = %d\n", numero); switch(numero) { case 0 : /* Talk */ TalkToCB(w, client_data, call_data); break; case 1 : /* Show */ OneChanCB(w, client_data, call_data); break; case 2 : /* Infos */ InfoDialog(w, client_data, call_data); break; case 3 : /* Disconnect */ DisconnectCB(w, client_data, call_data); break; case 4 : /* Immediate Disconnect */ DisconnectCB(w, client_data, call_data); break; } } void ActiveListCB(Widget w, XtPointer client_data, XtPointer call_data) { CurrentSelection = GetChList(); } void SelectListCB(Widget w, XtPointer client_data, XtPointer call_data) { CurrentSelection = GetChList(); if (CurrentSelection != -1) { /* Selection d'un canal */ ShowFbbWindow(CurrentSelection, toplevel); } } void ConsoleCB(Widget w, XtPointer client_data, XtPointer call_data) { /* Connexion en console */ cursor_wait(); ShowFbbWindow(CONSOLE, toplevel); connect_console(); end_wait(); } void GatewayCB(Widget w, XtPointer client_data, XtPointer call_data) { ShowFbbWindow(CONSOLE, toplevel); connect_tnc(); traite_voie(CONSOLE); } void AllChanCB(Widget w, XtPointer client_data, XtPointer call_data) { ToggleFbbWindow(ALLCHAN, toplevel); } void OneChanCB(Widget w, XtPointer client_data, XtPointer call_data) { int canal = GetChList(); if (canal == 0) { ShowFbbWindow(canal, toplevel); } else if (canal > 0) { ToggleFbbWindow(canal, toplevel); } else { MessageBox(60, "No selected callsign", "DISPLAY", MB_ICONEXCLAMATION|MB_OK); } } void DisconnectCB(Widget w, XtPointer client_data, XtPointer call_data) { int voie = GetChList(); int immediate = ((uintptr_t) client_data == 4); if (voie > 0) { int res; char texte[80]; if (immediate) sprintf(texte, "Immediate disconnect %s", svoie[voie]->sta.indicatif.call); else sprintf(texte, "Disconnect %s", svoie[voie]->sta.indicatif.call); res = MessageBox(60, texte, "DISCONNECT", MB_ICONEXCLAMATION|MB_OKCANCEL); if (res == IDOK) { disconnect_channel(voie, immediate); } } else { MessageBox(60, "No selected callsign", "DISCONNECT", MB_ICONEXCLAMATION|MB_OK); } } void MonitorCB(Widget w, XtPointer client_data, XtPointer call_data) { ToggleFbbWindow(MMONITOR, toplevel); } static void ScanCB(Widget w, XtPointer client_data, XtPointer call_data) { char cmde[80]; int port = is_pactor(); /* Start/Stop scanning */ sprintf(cmde, "PTCTRX SCAN %d", !pactor_scan[port]); ptctrx(0, cmde); } static void ChoCB(Widget w, XtPointer client_data, XtPointer call_data) { int port = is_pactor(); if ((port) && (ONLINE(port))) { /* Tue l'eventuel timer en cours */ del_timer(p_port[port].t_iss); p_port[port].t_iss = NULL; if (ISS(port)) { tor_stop(p_port[port].pr_voie); printf("CHO\r\n"); } else { tor_start(p_port[port].pr_voie); printf("BRK\r\n"); } } } void ScanSysCB(Widget w, XtPointer client_data, XtPointer call_data) { cursor_wait(); init_buf_fwd(); init_buf_swap(); init_buf_rej(); init_bbs(); end_wait(); } void ScanMsgCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("ScanMsg = %d\n", ((XmToggleButtonCallbackStruct*)call_data)->set ); scan_fwd(!p_forward); } void OptionsCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("Option CB %d = %d\n", (uintptr_t)client_data, ((XmToggleButtonCallbackStruct*)call_data)->set ); set_option((uintptr_t)client_data,((XmToggleButtonCallbackStruct*)call_data)->set); } void TalkToCB(Widget w, XtPointer client_data, XtPointer call_data) { int voie; char texte[80]; char callsign[80]; voie = GetChList(); if (voie > 0) { strcpy(callsign, svoie[voie]->sta.indicatif.call); if (!talk_to(voie)) { wsprintf(texte, "Can't talk to %s", callsign); MessageBox(60,texte, "TALK", MB_ICONEXCLAMATION|MB_OK); } } else { MessageBox(60, "No selected callsign", "TALK", MB_ICONEXCLAMATION|MB_OK); } } void MaintCB(Widget w, XtPointer client_data, XtPointer call_data) { if ((!StopOn) && (fct_arret(3))) { XtSetSensitive(BIcon[14], TRUE); XtMapWidget(BIcon[14]); StopOn = TRUE; } } void RerunCB(Widget w, XtPointer client_data, XtPointer call_data) { if ((!StopOn) && (fct_arret(2))) { XtSetSensitive(BIcon[14], TRUE); XtMapWidget(BIcon[14]); StopOn = TRUE; } } void ExitCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("ExitCB\n"); if ((!StopOn) && (fct_arret(1))) { XtSetSensitive(BIcon[14], TRUE); XtMapWidget(BIcon[14]); StopOn = TRUE; } } void StopCB(Widget w, XtPointer client_data, XtPointer call_data) { if (operationnel == 1) { cursor_wait(); maintenance() ; end_wait(); fbb_quit(type_sortie); } } void PrintCB(Widget w, XtPointer client_data, XtPointer call_data) { print = !print; printf("print = %d\n", print); if (!print) close_print(); } void LabelSetString(Widget label, char *text, char *attr) { Arg args[10] ; Cardinal n = 0; XmString string; if (text == NULL) return; if (attr) string = XmStringGenerate(text, NULL, XmCHARSET_TEXT, attr); else string = XmStringCreateSimple(text); n = 0; XtSetArg(args[n], XmNlabelString, string); n++; XtSetValues(label, args, n); XmStringFree(string); FbbSync(); } static void FHelpCB(Widget w, XtPointer client_data, XEvent *event) { static XmString prev = NULL; if (client_data) { XmString string; if (prev) XmStringFree(prev); XtVaGetValues(Footer, XmNlabelString, &prev, NULL); string = XmStringCreateSimple((char *)client_data); XtVaSetValues(Footer, XmNlabelString, string, NULL); XmStringFree(string); foothelp = TRUE; } else { if (prev) XtVaSetValues(Footer, XmNlabelString, prev, NULL); foothelp = FALSE; } } Widget add_item(int type, Widget menu_pane, char *nom, XtPointer callback, XtPointer data, char *help, XtPointer HelpCB) { Arg args[10] ; Cardinal n = 0; Widget bouton = NULL; if ((callback == NULL) && (type != SEPARATOR) && (type != TOOLBUTTON)) { XtSetArg(args[n], XmNsensitive, False); n++; } switch (type) { case SEPARATOR: bouton = XmCreateSeparator(menu_pane, nom, args, n); break; case BUTTON: bouton = XmCreatePushButton(menu_pane, nom, args, n); if (callback) XtAddCallback(bouton, XmNactivateCallback, callback, data); break; case TOGGLE: XtSetArg(args[n], XmNvisibleWhenOff, True); n++; bouton = XmCreateToggleButton(menu_pane, nom, args, n); if (callback) XtAddCallback(bouton, XmNvalueChangedCallback, callback, data); break; case TOOLBUTTON: XtSetArg(args[n], XmNhighlightThickness, 0);n++; XtSetArg(args[n], XmNlabelType, XmPIXMAP);n++; XtSetArg(args[n], XmNsensitive, FALSE);n++; bouton = XmCreatePushButton(menu_pane, nom, args, n); if (callback) XtAddCallback(bouton, XmNactivateCallback, callback, data); break; } if (help) { XtAddEventHandler(bouton, EnterWindowMask, FALSE, HelpCB, (XtPointer) help); XtAddEventHandler(bouton, LeaveWindowMask, FALSE, HelpCB, NULL); } XtManageChild(bouton); return(bouton); } void AddRT(Widget w) { XmRenderTable rt; XtVaGetValues(w, XmNrenderTable, &rt, NULL, NULL); /* Make a copy so that setvalues will work correctly */ rt = XmRenderTableCopy(rt, NULL, 0); rt = XmRenderTableAddRenditions(rt, r_rend, r_index, XmMERGE_NEW); XtVaSetValues(w, XmNrenderTable, rt, NULL, NULL); XmRenderTableFree(rt); } /* Translations */ static void HelpAct (Widget w, XEvent *event, String *parms, Cardinal *num) { AboutDialog(w, NULL, NULL); } static void ConsoleAct(Widget w, XEvent *event, String *parms, Cardinal *num) { ConsoleCB(w, NULL, NULL); } static void DisconnAct(Widget w, XEvent *event, String *parms, Cardinal *num) { DisconnectCB(w, NULL, NULL); } static void PendingAct(Widget w, XEvent *event, String *parms, Cardinal *num) { PendingCB(w, NULL, NULL); } static void MonitorAct(Widget w, XEvent *event, String *parms, Cardinal *num) { MonitorCB(w, NULL, NULL); } static void SetCallAct(Widget w, XEvent *event, String *parms, Cardinal *num) { CallsignDialog(w, NULL, NULL); } static void ProgTncAct(Widget w, XEvent *event, String *parms, Cardinal *num) { } static void GatewayAct(Widget w, XEvent *event, String *parms, Cardinal *num) { GatewayCB(w, NULL, NULL); } static void TalkToAct (Widget w, XEvent *event, String *parms, Cardinal *num) { TalkToCB(w, NULL, NULL); } static void MsgScanAct(Widget w, XEvent *event, String *parms, Cardinal *num) { TalkToCB(w, NULL, NULL); } static void EditorAct (Widget w, XEvent *event, String *parms, Cardinal *num) { if (EditorOff) { EditorOff = FALSE; CreateEditor(NULL, NULL, "Edit system file", 0, 0); } } static void ListCnxAct(Widget w, XEvent *event, String *parms, Cardinal *num) { ListCnxCB(w, NULL, NULL); } static void SndTextAct(Widget w, XEvent *event, String *parms, Cardinal *num) { printf("SndText <%s>\n", parms[0]); } int main(int ac, char **av) { Pixmap pixmap; Widget bouton; Arg args[20] ; Cardinal n; XmString string; int i; Atom DelWindow; Display *display; Widget FormRC; int s; daemon_mode = 0; CurrentSelection = -1; p_fptr = NULL; setlocale(LC_CTYPE, ""); /* Added Satoshi Yasuda for NLS */ for (i = 1 ; i < NSIG ; i++) { signal(i, sig_fct); } #if 0 toplevel = XtAppInitialize(&app_context, "xfbb", NULL, 0, &ac, av, NULL,NULL, 0); XtAppAddActions(app_context, actionsTable, XtNumber(actionsTable)); #else XtToolkitInitialize(); app_context = XtCreateApplicationContext(); display = XtOpenDisplay(app_context, NULL, av[0], "xfbb", NULL, 0, &ac, av); if (display == NULL) { XtWarning("xfbb : cannot open display, exiting..."); exit(0); } XtAppAddActions(app_context, actionsTable, XtNumber(actionsTable)); toplevel = XtAppCreateShell(av[0], "xfbb", applicationShellWidgetClass, display, NULL, 0); #endif all_packets = 0; /* Parsing options */ while ((s = getopt(ac, av, "ad")) != -1) { switch (s) { case 'a': all_packets = 1; break; case 'd': break; case '?': fprintf(stderr, "Usage: xfbb [-a]\n"); return 0; } } n = 0; XtSetArg(args[n], XmNallowShellResize, True);n++; XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING); ++n; XtSetValues(toplevel, args, n); DelWindow = XInternAtom(XtDisplay(toplevel), "WM_DELETE_WINDOW", FALSE); XmAddWMProtocolCallback(toplevel, DelWindow, ExitCB, NULL); n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; form = XmCreateForm(toplevel, "form", args, n); CreateRendition(toplevel); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; MenuBar = XmCreateMenuBar(form, "menu_bar", args, n); XtManageChild(MenuBar); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, MenuBar);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; /* XtSetArg(args[n], XmNmarginWidth, 0);n++; XtSetArg(args[n], XmNmarginHeight, 0);n++; XtSetArg(args[n], XmNspacing, 0);n++; */ ToolBar = XmCreateRowColumn(form, "tool_bar", args, n); /* ToolBar = XmCreateMenuBar(form, "tool_bar", args, n); */ /* Initialisation des boutons du menubar */ bouton = 0; n = 0; MenuFile = XmCreatePulldownMenu(MenuBar,"file", args, n); MenuUser = XmCreatePulldownMenu(MenuBar,"user", args, n); MenuEdit = XmCreatePulldownMenu(MenuBar,"edit", args, n); MenuWindow = XmCreatePulldownMenu(MenuBar,"window", args, n); MenuOptions= XmCreatePulldownMenu(MenuBar,"options", args, n); MenuConfig = XmCreatePulldownMenu(MenuBar,"config", args, n); MenuPactor = NULL; MenuHelp = XmCreatePulldownMenu(MenuBar,"help", args, n); XtSetArg(args[0], XmNsubMenuId, MenuFile); bouton = XmCreateCascadeButton(MenuBar,"file", args, 1); XtManageChild(bouton); XtSetArg(args[0], XmNsubMenuId, MenuUser); bouton = XmCreateCascadeButton(MenuBar,"user", args, 1); XtManageChild(bouton); XtSetArg(args[0], XmNsubMenuId, MenuEdit); bouton = XmCreateCascadeButton(MenuBar,"edit", args, 1); XtManageChild(bouton); XtSetArg(args[0], XmNsubMenuId, MenuWindow); bouton = XmCreateCascadeButton(MenuBar,"window", args, 1); XtManageChild(bouton); XtSetArg(args[0], XmNsubMenuId, MenuOptions); bouton = XmCreateCascadeButton(MenuBar,"options", args, 1); XtManageChild(bouton); XtSetArg(args[0], XmNsubMenuId, MenuConfig); bouton = XmCreateCascadeButton(MenuBar,"config", args, 1); XtManageChild(bouton); XtSetArg(args[0], XmNsubMenuId, MenuHelp); bouton = XmCreateCascadeButton(MenuBar,"help", args, 1); XtManageChild(bouton); /* Bouton help a droite */ XtVaSetValues(MenuBar, XmNmenuHelpWidget, bouton, NULL); XtManageChild(MenuFile); XtManageChild(MenuUser); XtManageChild(MenuEdit); XtManageChild(MenuWindow); XtManageChild(MenuFile); XtManageChild(MenuConfig); ScanSys = add_item(BUTTON, MenuFile, "scan_sys", ScanSysCB, NULL, "Tests the different system files for updating", FHelpCB); ScanMsg = add_item(TOGGLE, MenuFile, "scan_msg", ScanMsgCB, NULL, "Re-scans the list of messages", FHelpCB); add_item(SEPARATOR, MenuFile, "", NULL, NULL, NULL, NULL); add_item(BUTTON, MenuFile, "maintenance", MaintCB, NULL, "Exits and runs house-keeping tasks", FHelpCB); add_item(BUTTON, MenuFile, "re_run", RerunCB, NULL, "Re-Runs XFBB", FHelpCB); add_item(BUTTON, MenuFile, "exit", ExitCB, NULL, "End of the session", FHelpCB); MTalkTo = add_item(BUTTON, MenuUser, "talk", TalkToCB, NULL, "Talks to the selected user", FHelpCB); MShow = add_item(BUTTON, MenuUser, "show", OneChanCB, NULL, "Shows the traffic of the selectedd user", FHelpCB); MInfos = add_item(BUTTON, MenuUser, "infos", InfoDialog, NULL, "Give informations on the selected user", FHelpCB); MDiscon = add_item(BUTTON, MenuUser, "disconnect", DisconnectCB, (XtPointer)3, "Disconnects the selected user", FHelpCB); MImDisc = add_item(BUTTON, MenuUser, "immediatedisc", DisconnectCB, (XtPointer)4, "Immediately disconnects the selected user", FHelpCB); add_item(BUTTON, MenuUser, "last_connections", ListCnxCB, NULL, "Lists the last connections", FHelpCB); add_item(BUTTON, MenuEdit, "user", EditUsrCB, NULL, "Edits user's information", FHelpCB); add_item(BUTTON, MenuEdit, "message", EditMsgCB, NULL, "Edits message information and text", FHelpCB); add_item(BUTTON, MenuEdit, "forwarding", NULL, NULL, "Pending forward", FHelpCB); MEdit = add_item(BUTTON, MenuEdit, "system_file", EditFileCB, NULL, "Edits a system file", FHelpCB); add_item(BUTTON, MenuWindow, "console", ConsoleCB, NULL, "Console connection", FHelpCB); add_item(BUTTON, MenuWindow, "gateway", GatewayCB, NULL, "Gateway connection", FHelpCB); add_item(BUTTON, MenuWindow, "monitoring", MonitorCB, NULL, "Shows monitoring", FHelpCB); add_item(BUTTON, MenuWindow, "all_channels", AllChanCB, NULL, "Shows the traffic of all users", FHelpCB); Opt[CM_OPTIONEDIT] = add_item(TOGGLE, MenuOptions, "edition", OptionsCB, (XtPointer)CM_OPTIONEDIT, "Enable/disable full page editor", FHelpCB); Opt[CM_OPTIONJUSTIF] = add_item(TOGGLE, MenuOptions, "justification", OptionsCB, (XtPointer)CM_OPTIONJUSTIF, "Enable/disable console justification", FHelpCB); Opt[CM_OPTIONALARM] = add_item(TOGGLE, MenuOptions, "connection_bip", OptionsCB, (XtPointer)CM_OPTIONALARM, "Enable/disable connection alarm", FHelpCB); Opt[CM_OPTIONCALL] = add_item(TOGGLE, MenuOptions, "sysop_call", OptionsCB, (XtPointer)CM_OPTIONCALL, "Enable/disable sysop call", FHelpCB); Opt[CM_OPTIONGATEWAY] = add_item(TOGGLE, MenuOptions, "gateway", OptionsCB, (XtPointer)CM_OPTIONGATEWAY, "Enable/disable gateway access", FHelpCB); Opt[CM_OPTIONAFFICH] = add_item(TOGGLE, MenuOptions, "banners", OptionsCB, (XtPointer)CM_OPTIONAFFICH, "Enable/disable callsign banners", FHelpCB); Opt[CM_OPTIONSOUNDB] = add_item(TOGGLE, MenuOptions, "soundcard", OptionsCB, (XtPointer)CM_OPTIONSOUNDB, "Enable/disable soundcard", FHelpCB); Opt[CM_OPTIONINEXPORT]= add_item(TOGGLE, MenuOptions, "inexport", OptionsCB, (XtPointer)CM_OPTIONINEXPORT, "Enable/disable display of import/export mail", FHelpCB); add_item(BUTTON, MenuConfig, "tnc_parameters", NULL, NULL, "Access to the low-level TNC programmation", FHelpCB); add_item(BUTTON, MenuConfig, "console_callsign", CallsignDialog, NULL, "Specifies the callsign used in console", FHelpCB); add_item(BUTTON, MenuConfig, "main_parameters", NULL, NULL, "Main configuration of the software", FHelpCB); add_item(BUTTON, MenuConfig, "fonts", NULL, NULL, "Set the font of the text windows", FHelpCB); MScan = NULL; MCho = NULL; add_item(BUTTON, MenuHelp, "contents", NULL, NULL, "Access online help", FHelpCB); add_item(BUTTON, MenuHelp, "copyright", CopyDialog, NULL, "Displays copyright informations", FHelpCB); add_item(SEPARATOR, MenuHelp, "", NULL, NULL, NULL, NULL); add_item(BUTTON, MenuHelp, "about", AboutDialog, NULL, "Informations on WinFBB software", FHelpCB); BIcon[0] = add_item(TOOLBUTTON, ToolBar, "B1", ConsoleCB, NULL, "Console connection", FHelpCB); BIcon[1] = add_item(TOOLBUTTON, ToolBar, "B2", GatewayCB, NULL, "Gateway connection", FHelpCB); BIcon[2] = add_item(TOOLBUTTON, ToolBar, "B3", MonitorCB, NULL, "Monitoring window", FHelpCB); BIcon[3] = add_item(TOOLBUTTON, ToolBar, "B4", AllChanCB, NULL, "Shows the traffic of all users", FHelpCB); BIcon[4] = add_item(TOOLBUTTON, ToolBar, "B5", OneChanCB, NULL, "Shows the traffic of the selected user", FHelpCB); BIcon[5] = add_item(TOOLBUTTON, ToolBar, "B6", InfoDialog, NULL, "Give informations on the selected user", FHelpCB); BIcon[6] = add_item(TOOLBUTTON, ToolBar, "B7", DisconnectCB, NULL, "Disconnects the selected user ", FHelpCB); BIcon[7] = add_item(TOOLBUTTON, ToolBar, "B8", TalkToCB, NULL, "Talk to the selected user", FHelpCB); BIcon[8] = add_item(TOOLBUTTON, ToolBar, "B9", ListCnxCB, NULL, "Lists the last connections", FHelpCB); BIcon[9] = add_item(TOOLBUTTON, ToolBar, "B10", EditUsrCB, NULL, "Edits user's information", FHelpCB); BIcon[10] = add_item(TOOLBUTTON, ToolBar, "B11", EditMsgCB, NULL, "Edits message information and text", FHelpCB); BIcon[11] = add_item(TOOLBUTTON, ToolBar, "B12", PendingCB, NULL, "Pending forward", FHelpCB); BIcon[12] = add_item(TOOLBUTTON, ToolBar, "B13", EditFileCB, NULL, "Edits a system file", FHelpCB); BIcon[13] = add_item(TOOLBUTTON, ToolBar, "B14", PrintCB, NULL, "Opens printer", FHelpCB); BIcon[14] = add_item(TOOLBUTTON, ToolBar, "B15", StopCB, NULL, "Immediate stop", FHelpCB); BIcon[15] = add_item(TOOLBUTTON, ToolBar, "B16", AboutDialog, NULL, "On-line help", FHelpCB); XtVaSetValues(ToolBar, XmNmenuHelpWidget, BIcon[15], NULL); string = XmStringCreateSimple(" "); n = 0; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNlabelString, string);n++; Footer = XmCreateLabel(form, "footer", args, n); XtManageChild(Footer); XmStringFree(string); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, ToolBar);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; /* XtSetArg(args[n], XmNmappedWhenManaged, FALSE);n++; */ ConnectLabel = XmCreateLabel(form, "list_label", args, n); AddRT(ConnectLabel); XtManageChild(ConnectLabel); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, ConnectLabel);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, Footer);n++; /* XtSetArg(args[n], XmNborderWidth, 1);n++; */ StatForm = XmCreateForm(form, "stat_form", args, n); XtManageChild(StatForm); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, ConnectLabel);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightWidget, StatForm);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, Footer);n++; /* XtSetArg(args[n], XmNborderWidth, 1);n++; */ ListForm = XmCreateForm(form, "list_form", args, n); XtManageChild(ListForm); string = XmStringCreateSimple(" "); for (i = 0 ; i < NB_INIT_B ; i++) { n = 0; if (i == 0) { XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; } else { XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, Tb[i-1]);n++; } XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; XtSetArg(args[n], XmNmarginHeight, 0);n++; XtSetArg(args[n], XmNlabelString, string);n++; Tb[i]= XmCreateToggleButton(ListForm, "toggle_b", args, n); } XtManageChildren(Tb, NB_INIT_B); XmStringFree(string); string = XmStringCreateSimple("Ch Callsign Start Time Rt Buf C/Fwd"); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNlabelString, string);n++; ConnectString = XmCreateLabel(ListForm, "list_label", args, n); /* XtManageChild(ConnectString);*/ XmStringFree(string); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, ConnectString);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; XtSetArg(args[n], XmNscrollBarDisplayPolicy, XmSTATIC);n++; /* XtSetArg(args[n], XmNmappedWhenManaged, FALSE);n++; */ ConnectList = XmCreateScrolledList(ListForm, "connect_list", args, n); XtAddCallback(ConnectList, XmNdefaultActionCallback, SelectListCB, NULL); XtAddCallback(ConnectList, XmNbrowseSelectionCallback, ActiveListCB, NULL); AddRT(ConnectList); Popup = XmCreatePopupMenu(ConnectList, "popup", NULL, 0); XtAddEventHandler(ConnectList,ButtonPressMask, False, (XtPointer)PostIt, (XtPointer)Popup); PItem[0] = XmCreatePushButtonGadget(Popup, "Talk", NULL, 0); PItem[1] = XmCreatePushButtonGadget(Popup, "Show", NULL, 0); PItem[2] = XmCreatePushButtonGadget(Popup, "Infos", NULL, 0); PItem[3] = XmCreatePushButtonGadget(Popup, "Disconnect", NULL, 0); PItem[4] = XmCreatePushButtonGadget(Popup, "Immediate Disc", NULL, 0); for (i = 0 ; i < NB_PITEM ; i++) XtAddCallback(PItem[i], XmNactivateCallback, ItemCB, (XtPointer)(intptr_t)i); XtManageChildren(PItem,NB_PITEM); n = 0; /* XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; */ XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; StatusLabel = XmCreateLabel(StatForm, "status_label", args, n); XtManageChild(StatusLabel); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNshowArrows, False);n++; Jauge = XmCreateScrollBar(StatForm, "jauge", args, n); XtManageChild(Jauge); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, StatusLabel);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftOffset, 2);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightOffset, 2);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, Jauge);n++; XtSetArg(args[n], XmNshadowThickness, 1);n++; XtSetArg(args[n], XmNshadowType, XmSHADOW_IN);n++; FormRC = XmCreateForm(StatForm, "stat_Flist", args, n); XtManageChild(FormRC); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNpacking, XmPACK_COLUMN);n++; XtSetArg(args[n], XmNnumColumns, 2);n++; StatList = XmCreateRowColumn(FormRC, "stat_list", args, n); XtManageChild(StatList); n = 0; XtSetArg(args[n], XmNmarginHeight, 1);n++; TxtUsed = XmCreateLabel(StatList, "txt_used", args, n); AddRT(TxtUsed); XtManageChild(TxtUsed); TxtGMem = XmCreateLabel(StatList, "txt_gmem", args, n); AddRT(TxtGMem); XtManageChild(TxtGMem); TxtDisk1 = XmCreateLabel(StatList, "txt_disk1", args, n); AddRT(TxtDisk1); XtManageChild(TxtDisk1); TxtDisk2 = XmCreateLabel(StatList, "txt_disk2", args, n); AddRT(TxtDisk2); XtManageChild(TxtDisk2); TxtMsgs = XmCreateLabel(StatList, "txt_msgs", args, n); AddRT(TxtMsgs); XtManageChild(TxtMsgs); TxtResync = XmCreateLabel(StatList, "txt_resync", args, n); AddRT(TxtResync); XtManageChild(TxtResync); TxtState = XmCreateLabel(StatList, "txt_state", args, n); AddRT(TxtState); XtManageChild(TxtState); TxtHold = XmCreateLabel(StatList, "txt_hold", args, n); AddRT(TxtHold); XtManageChild(TxtHold); TxtPriv = XmCreateLabel(StatList, "txt_priv", args, n); AddRT(TxtPriv); XtManageChild(TxtPriv); Used = XmCreateLabel(StatList, "used", args, n); AddRT(Used); XtManageChild(Used); GMem = XmCreateLabel(StatList, "gmem", args, n); AddRT(GMem); XtManageChild(GMem); Disk1 = XmCreateLabel(StatList, "disk1", args, n); AddRT(Disk1); XtManageChild(Disk1); Disk2 = XmCreateLabel(StatList, "disk2", args, n); AddRT(Disk2); XtManageChild(Disk2); Msgs = XmCreateLabel(StatList, "msgs", args, n); AddRT(Msgs); XtManageChild(Msgs); Resync = XmCreateLabel(StatList, "resync", args, n); AddRT(Resync); XtManageChild(Resync); State = XmCreateLabel(StatList, "state", args, n); AddRT(State); XtManageChild(State); Hold = XmCreateLabel(StatList, "hold", args, n); AddRT(Hold); XtManageChild(Hold); Priv = XmCreateLabel(StatList, "private", args, n); AddRT(Priv); XtManageChild(Priv); XtManageChild(ToolBar); XtManageChild(form); /* maj_menu_options(); */ EditMessage(toplevel); EditUser(toplevel); PendingForward(toplevel); ListCnx(toplevel); /* Icone de la fenetre */ pixmap = XCreateBitmapFromData(XtDisplay(toplevel), XtScreen(toplevel)->root, fbb_bits, fbb_width, fbb_height); XtVaSetValues(toplevel, XmNiconPixmap, pixmap, NULL); XtRealizeWidget(toplevel); XtSetSensitive(MShow, FALSE); XtSetSensitive(MTalkTo, FALSE); XtSetSensitive(MDiscon, FALSE); XtSetSensitive(MImDisc, FALSE); XtSetSensitive(MInfos, FALSE); /* Initialisation sequences */ XtAppAddWorkProc(app_context, KernelWorkProc, NULL); /* Main Loop */ XtAppMainLoop(app_context); return(0); } /* char *strupr(char *str) { char *tmp = str; while (*tmp) { if (islower(*tmp)) *tmp = toupper(*tmp); ++tmp; } return str; } */ char *itoa(int val, char *buffer, int base) { sprintf(buffer, "%d", val); return buffer; } char *ltoa(long lval, char *buffer, int base) { sprintf(buffer, "%ld", lval); return buffer; } char *ultoa(unsigned long lval, char *buffer, int base) { sprintf(buffer, "%lu", lval); return buffer; } fbb-7.0.10/src/X11/xfbbcnsl.c0000644000175000017500000007327213613360505012373 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include typedef struct { char text[82]; int pos_bis; long color; long color_bis; } Line; typedef struct { Widget drawing; Widget scroll; Widget frame; Widget edit; Widget line1; Widget line2; Widget line3; int premier; int nblignes; int scrollpos; int totlignes; int curligne; int curcol; Line *winbuf; } WinInfo; void HideFbbWindow(int numero, Widget parent); static WinInfo *cnsl[TOTVOIES]; static Display *display = NULL; static XFontStruct *fontinfo = NULL; static GC dgc = NULL; static long ColorVal[W_NCOL]; static int sysop_on = FALSE; static Widget CallDialog; #define NB_HISTO 20 static int histo_pos; static char history[NB_HISTO][82]; static void free_buffer(int numero); static void alloc_buffer(int numero, int nblig); #include void cursor_wait(void) { static Cursor lcursor = 0; if (lcursor == 0) { lcursor = XCreateFontCursor(display, XC_watch); } XDefineCursor(display, XtWindow(toplevel), lcursor); } void end_wait(void) { XUndefineCursor(display, XtWindow(toplevel)); } void resizeCB(Widget w, XtPointer data, XtPointer call) { Arg args[20] ; Cardinal n; Dimension val; int pos; WinInfo *info = (WinInfo *)data; n = 0; XtSetArg(args[n], XmNheight, &val);n++; XtGetValues(info->drawing, args, n); info->nblignes = val / (fontinfo->ascent + fontinfo->descent); if (info->premier == info->curligne) { pos = info->totlignes - info->nblignes; } else { int offset; offset = info->curligne - info->premier; if (offset < 0) offset += info->totlignes; if (offset > (info->totlignes - info->nblignes)) { offset = info->totlignes - info->nblignes; info->premier = info->curligne - offset; if (info->premier < 0) info->premier += info->totlignes; } pos = info->totlignes - info->nblignes - offset; if (pos < 0) pos += info->totlignes; } n = 0; XtSetArg(args[n], XmNpageIncrement, info->nblignes); n++; XtSetArg(args[n], XmNsliderSize, info->nblignes); n++; XtSetArg(args[n], XmNmaximum, info->totlignes); n++; XtSetArg(args[n], XmNvalue, pos); n++; XtSetValues(info->scroll, args, n); XClearArea(display, XtWindow(info->drawing),0, 0, 0, 0, TRUE); } void refreshCB(Widget w, XtPointer data, XtPointer call) { int height; int offset; int i; int pos; WinInfo *info = (WinInfo *)data; offset = fontinfo->ascent; height = fontinfo->ascent + fontinfo->descent; pos = info->premier - info->nblignes + 1; if (pos < 0) pos += info->totlignes; for (i = 0 ; i < info->nblignes ; i++) { char *ptr = info->winbuf[pos].text; if (info->winbuf[pos].pos_bis == 0) { XSetForeground(display, dgc, info->winbuf[pos].color); XDrawImageString(display, XtWindow(w), dgc, 5,offset + i * height, ptr, 80); } else { int largeur; /* 1ere couleur */ XSetForeground(display, dgc, info->winbuf[pos].color); XDrawImageString(display, XtWindow(w), dgc, 5,offset + i * height, ptr, info->winbuf[pos].pos_bis); largeur = XTextWidth(fontinfo, ptr, info->winbuf[pos].pos_bis); /* 2eme couleur */ ptr = info->winbuf[pos].text + info->winbuf[pos].pos_bis; XSetForeground(display, dgc, info->winbuf[pos].color_bis); XDrawImageString(display, XtWindow(w), dgc, 5 + largeur, offset + i * height, ptr, 80 - info->winbuf[pos].pos_bis); } ++pos; if (pos >= info->totlignes) pos = 0; } } void scrollCB(Widget w, XtPointer data, XtPointer call) { Arg args[20] ; Cardinal n; int val; int offset; WinInfo *info = (WinInfo *)data; n = 0; XtSetArg(args[n], XmNvalue, &val);n++; XtGetValues(w, args, n); offset = info->totlignes - (val + info->nblignes); info->premier = info->curligne - offset ; if (info->premier < 0) info->premier += info->totlignes; XClearArea(display, XtWindow(info->drawing),0, 0, 1, 1, TRUE); } void quitCB(Widget w, XtPointer data, XtPointer call) { } void scroll_window(WinInfo *info) { Arg args[20] ; Cardinal n; int pos; int modscroll = 1; if (info->premier == info->curligne) { /* debut de buffer (ligne courante) */ ++info->premier; if (info->premier == info->totlignes) info->premier = 0; modscroll = 0; } ++info->curligne; if (info->curligne == info->totlignes) info->curligne = 0; pos = info->curligne + info->nblignes - 1; if (pos > info->totlignes) pos -= info->totlignes; if (info->premier == pos) { /* fin de buffer */ ++info->premier; if (info->premier == info->totlignes) info->premier = 0; modscroll = 2; } if (modscroll != 1) { if (info->frame) { refreshCB(info->drawing, (XtPointer)info, NULL); /* XClearArea(display, XtWindow(info->drawing),0, 0, 1, 1, TRUE); */ /* XFlush(display); */ /* XSync(display,0); */ } } else if (info->frame) { /* mettre le scrollbar a jour */ int pos; int offset; offset = info->curligne - info->premier; if (offset < 0) offset += info->totlignes; pos = info->totlignes - info->nblignes - offset; if (pos < 0) pos += info->totlignes; n = 0; XtSetArg(args[n], XmNvalue, pos); n++; XtSetValues(info->scroll, args, n); } } static void x_write(char *data, int len, int color, int numero) { int pos; int cr; int i; int c; int reste = 1; char *ptr; long xcolor = ColorVal[color]; WinInfo *info = cnsl[numero]; if (info == NULL) return; pos = info->curcol; ptr = info->winbuf[info->curligne].text; cr = 0; if (info->frame) XSetForeground(display, dgc, xcolor); if ((pos) && (xcolor != info->winbuf[info->curligne].color)) { info->winbuf[info->curligne].color_bis = xcolor; info->winbuf[info->curligne].pos_bis = pos; } else info->winbuf[info->curligne].color = xcolor; for(i = 0 ; i < len ; i++) { c = *data++; if (c == '\n') continue; if (c == '\r') { int cpos; if (*data == '\n') { --len; ++data; } cpos = info->curligne + 1; if (cpos >= info->totlignes) cpos = 0; ptr = info->winbuf[cpos].text; ptr[80] = '\0'; memset(ptr, 0x20, 80); info->winbuf[cpos].color = xcolor; info->winbuf[cpos].pos_bis = 0; reste = 0; scroll_window(info); pos = 0; } else { reste = 1; ptr[pos] = c; ++pos; if (pos == 80) { int cpos; cpos = info->curligne + 1; if (cpos >= info->totlignes) cpos = 0; ptr = info->winbuf[cpos].text; ptr[80] = '\0'; memset(ptr, 0x20, 80); info->winbuf[cpos].color = xcolor; info->winbuf[cpos].pos_bis = 0; reste = 0; scroll_window(info); pos = 0; } } } info->curcol = pos; if ((info->frame) && (info->premier == info->curligne) && reste) { char *cptr = info->winbuf[info->curligne].text; int offset = fontinfo->ascent; int height = fontinfo->ascent + fontinfo->descent; XDrawImageString(display, XtWindow(info->drawing), dgc, 5, offset + (info->nblignes - 1) * height, cptr, 80); /* sleep(1); */ } } void window_write(int numero, char *data, int len, int color, int header) { if ((numero > 0) && (numero != MMONITOR) && ((numero != INEXPORT) || (aff_inexport))) { x_write(data, len, color, ALLCHAN); } if (!header) { x_write(data, len, color, numero); } } long dos2pixel(int couleur) { static int xcolor[16]; couleur &= 0xf; if (xcolor[couleur] == 0) { Colormap cmap; XColor color; unsigned long mask; int r, g, b; int val; unsigned long pixel; val = (couleur & 0x8) ? 0xff : 0x80; if (couleur == 7) r = g = b = 0xc0; else if (couleur == 8) r = g = b = 0x80; else { r = g = b = 0; if (couleur & 1) r = val; if (couleur & 2) g = val; if (couleur & 4) b = val; } cmap = DefaultColormap(display, DefaultScreen(display)); if (XAllocColorCells(display, cmap, FALSE, &mask, 0, &pixel, 1)) { color.pixel = pixel; color.red = r << 8; color.green = g << 8; color.blue = b << 8; color.flags = DoRed|DoGreen|DoBlue; XStoreColor(display, cmap, &color); xcolor[couleur] = pixel; } else printf("Cannot alloc color %x in colormap\n", couleur); } return(xcolor[couleur]); } void set_win_colors(void) { ColorVal[W_SNDT] = dos2pixel(SEND); ColorVal[W_RCVT] = dos2pixel(RECV); ColorVal[W_CHNI] = dos2pixel(INDIC); ColorVal[W_MONH] = dos2pixel(HEADER); ColorVal[W_MOND] = dos2pixel(UI); ColorVal[W_CNST] = dos2pixel(CONS); ColorVal[W_BACK] = dos2pixel(FOND_VOIE); ColorVal[W_STAT] = dos2pixel(STA); /* Couleur status */ ColorVal[W_DEFL] = dos2pixel(DEF); /* Couleur status */ /* ColorVal[W_VOIE] = dos2pixel(VOIE); Couleur voies */ ColorVal[W_VOIE] = dos2pixel(INDIC); /* Couleur voies */ /* Raffraichit les fenetres existantes for (int i = 0 ; i < TOTVOIES ; i++) { if (Visu->Display[i]) { Visu->Display[i]->SetBkgndColor(FbbApp->ColorVal[W_BACK]); Visu->Display[i]->Invalidate(); } } */ } void window_connect(int numero) { char buf[80]; WinInfo *info; if (cnsl[numero] == NULL) alloc_buffer(numero, 100); info= cnsl[numero]; if ((numero > 0) && (numero < MMONITOR)) { char ssid[20]; int num; num = (numero == INEXPORT) ? 99 : numero-1; if (svoie[numero]->sta.indicatif.num) sprintf(ssid, "-%d", svoie[numero]->sta.indicatif.num); else *ssid = '\0'; sprintf(buf, "Channel %d : %s%s", num, svoie[numero]->sta.indicatif.call, ssid); if (info->frame) { Arg args[1] ; XtSetArg(args[0], XmNtitle, buf); XtSetValues(info->frame, args, 1); } if (numero > 0) { sprintf(buf, "%d:%s%s", num, svoie[numero]->sta.indicatif.call, ssid); /* FbbApp->UpdateWindowMenu(numero, buf, 2); */ } } } void window_disconnect(int numero) { WinInfo *info= cnsl[numero]; if (info == NULL) return; if ((numero > 0) && (numero != MMONITOR)) { char buf[80]; int num; num = (numero == INEXPORT) ? 99 : numero-1; sprintf(buf, "Channel %d : None", num); if (info->frame) { Arg args[1]; XtSetArg(args[0], XmNtitle, buf); XtSetValues(info->frame, args, 1); } if (numero > 0) { sprintf(buf, "%d:None", num); /* FbbApp->UpdateWindowMenu(numero, buf, 2); */ } if (!info->frame) free_buffer(numero); } if (numero == CurrentSelection) CurrentSelection = -1; } void window_init(void) { int i; for (i = 0 ; i < TOTVOIES ; i++) { cnsl[i] = NULL; } display = XtDisplay(toplevel); /* Visu = new TVisus(); InitBuffers(); */ } int get_win_lig(int numero) { WinInfo *info = cnsl[numero]; if (info) return (info->nblignes); return(25); } static void free_buffer(int numero) { if (cnsl[numero]) { free(cnsl[numero]->winbuf); free(cnsl[numero]); cnsl[numero] = NULL; } } static void alloc_buffer(int numero, int nblig) { int i; if (cnsl[numero] == NULL) { WinInfo *info = (WinInfo *) calloc(sizeof(WinInfo), 1); if (info == NULL) { printf("cannot allocate buffer for channel %d\n", numero); exit(2); } info->winbuf = (Line *)calloc(sizeof(Line), nblig); info->totlignes = nblig; info->nblignes = 25; for (i = 0; i < nblig ; i++) { info->winbuf[i].text[80] = '\0'; memset(info->winbuf[i].text, 0x20, 80); info->winbuf[i].color = 0; info->winbuf[i].color_bis = 0; info->winbuf[i].pos_bis = 0; } cnsl[numero] = info; } } void sysop_end_chat(void) { if (v_tell) { selvoie(CONSOLE) ; maj_niv(0, 0, 0) ; pvoie->sta.connect = FALSE ; selvoie(v_tell) ; maj_niv(pvoie->sniv1, pvoie->sniv2, pvoie->sniv3) ; prompt(pvoie->finf.flags, pvoie->niv1) ; pvoie->seq = v_tell = 0 ; } } int sysop_chat(void) { if ((!svoie[CONSOLE]->sta.connect) && (svoie[v_tell]->sta.connect)) { ShowFbbWindow(CONSOLE, toplevel); selvoie(CONSOLE) ; pvoie->sta.connect = 16 ; pvoie->deconnect = FALSE ; pvoie->pack = 0; pvoie->read_only = 0; pvoie->vdisk = 2; pvoie->xferok = 1; pvoie->mess_recu = 1 ; pvoie->mbl = 0; init_timout(CONSOLE) ; pvoie->temp3 = 0 ; pvoie->nb_err = 0; pvoie->finf.lang = langue[0]->numlang ; init_langue(voiecur) ; maj_niv(N_MBL, 9, 2) ; selvoie(v_tell) ; init_langue(voiecur) ; maj_niv(N_MBL, 9, 2) ; texte(T_MBL + 15) ; return(1); } return(0); } static void CallOkCB(Widget w, XtPointer client_data, XtPointer call_data) { sysop_chat(); sysop_end(); } static void CallCancelCB(Widget w, XtPointer client_data, XtPointer call_data) { sysop_end(); } void sysop_end(void) { if (sysop_on) { XtUnmanageChild(CallDialog); XtDestroyWidget(CallDialog); sysop_on = FALSE; } } void sysop_call(char *texte) { Arg args[20] ; Cardinal n; XmString string; if (!sysop_on) { sysop_on = TRUE; string = XmStringCreateSimple(texte); /* Cree la fenetre de l'appel */ n = 0; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; XtSetArg(args[n], XmNtitle, "Sysop call");n++; XtSetArg(args[n], XmNmessageString, string);n++; CallDialog = XmCreateMessageDialog(toplevel, "call_dialog", args, n); XtAddCallback(CallDialog, XmNokCallback, CallOkCB, NULL); XtAddCallback(CallDialog, XmNcancelCallback, CallCancelCB, NULL); XtUnmanageChild(XmMessageBoxGetChild(CallDialog, XmDIALOG_HELP_BUTTON)); XtManageChild(CallDialog); XmStringFree(string); } } static void deleteCB(Widget w, XtPointer data, XtPointer call) { int numero = (uintptr_t)data; HideFbbWindow(numero, NULL); if (numero == CONSOLE) { sysop_end_chat(); /* Deconnecter la console si connectee */ if (svoie[CONSOLE]->sta.connect) deconnexion(CONSOLE, 0); } else if ((numero != ALLCHAN) && (numero != MMONITOR) && (!svoie[numero]->sta.connect)) { free_buffer(numero); } if (numero > 0) { /* FbbApp->UpdateWindowMenu(Numero, NULL, 0); */ } } /* static void focusCB(Widget w, XtPointer data, XtPointer call) { WinInfo *info = (WinInfo *)data; XtSetKeyboardFocus(w, info->edit); } */ /* static void modifCB(Widget w, XtPointer data, XtPointer call) { printf("ModifCB\n"); } */ static void editCB(Widget w, XtPointer data, XtPointer call) { char *ptr; char buffer[82]; WinInfo *info = (WinInfo *)data; ptr = XmTextFieldGetString(info->line2); XmTextFieldSetString(info->line3, ptr); ptr = XmTextFieldGetString(info->line1); XmTextFieldSetString(info->line2, ptr); ptr = XmTextFieldGetString(info->edit); XmTextFieldSetString(info->line1, ptr); XmTextFieldSetString(info->edit,""); strcpy(buffer, ptr); if (++histo_pos == NB_HISTO) histo_pos = 0; strcpy(history[histo_pos], buffer); strcat(buffer, "\r"); window_write(CONSOLE, buffer, strlen(buffer), W_CNST, 0); console_inbuf(buffer, strlen(buffer)); } static void KeyEV(Widget w, XtPointer data, XKeyEvent *event) { int i; int lg; int code; char *ptr; XmTextPosition pos; WinInfo *info = (WinInfo *)data; code = event->keycode; if (event->state & 1) code |= 0x100; /* shift */ if (event->state & 4) code |= 0x400; /* control */ if (event->state & 8) code |= 0x800; /* alt */ switch(event->keycode) { case 0x009 : /* escape */ ptr = XmTextFieldGetString(info->edit); if (strlen(ptr) == 0) { /* commande Esc */ console_inbuf("\033\r", 2); } else { /* Efface la commande en cours */ XmTextFieldSetString(info->edit, ""); } XtFree(ptr); break; case 0x062 : /* UP */ case 0x162 : /* Shift-UP */ /* ligne precedente */ for (i = 0 ; i < NB_HISTO ; i++) { char *ptr = history[histo_pos]; if (histo_pos == 0) histo_pos = NB_HISTO; --histo_pos; if (*ptr) { XmTextFieldSetString(info->edit, ptr); XmTextFieldSetInsertionPosition(info->edit, 80); break; } } break; case 0x068 : /* DW */ case 0x168 : /* Shift-DW */ /* ligne suivante */ for (i = 0 ; i < NB_HISTO ; i++) { if (++histo_pos == NB_HISTO) histo_pos = 0; if (*history[histo_pos]) { XmTextFieldSetString(info->edit,history[histo_pos]); XmTextFieldSetInsertionPosition(info->edit, 80); break; } } break; case 0x462 : /* Ctrl-UP */ /* Scroll UP */ break; case 0x468 : /* Ctrl-DW */ /* scroll DW */ break; case 0x063 : /* PUP */ case 0x163 : /* Shift-PUP */ break; case 0x069 : /* PDW */ case 0x169 : /* Shift-PDW */ break; case 0x463 : /* Ctrl-PUP */ break; case 0x469 : /* Ctrl-PDW */ break; } /* Teste la fin de ligne */ pos = XmTextFieldGetInsertionPosition(info->edit); lg = XmTextFieldGetMaxLength(info->edit); if (pos == lg) { char *scan; ptr = XmTextFieldGetString(info->edit); scan = strrchr(ptr, ' '); if (scan) { *scan++ = '\0'; } XmTextFieldSetString(info->edit, ptr); editCB(w, info, NULL); if ((scan) && (*scan)) { XmTextFieldSetString(info->edit, scan); XmTextFieldSetInsertionPosition(info->edit, 80); } XtFree(ptr); } } WinInfo *xcnsl(int numero, Widget pere, int nblig, Arg *argp, Cardinal np) { Arg args[20] ; Cardinal n; Pixel foreground; Pixel background; Widget form; WinInfo *info; int mask; XGCValues values; Dimension hg; Widget separe; int console = (numero == CONSOLE) ; if (cnsl[numero] == NULL) alloc_buffer(numero, nblig); info = cnsl[numero]; form = XmCreateForm(pere, "form", argp, np); /* XtAddCallback(form, XmNfocusCallback, focusCB, info); */ if (display == NULL) display = XtDisplay(form); if (fontinfo == NULL) fontinfo = XLoadQueryFont(display, "6x10"); if (console) { XmFontList fontlist; memset(history, 0, NB_HISTO * 82); fontlist = XmFontListCreate(fontinfo, XmSTRING_DEFAULT_CHARSET); n = 0; XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNmarginHeight,0); n++; XtSetArg(args[n], XmNmaxLength,78); n++; XtSetArg(args[n], XmNshadowThickness,0); n++; XtSetArg(args[n], XmNhighlightThickness,0); n++; XtSetArg(args[n], XmNfontList,fontlist); n++; info->edit = XmCreateTextField(form, "edit", args, n); XtManageChild(info->edit); n = 0; XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget,info->edit); n++; XtSetArg(args[n], XmNeditable,FALSE); n++; XtSetArg(args[n], XmNmarginHeight,0); n++; /* XtSetArg(args[n], XmNmarginWidth,0); n++;*/ XtSetArg(args[n], XmNshadowThickness,0); n++; XtSetArg(args[n], XmNhighlightThickness,0); n++; XtSetArg(args[n], XmNcursorPositionVisible,FALSE); n++; XtSetArg(args[n], XmNfontList,fontlist); n++; info->line1 = XmCreateTextField(form, "line1", args, n); XtManageChild(info->line1); XtSetKeyboardFocus(info->line1, info->edit); n = 0; XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget,info->line1); n++; XtSetArg(args[n], XmNeditable,FALSE); n++; XtSetArg(args[n], XmNmarginHeight,0); n++; /* XtSetArg(args[n], XmNmarginWidth,0); n++; */ XtSetArg(args[n], XmNshadowThickness,0); n++; XtSetArg(args[n], XmNhighlightThickness,0); n++; XtSetArg(args[n], XmNcursorPositionVisible,FALSE); n++; XtSetArg(args[n], XmNfontList,fontlist); n++; info->line2 = XmCreateTextField(form, "line2", args, n); XtManageChild(info->line2); XtSetKeyboardFocus(info->line2, info->edit); n = 0; XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget,info->line2); n++; XtSetArg(args[n], XmNeditable,FALSE); n++; XtSetArg(args[n], XmNmarginHeight,0); n++; /* XtSetArg(args[n], XmNmarginWidth,0); n++; */ XtSetArg(args[n], XmNshadowThickness,0); n++; XtSetArg(args[n], XmNhighlightThickness,0); n++; XtSetArg(args[n], XmNcursorPositionVisible,FALSE); n++; XtSetArg(args[n], XmNfontList,fontlist); n++; info->line3 = XmCreateTextField(form, "line3", args, n); XtManageChild(info->line3); XtSetKeyboardFocus(info->line3, info->edit); n = 0; XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget,info->line3); n++; separe = XmCreateSeparator(form, "separator", args, n); XtManageChild(separe); XtAddCallback(info->edit, XmNactivateCallback, editCB, (XtPointer)info); /* XtAddCallback(info->edit, XmNmodifyVerifyCallback, modifCB, info); */ XtAddEventHandler(info->edit, KeyPressMask, FALSE, (XtEventHandler)KeyEV, (XtPointer)info); XmFontListFree(fontlist); XtSetKeyboardFocus(form, info->edit); n = 0; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget,separe); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNmaximum,nblig); n++; info->scroll = XmCreateScrollBar(form, "scroll", args, n); XtManageChild(info->scroll); n = 0; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNbottomWidget,separe); n++; } else { n = 0; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNtopAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNmaximum,nblig); n++; info->scroll = XmCreateScrollBar(form, "scroll", args, n); XtManageChild(info->scroll); n = 0; XtSetArg(args[n], XmNbottomAttachment,XmATTACH_FORM); n++; } XtSetArg(args[n], XmNtopAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNleftAttachment,XmATTACH_FORM); n++; XtSetArg(args[n], XmNrightAttachment,XmATTACH_WIDGET); n++; XtSetArg(args[n], XmNrightWidget,info->scroll); n++; XtSetArg(args[n], XmNwidth,500); n++; XtSetArg(args[n], XmNheight,200); n++; info->drawing = XmCreateDrawingArea(form, "drawing", args, n); XtManageChild(info->drawing); XtManageChild(form); XtSetKeyboardFocus(info->drawing, info->edit); n = 0; XtSetArg(args[n], XmNforeground, &foreground); n++; XtSetArg(args[n], XmNbackground, &background); n++; XtSetArg(args[n], XmNheight, &hg);n++; XtGetValues(info->drawing, args, n); /* info->premier = 0; */ mask = GCForeground | GCBackground | GCFont; values.background = background; values.foreground = foreground; values.font = fontinfo->fid; if (dgc == NULL) dgc = XtGetGC(info->drawing, mask, &values); XtAddCallback(info->scroll, XmNvalueChangedCallback, scrollCB, info); XtAddCallback(info->scroll, XmNdragCallback, scrollCB, info); XtAddCallback(info->drawing, XmNexposeCallback, refreshCB, info); XtAddCallback(info->drawing, XmNresizeCallback, resizeCB, info); info->nblignes = hg / (fontinfo->ascent + fontinfo->descent); n = 0; XtSetArg(args[n], XmNpageIncrement, info->nblignes); n++; XtSetArg(args[n], XmNsliderSize, info->nblignes); n++; XtSetArg(args[n], XmNmaximum, info->totlignes); n++; XtSetArg(args[n], XmNvalue, info->totlignes - info->nblignes); n++; XtSetValues(info->scroll, args, n); return(info); } void ShowFbbWindow(int numero, Widget parent) { WinInfo*info; if (cnsl[numero] == NULL) alloc_buffer(numero, 100); info = cnsl[numero]; if (info->frame) { if (XtIsManaged(info->frame)) { XRaiseWindow(XtDisplay(info->frame),XtWindow(info->frame)); } else XtManageChild(info->frame); } else { Arg args[20] ; Cardinal n; Atom DelWindow; char buf[80]; if (numero == CONSOLE) { sprintf(buf, "Console"); } else if (numero == MMONITOR) { sprintf(buf, "Monitoring"); } else if (numero == ALLCHAN) { sprintf(buf, "All channels"); } else { char ssid[20]; int num; num = (numero == INEXPORT) ? 99 : numero-1; /* Fenetres canaux ...*/ if (svoie[numero]->sta.indicatif.num) sprintf(ssid, "-%d", svoie[numero]->sta.indicatif.num); else *ssid = '\0'; sprintf(buf, "Channel %d : %s%s", num, svoie[numero]->sta.indicatif.call, ssid); } n = 0; XtSetArg(args[n], XmNdeleteResponse, XmDO_NOTHING); ++n; XtSetArg(args[n], XmNtitle, buf); ++n; info->frame = XmCreateDialogShell(parent, "cnsl", args, n); xcnsl(numero, info->frame, 100, NULL, 0); XtManageChild(info->frame); DelWindow = XInternAtom(display, "WM_DELETE_WINDOW", FALSE); XmAddWMProtocolCallback(info->frame, DelWindow, deleteCB, (XtPointer)(intptr_t)numero); } } void HideFbbWindow(int numero, Widget parent) { if ((cnsl[numero]) && (cnsl[numero]->frame) && (XtIsManaged(cnsl[numero]->frame))) { XtUnmanageChild(cnsl[numero]->frame); } } void ToggleFbbWindow(int numero, Widget parent) { if ((cnsl[numero]) && (cnsl[numero]->frame) && (XtIsManaged(cnsl[numero]->frame))) { HideFbbWindow(numero, parent); } else { ShowFbbWindow(numero, parent); } } #ifdef __TEST__ XtAppContext app_context; int connected; static void TimeoutEvent(XtPointer data, XtIntervalId *Id) { static int i=0; char text[82]; sprintf(text, "Bonjour numero %d. Je suis une ligne ! * ", i++); window_write(1, text, strlen(text), i%16, 0); if (connected) XtAppAddTimeOut(app_context, 500L, TimeoutEvent, NULL); } void ConnectCB(Widget w, XtPointer data, XtPointer call) { if (!connected) { window_connect(1); XtAppAddTimeOut(app_context, 500L, TimeoutEvent, 0); } connected = TRUE; } void DisconnectCB(Widget w, XtPointer data, XtPointer call) { window_disconnect(1); connected = FALSE; } void ShowCB(Widget w, XtPointer data, XtPointer call) { ShowFbbWindow(1, (Widget)data); } void HideCB(Widget w, XtPointer data, XtPointer call) { HideFbbWindow(1, (Widget)data); } void ToggleCB(Widget w, XtPointer data, XtPointer call) { ToggleFbbWindow(1, (Widget)data); } main(int ac, char **av) { Arg args[20] ; Cardinal n; Widget toplevel; Widget rc; Widget bp; svoie[1] = (Svoie *)calloc(sizeof(Svoie), 1); strcpy(svoie[1]->sta.indicatif.call, "F6FBB"); svoie[1]->sta.indicatif.num = 1; SEND = 0; RECV = 2; INDIC = 3; UI = 4; CONS = 5; FOND_VOIE = 6; HEADER = 7; toplevel = XtAppInitialize(&app_context, "TM", NULL, 0, &ac, av, NULL,NULL, 0); n = 0; XtSetArg(args[n], XmNallowShellResize, True);n++; XtSetValues(toplevel, args, n); rc = XmCreateRowColumn(toplevel, "rc", NULL, 0); bp = XmCreatePushButton(rc, "Connect", NULL, 0); XtAddCallback(bp, XmNactivateCallback, ConnectCB, toplevel); XtManageChild(bp); bp = XmCreatePushButton(rc, "Disconnect", NULL, 0); XtAddCallback(bp, XmNactivateCallback, DisconnectCB, toplevel); XtManageChild(bp); bp = XmCreatePushButton(rc, "Show", NULL, 0); XtAddCallback(bp, XmNactivateCallback, ShowCB, toplevel); XtManageChild(bp); bp = XmCreatePushButton(rc, "Hide", NULL, 0); XtAddCallback(bp, XmNactivateCallback, HideCB, toplevel); XtManageChild(bp); bp = XmCreatePushButton(rc, "Toggle", NULL, 0); XtAddCallback(bp, XmNactivateCallback, ToggleCB, toplevel); XtManageChild(bp); XtManageChild(rc); /* alloc_buffer(0); cnsl[0] = xcnsl(toplevel,100, NULL, 0); */ XtRealizeWidget(toplevel); display = XtDisplay(toplevel); set_win_colors(); /* Main Loop */ XtAppMainLoop(app_context); } #endif fbb-7.0.10/src/X11/xfbbXcnsl.c0000644000175000017500000005600613613360505012517 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Index des couleurs */ #define W_SNDT 0 /* Envoie data */ #define W_RCVT 1 /* Recoit data */ #define W_CHNI 2 /* Canal Information */ #define W_MONH 3 /* Monitoring header */ #define W_MOND 4 /* Monitoring data */ #define W_CNST 5 /* Console text */ #define W_BACK 6 /* Background */ #define W_STAT 7 /* Fenetre de status */ #define W_DEFL 8 /* Couleur Fenetre haute */ #define W_VOIE 9 /* Couleur voie */ #define W_NCOL 10 /* Nombre de couleurs definies */ typedef struct { char text[82]; int pos_bis; long color; long color_bis; } Line; typedef struct { Widget drawing; Widget scroll; Widget frame; Widget edit; Widget line1; Widget line2; Widget line3; int premier; int nblignes; int scrollpos; int totlignes; int curligne; int curcol; Line *winbuf; } WinInfo; static WinInfo *cnsl[MAXFEN]; static XFontStruct *fontinfo = NULL; static GC dgc = NULL; static long ColorVal[W_NCOL]; static int sysop_on = FALSE; static Widget CallDialog; #define NB_HISTO 20 static int histo_pos; static char history[NB_HISTO][82]; int SEND = 0; int RECV = 2; int INDIC = 3; int UI = 4; int CONS = 5; int FOND_VOIE = 6; int HEADER = 2; void alloc_buffer (int numero, int nblig); void resizeCB (Widget w, XtPointer data, XtPointer call) { Arg args[20]; Cardinal n; Dimension val; int pos; WinInfo *info = (WinInfo *) data; n = 0; XtSetArg (args[n], XmNheight, &val); n++; XtGetValues (info->drawing, args, n); info->nblignes = val / (fontinfo->ascent + fontinfo->descent); if (info->premier == info->curligne) { pos = info->totlignes - info->nblignes; } else { int offset; offset = info->curligne - info->premier; if (offset < 0) offset += info->totlignes; if (offset > (info->totlignes - info->nblignes)) { offset = info->totlignes - info->nblignes; info->premier = info->curligne - offset; if (info->premier < 0) info->premier += info->totlignes; } pos = info->totlignes - info->nblignes - offset; if (pos < 0) pos += info->totlignes; } n = 0; XtSetArg (args[n], XmNpageIncrement, info->nblignes); n++; XtSetArg (args[n], XmNsliderSize, info->nblignes); n++; XtSetArg (args[n], XmNmaximum, info->totlignes); n++; XtSetArg (args[n], XmNvalue, pos); n++; XtSetValues (info->scroll, args, n); XClearArea (display, XtWindow (info->drawing), 0, 0, 0, 0, TRUE); } void refreshCB (Widget w, XtPointer data, XtPointer call) { int height; int offset; int i; int pos; WinInfo *info = (WinInfo *) data; offset = fontinfo->ascent; height = fontinfo->ascent + fontinfo->descent; pos = info->premier - info->nblignes + 1; if (pos < 0) pos += info->totlignes; for (i = 0; i < info->nblignes; i++) { char *ptr = info->winbuf[pos].text; if (info->winbuf[pos].pos_bis == 0) { XSetForeground (display, dgc, info->winbuf[pos].color); XDrawImageString (display, XtWindow (w), dgc, 5, offset + i * height, ptr, 80); } else { int largeur; /* 1ere couleur */ XSetForeground (display, dgc, info->winbuf[pos].color); XDrawImageString (display, XtWindow (w), dgc, 5, offset + i * height, ptr, info->winbuf[pos].pos_bis); largeur = XTextWidth (fontinfo, ptr, info->winbuf[pos].pos_bis); /* 2eme couleur */ ptr = info->winbuf[pos].text + info->winbuf[pos].pos_bis; XSetForeground (display, dgc, info->winbuf[pos].color_bis); XDrawImageString (display, XtWindow (w), dgc, 5 + largeur, offset + i * height, ptr, 80 - info->winbuf[pos].pos_bis); } ++pos; if (pos >= info->totlignes) pos = 0; } } void scrollCB (Widget w, XtPointer data, XtPointer call) { Arg args[20]; Cardinal n; int val; int offset; WinInfo *info = (WinInfo *) data; n = 0; XtSetArg (args[n], XmNvalue, &val); n++; XtGetValues (w, args, n); offset = info->totlignes - (val + info->nblignes); info->premier = info->curligne - offset; if (info->premier < 0) info->premier += info->totlignes; XClearArea (display, XtWindow (info->drawing), 0, 0, 1, 1, TRUE); } void quitCB (Widget w, XtPointer data, XtPointer call) { } void scroll_window (WinInfo * info) { Arg args[20]; Cardinal n; int pos; int modscroll = 1; if (info->premier == info->curligne) { /* debut de buffer (ligne courante) */ ++info->premier; if (info->premier == info->totlignes) info->premier = 0; modscroll = 0; } ++info->curligne; if (info->curligne == info->totlignes) info->curligne = 0; pos = info->curligne + info->nblignes - 1; if (pos > info->totlignes) pos -= info->totlignes; if (info->premier == pos) { /* fin de buffer */ ++info->premier; if (info->premier == info->totlignes) info->premier = 0; modscroll = 2; } if (modscroll != 1) { if (info->frame) { refreshCB (info->drawing, (XtPointer) info, NULL); } } else if (info->frame) { /* mettre le scrollbar a jour */ int pos; int offset; offset = info->curligne - info->premier; if (offset < 0) offset += info->totlignes; pos = info->totlignes - info->nblignes - offset; if (pos < 0) pos += info->totlignes; n = 0; XtSetArg (args[n], XmNvalue, pos); n++; XtSetValues (info->scroll, args, n); } } static void x_write (char *data, int len, int color, int numero) { int pos; int cr; int i; int c; int reste = 1; char *ptr; long xcolor = ColorVal[color]; WinInfo *info = cnsl[numero]; if (info == NULL) return; pos = info->curcol; ptr = info->winbuf[info->curligne].text; cr = 0; if (info->frame) { XSetForeground (display, dgc, xcolor); } if ((pos) && (xcolor != info->winbuf[info->curligne].color)) { info->winbuf[info->curligne].color_bis = xcolor; info->winbuf[info->curligne].pos_bis = pos; } else info->winbuf[info->curligne].color = xcolor; for (i = 0; i < len; i++) { c = *data++; if (c == '\n') continue; if (c == '\r') { int cpos; if (*data == '\n') { --len; ++data; } cpos = info->curligne + 1; if (cpos >= info->totlignes) cpos = 0; ptr = info->winbuf[cpos].text; ptr[80] = '\0'; memset (ptr, 0x20, 80); info->winbuf[cpos].color = xcolor; info->winbuf[cpos].pos_bis = 0; reste = 0; scroll_window (info); pos = 0; } else { reste = 1; ptr[pos] = c; ++pos; if (pos == 80) { int cpos; cpos = info->curligne + 1; if (cpos >= info->totlignes) cpos = 0; ptr = info->winbuf[cpos].text; ptr[80] = '\0'; memset (ptr, 0x20, 80); info->winbuf[cpos].color = xcolor; info->winbuf[cpos].pos_bis = 0; reste = 0; scroll_window (info); pos = 0; } } } info->curcol = pos; if ((info->frame) && (info->premier == info->curligne) && reste) { char *cptr = info->winbuf[info->curligne].text; int offset = fontinfo->ascent; int height = fontinfo->ascent + fontinfo->descent; XDrawImageString (display, XtWindow (info->drawing), dgc, 5, offset + (info->nblignes - 1) * height, cptr, 80); } } void window_write (int numero, char *data, int len, int color, int header) { int i; for (i = 0; i < len; i++) if (data[i] == '\n') data[i] = '\r'; x_write (data, len, color, numero); } long dos2pixel (int couleur) { static int xcolor[16] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };; couleur &= 0xf; if (xcolor[couleur] == -1) { Colormap cmap; XColor color; unsigned long mask; int r, g, b; int val; unsigned long pixel; val = (couleur & 0x8) ? 0xff : 0x80; if (couleur == 7) r = g = b = 0xc0; else if (couleur == 8) r = g = b = 0x80; else { r = g = b = 0; if (couleur & 1) r = val; if (couleur & 2) g = val; if (couleur & 4) b = val; } cmap = DefaultColormap (display, DefaultScreen (display)); if (XAllocColorCells (display, cmap, FALSE, &mask, 0, &pixel, 1)) { color.pixel = pixel; color.red = r << 8; color.green = g << 8; color.blue = b << 8; color.flags = DoRed | DoGreen | DoBlue; XStoreColor (display, cmap, &color); xcolor[couleur] = pixel; } else { xcolor[couleur] = (r << 16) + (g << 8) + b ; } } return (xcolor[couleur]); } void set_win_colors (void) { ColorVal[W_SNDT] = dos2pixel (SEND); ColorVal[W_RCVT] = dos2pixel (RECV); ColorVal[W_CHNI] = dos2pixel (INDIC); ColorVal[W_MONH] = dos2pixel (HEADER); ColorVal[W_MOND] = dos2pixel (UI); ColorVal[W_CNST] = dos2pixel (CONS); ColorVal[W_BACK] = dos2pixel (FOND_VOIE); ColorVal[W_VOIE] = dos2pixel (INDIC); /* Couleur voies */ } void window_connect (int numero) { char buf[80]; WinInfo *info; if (cnsl[numero] == NULL) alloc_buffer (numero, 100); info = cnsl[numero]; switch (numero) { case 0: strcpy (buf, "Console"); break; case 1: strcpy (buf, "Monitoring"); break; case 2: strcpy (buf, "All channels"); break; default: buf[0] = '\0'; break; } if (info->frame) { Arg args[1]; XtSetArg (args[0], XmNtitle, buf); XtSetValues (info->frame, args, 1); } } void window_disconnect (int numero) { WinInfo *info = cnsl[numero]; if (info == NULL) return; if (numero == CurrentSelection) CurrentSelection = -1; } void window_close (int numero) { switch (numero) { case 0: ConsoleCB (NULL, NULL, NULL); break; case 1: MonitorCB (NULL, NULL, NULL); break; case 2: AllChanCB (NULL, NULL, NULL); break; } } void window_init (void) { int i; for (i = 0; i < MAXFEN; i++) { cnsl[i] = NULL; } display = XtDisplay (toplevel); } int get_win_lig (int numero) { WinInfo *info = cnsl[numero]; if (info) return (info->nblignes); return (25); } void free_buffer (int numero) { if (cnsl[numero]) { free (cnsl[numero]->winbuf); free (cnsl[numero]); cnsl[numero] = NULL; } } void alloc_buffer (int numero, int nblig) { int i; if (cnsl[numero] == NULL) { WinInfo *info = (WinInfo *) calloc (sizeof (WinInfo), 1); if (info == NULL) { printf ("cannot allocate buffer for channel %d\n", numero); exit (2); } info->winbuf = (Line *) calloc (sizeof (Line), nblig); info->totlignes = nblig; info->nblignes = 25; for (i = 0; i < nblig; i++) { info->winbuf[i].text[80] = '\0'; memset (info->winbuf[i].text, 0x20, 80); info->winbuf[i].color = 0; info->winbuf[i].color_bis = 0; info->winbuf[i].pos_bis = 0; } cnsl[numero] = info; } } static void CallOkCB (Widget w, XtPointer client_data, XtPointer call_data) { } static void CallCancelCB (Widget w, XtPointer client_data, XtPointer call_data) { sysop_end (); } void sysop_end (void) { if (sysop_on) { XtUnmanageChild (CallDialog); XtDestroyWidget (CallDialog); sysop_on = FALSE; } } void sysop_call (char *texte) { Arg args[20]; Cardinal n; XmString string; if (!sysop_on) { sysop_on = TRUE; string = XmStringCreateSimple (texte); /* Cree la fenetre de l'appel */ n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNtitle, "Sysop call"); n++; XtSetArg (args[n], XmNmessageString, string); n++; CallDialog = XmCreateMessageDialog (toplevel, "call_dialog", args, n); XtAddCallback (CallDialog, XmNokCallback, CallOkCB, NULL); XtAddCallback (CallDialog, XmNcancelCallback, CallCancelCB, NULL); XtUnmanageChild (XmMessageBoxGetChild (CallDialog, XmDIALOG_HELP_BUTTON)); XtManageChild (CallDialog); XmStringFree (string); } } static void deleteCB (Widget w, XtPointer data, XtPointer call) { int numero = (uintptr_t) data; window_close (numero); } static void editCB (Widget w, XtPointer data, XtPointer call) { char *ptr; char buffer[82]; WinInfo *info = (WinInfo *) data; ptr = XmTextFieldGetString (info->line2); XmTextFieldSetString (info->line3, ptr); ptr = XmTextFieldGetString (info->line1); XmTextFieldSetString (info->line2, ptr); ptr = XmTextFieldGetString (info->edit); XmTextFieldSetString (info->line1, ptr); XmTextFieldSetString (info->edit, ""); strcpy (buffer, ptr); if (++histo_pos == NB_HISTO) histo_pos = 0; strcpy (history[histo_pos], buffer); strcat (buffer, "\r"); window_write (CONSOLE, buffer, strlen (buffer), W_CNST, 0); console_input (buffer, strlen (buffer)); } static void KeyEV (Widget w, XtPointer data, XKeyEvent * event) { int i; int lg; int code; char *ptr; XmTextPosition pos; WinInfo *info = (WinInfo *) data; code = event->keycode; if (event->state & 1) code |= 0x100; /* shift */ if (event->state & 4) code |= 0x400; /* control */ if (event->state & 8) code |= 0x800; /* alt */ switch (event->keycode) { case 0x009: /* escape */ ptr = XmTextFieldGetString (info->edit); if (strlen (ptr) == 0) { /* commande Esc */ /* console_inbuf("\033\r", 2); */ } else { /* Efface la commande en cours */ XmTextFieldSetString (info->edit, ""); } XtFree (ptr); break; case 0x062: /* UP */ case 0x162: /* Shift-UP */ /* ligne precedente */ for (i = 0; i < NB_HISTO; i++) { char *ptr = history[histo_pos]; if (histo_pos == 0) histo_pos = NB_HISTO; --histo_pos; if (*ptr) { XmTextFieldSetString (info->edit, ptr); XmTextFieldSetInsertionPosition (info->edit, 80); break; } } break; case 0x068: /* DW */ case 0x168: /* Shift-DW */ /* ligne suivante */ for (i = 0; i < NB_HISTO; i++) { if (++histo_pos == NB_HISTO) histo_pos = 0; if (*history[histo_pos]) { XmTextFieldSetString (info->edit, history[histo_pos]); XmTextFieldSetInsertionPosition (info->edit, 80); break; } } break; case 0x462: /* Ctrl-UP */ /* Scroll UP */ break; case 0x468: /* Ctrl-DW */ /* scroll DW */ break; case 0x063: /* PUP */ case 0x163: /* Shift-PUP */ break; case 0x069: /* PDW */ case 0x169: /* Shift-PDW */ break; case 0x463: /* Ctrl-PUP */ break; case 0x469: /* Ctrl-PDW */ break; } /* Teste la fin de ligne */ pos = XmTextFieldGetInsertionPosition (info->edit); lg = XmTextFieldGetMaxLength (info->edit); if (pos == lg) { char *scan; ptr = XmTextFieldGetString (info->edit); scan = strrchr (ptr, ' '); if (scan) { *scan++ = '\0'; } XmTextFieldSetString (info->edit, ptr); editCB (w, info, NULL); if ((scan) && (*scan)) { XmTextFieldSetString (info->edit, scan); XmTextFieldSetInsertionPosition (info->edit, 80); } XtFree (ptr); } } WinInfo *xcnsl (int numero, Widget pere, int nblig, Arg * argp, Cardinal np) { Arg args[20]; Cardinal n; Pixel foreground; Pixel background; Widget form; WinInfo *info; int mask; XGCValues values; Dimension hg; Widget separe = NULL; int console = (numero == CONSOLE); if (cnsl[numero] == NULL) alloc_buffer (numero, nblig); info = cnsl[numero]; form = XmCreateForm (pere, "form", argp, np); if (display == NULL) display = XtDisplay (form); if (fontinfo == NULL) fontinfo = XLoadQueryFont (display, "6x10"); if (console) { XmFontList fontlist; memset (history, 0, NB_HISTO * 82); fontlist = XmFontListCreate (fontinfo, XmSTRING_DEFAULT_CHARSET); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNmarginHeight, 0); n++; XtSetArg (args[n], XmNmaxLength, 78); n++; XtSetArg (args[n], XmNshadowThickness, 0); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNfontList, fontlist); n++; info->edit = XmCreateTextField (form, "edit", args, n); XtManageChild (info->edit); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, info->edit); n++; XtSetArg (args[n], XmNeditable, FALSE); n++; XtSetArg (args[n], XmNmarginHeight, 0); n++; XtSetArg (args[n], XmNshadowThickness, 0); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNcursorPositionVisible, FALSE); n++; XtSetArg (args[n], XmNfontList, fontlist); n++; info->line1 = XmCreateTextField (form, "line1", args, n); XtManageChild (info->line1); XtSetKeyboardFocus (info->line1, info->edit); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, info->line1); n++; XtSetArg (args[n], XmNeditable, FALSE); n++; XtSetArg (args[n], XmNmarginHeight, 0); n++; XtSetArg (args[n], XmNshadowThickness, 0); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNcursorPositionVisible, FALSE); n++; XtSetArg (args[n], XmNfontList, fontlist); n++; info->line2 = XmCreateTextField (form, "line2", args, n); XtManageChild (info->line2); XtSetKeyboardFocus (info->line2, info->edit); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, info->line2); n++; XtSetArg (args[n], XmNeditable, FALSE); n++; XtSetArg (args[n], XmNmarginHeight, 0); n++; XtSetArg (args[n], XmNshadowThickness, 0); n++; XtSetArg (args[n], XmNhighlightThickness, 0); n++; XtSetArg (args[n], XmNcursorPositionVisible, FALSE); n++; XtSetArg (args[n], XmNfontList, fontlist); n++; info->line3 = XmCreateTextField (form, "line3", args, n); XtManageChild (info->line3); XtSetKeyboardFocus (info->line3, info->edit); n = 0; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, info->line3); n++; separe = XmCreateSeparator (form, "separator", args, n); XtManageChild (separe); XtAddCallback (info->edit, XmNactivateCallback, editCB, (XtPointer) info); XtAddEventHandler (info->edit, KeyPressMask, FALSE, (XtEventHandler) KeyEV, (XtPointer) info); XmFontListFree (fontlist); XtSetKeyboardFocus (form, info->edit); } n = 0; if (console) { XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, separe); n++; } else { XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; } XtSetArg (args[n], XmNrightAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNmaximum, nblig); n++; info->scroll = XmCreateScrollBar (form, "scroll", args, n); XtManageChild (info->scroll); n = 0; if (console) { XtSetArg (args[n], XmNbottomAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNbottomWidget, separe); n++; } else { XtSetArg (args[n], XmNbottomAttachment, XmATTACH_FORM); n++; } XtSetArg (args[n], XmNtopAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNleftAttachment, XmATTACH_FORM); n++; XtSetArg (args[n], XmNrightAttachment, XmATTACH_WIDGET); n++; XtSetArg (args[n], XmNrightWidget, info->scroll); n++; XtSetArg (args[n], XmNwidth, 500); n++; XtSetArg (args[n], XmNheight, 200); n++; info->drawing = XmCreateDrawingArea (form, "drawing", args, n); XtManageChild (info->drawing); XtManageChild (form); XtSetKeyboardFocus (info->drawing, info->edit); n = 0; XtSetArg (args[n], XmNforeground, &foreground); n++; XtSetArg (args[n], XmNbackground, &background); n++; XtSetArg (args[n], XmNheight, &hg); n++; XtGetValues (info->drawing, args, n); /* info->premier = 0; */ mask = GCForeground | GCBackground | GCFont; values.background = background; values.foreground = foreground; values.font = fontinfo->fid; if (dgc == NULL) dgc = XtGetGC (info->drawing, mask, &values); XtAddCallback (info->scroll, XmNvalueChangedCallback, scrollCB, info); XtAddCallback (info->scroll, XmNdragCallback, scrollCB, info); XtAddCallback (info->drawing, XmNexposeCallback, refreshCB, info); XtAddCallback (info->drawing, XmNresizeCallback, resizeCB, info); info->nblignes = hg / (fontinfo->ascent + fontinfo->descent); n = 0; XtSetArg (args[n], XmNpageIncrement, info->nblignes); n++; XtSetArg (args[n], XmNsliderSize, info->nblignes); n++; XtSetArg (args[n], XmNmaximum, info->totlignes); n++; XtSetArg (args[n], XmNvalue, info->totlignes - info->nblignes); n++; XtSetValues (info->scroll, args, n); return (info); } void ShowFbbWindow (int numero, Widget parent) { WinInfo *info; if (cnsl[numero] == NULL) alloc_buffer (numero, 100); info = cnsl[numero]; if (info->frame) { if (XtIsManaged (info->frame)) { XRaiseWindow (XtDisplay (info->frame), XtWindow (info->frame)); } else XtManageChild (info->frame); } else { Arg args[20]; Cardinal n; Atom DelWindow; char buf[80]; if (numero == CONSOLE) { sprintf (buf, "Console"); } else if (numero == MONITOR) { sprintf (buf, "Monitoring"); } else if (numero == ALLCHANN) { sprintf (buf, "All channels"); } n = 0; XtSetArg (args[n], XmNdeleteResponse, XmDO_NOTHING); ++n; XtSetArg (args[n], XmNtitle, buf); ++n; info->frame = XmCreateDialogShell (parent, "cnsl", args, n); xcnsl (numero, info->frame, 100, NULL, 0); XtManageChild (info->frame); DelWindow = XInternAtom (display, "WM_DELETE_WINDOW", FALSE); XmAddWMProtocolCallback (info->frame, DelWindow, deleteCB, (XtPointer)(intptr_t) numero); } fenetre[numero] = 1; } void HideFbbWindow (int numero, Widget parent) { if ((cnsl[numero]) && (cnsl[numero]->frame) && (XtIsManaged (cnsl[numero]->frame))) { XtUnmanageChild (cnsl[numero]->frame); } fenetre[numero] = 0; } void ToggleFbbWindow (int numero, Widget parent) { if ((cnsl[numero]) && (cnsl[numero]->frame) && (XtIsManaged (cnsl[numero]->frame))) { HideFbbWindow (numero, parent); } else { ShowFbbWindow (numero, parent); } } fbb-7.0.10/src/X11/xfbbabtd.c0000644000175000017500000004040613613360505012337 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include static Widget about_dialog = NULL; static Widget copy_dialog = NULL; static Widget info_dialog = NULL; static Widget call_dialog = NULL; static int info_canal; static struct { char str[256]; char prenom[13]; char home[41]; stat_ch sta; int niv1, niv2, niv3, canal, nbmess, nbnew, paclen, memoc; unsigned flags; } prev; static Widget IYapp; static Widget ICall; static Widget IDigis; static Widget IName; static Widget IHome; static Widget IChannel; static Widget IPort; static Widget IN1N2N3; static Widget IFlags; static Widget IPaclen; static Widget IStatus; static Widget IMem; static Widget IBuf; static Widget IRet; static Widget IPerso; static Widget IUnread; static XmString StringCreate(char *text) { XmString xmstr; char *deb; if ((text == NULL) || (text[0] == '\0')) { return(XmStringCreateSimple("")); } xmstr = (XmString)NULL; deb = text; while (*text) { if (*text == '\n') { *text = '\0'; xmstr = XmStringConcat(xmstr, XmStringCreateSimple(deb)); xmstr = XmStringConcat(xmstr, XmStringSeparatorCreate()); *text++ = '\n'; deb = text; } else ++text; } if (*deb) { xmstr = XmStringConcat(xmstr, XmStringCreateSimple(deb)); } return(xmstr); } static char *XVersion(int dat) { static char prodVersion[80]; char sdate[30]; if (dat) sprintf(sdate, " (%s)", date()); else *sdate = '\0'; sprintf(prodVersion, "%s%s", version(), sdate) ; return(prodVersion); } static void OkCB(Widget w, XtPointer client_data, XtPointer call_data) { Widget *pw; pw = (Widget *)client_data; XtUnmanageChild(*pw); XtDestroyWidget(XtParent(*pw)); *pw = NULL;; } static void ApplyCB(Widget w, XtPointer client_data, XtPointer call_data) { Widget *pw; Widget wt; char *ptr; pw = (Widget *)client_data; /* wt = XmSelectionBoxGetChild(call_dialog, XmDIALOG_TEXT); */ wt = XmSelectionBoxGetChild(*pw, XmDIALOG_TEXT); ptr = XmTextGetString(wt); if (!set_callsign(ptr)) { char texte[80]; sprintf(texte, "%s is not a valid callsign !", ptr); MessageBox(60, texte, "Change callsign", MB_ICONEXCLAMATION|MB_OK); get_callsign(texte); XmTextSetString(wt, texte); } else { XtUnmanageChild(*pw); XtDestroyWidget(XtParent(*pw)); *pw = NULL;; } XtFree(ptr); } void CallsignDialog(Widget w, XtPointer client_data, XtPointer call_data) { char buffer[512]; Arg args[20] ; Cardinal n; if (call_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow(XtDisplay(call_dialog),XtWindow(XtParent(call_dialog))); return; } n = 0; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; XtSetArg(args[n], XmNmessageAlignment, XmALIGNMENT_CENTER);n++; call_dialog = XmCreatePromptDialog(toplevel, "callsign", args, n); XtManageChild(XmSelectionBoxGetChild(call_dialog, XmDIALOG_APPLY_BUTTON)); XtUnmanageChild(XmSelectionBoxGetChild(call_dialog, XmDIALOG_OK_BUTTON)); XtUnmanageChild(XmSelectionBoxGetChild(call_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback(call_dialog, XmNapplyCallback, ApplyCB, (XtPointer)&call_dialog); XtAddCallback(call_dialog, XmNcancelCallback, OkCB, (XtPointer)&call_dialog); get_callsign(buffer); XmTextSetString(XmSelectionBoxGetChild(call_dialog, XmDIALOG_TEXT), buffer); XtManageChild(call_dialog); } void AboutDialog(Widget w, XtPointer client_data, XtPointer call_data) { char buffer[512]; Arg args[20] ; Cardinal n; XmString string; if (about_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow(XtDisplay(about_dialog),XtWindow(XtParent(about_dialog))); return; } sprintf(buffer, "XFBB (Linux version)\n\nVersion %s\n\n" "Copyright 1986-1996. All rights reserved." "\n", XVersion(TRUE)); string = StringCreate(buffer); n = 0; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; XtSetArg(args[n], XmNmessageAlignment, XmALIGNMENT_CENTER);n++; XtSetArg(args[n], XmNmessageString, string);n++; about_dialog = XmCreateMessageDialog(toplevel, "about", args, n); XmStringFree(string); XtUnmanageChild(XmMessageBoxGetChild(about_dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild(XmMessageBoxGetChild(about_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback(about_dialog, XmNokCallback, OkCB, (XtPointer)&about_dialog); XtManageChild(about_dialog); } void CopyDialog(Widget w, XtPointer client_data, XtPointer call_data) { char buffer[1024]; Arg args[20] ; Cardinal n; XmString string; if (copy_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow(XtDisplay(copy_dialog),XtWindow(XtParent(copy_dialog))); return; } sprintf(buffer, "\n" " AX25 BBS software - XFBB version %s\n" " (C) F6FBB 1986-1996 (%s)\n\n" "This software is in the public domain. It can be copied or\n" "installed only for amateur use abiding by the laws.\n\n" "All commercial or professional use is prohibited.\n\n" "F6FBB (Jean-Paul ROUBELAT) declines any responsibilty\n" "in the use of XFBB software.\n\n" "This software is free of charge, but a 100 FF or 20 US $\n" "(or more) contribution will be appreciated.\n\n", XVersion(0), date() ) ; string = StringCreate(buffer); n = 0; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; XtSetArg(args[n], XmNmessageString, string);n++; copy_dialog = XmCreateMessageDialog(toplevel, "copyright", args, n); XmStringFree(string); XtUnmanageChild(XmMessageBoxGetChild(copy_dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild(XmMessageBoxGetChild(copy_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback(copy_dialog, XmNokCallback, OkCB, (XtPointer)©_dialog); XtManageChild(copy_dialog); } static void ShowCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("ShowCB\n"); if (info_canal != -1) ShowFbbWindow(info_canal, toplevel); } static Widget CreateInfoLabel(Widget parent, char *name, char *val, uchar alig) { Arg args[10]; Cardinal n; /* XmString string; */ Widget w; n = 0; /* string = XmStringCreateSimple(val); XtSetArg(args[n], XmNlabelString, string);n++; */ XtSetArg(args[n], XmNalignment, alig);n++; XtSetArg(args[n], XmNmarginHeight, 0);n++; w = XmCreateLabel(parent, name, args, n); /* XmStringFree(string); */ XtManageChild(w); return(w); } void InfoDialog(Widget w, XtPointer client_data, XtPointer call_data) { Arg args[20] ; Cardinal n; Widget rc; int nb; /* Lecture du canal courant */ nb = GetChList(); if (nb != -1) info_canal = nb; if (info_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow(XtDisplay(info_dialog),XtWindow(XtParent(info_dialog))); return; } if (nb == -1) return; memset(&prev, 0xff, sizeof(prev)); n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; info_dialog = XmCreateFormDialog(toplevel, "infos", args, n); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 20);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 40);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(info_dialog, "show", args, n); XtAddCallback(w, XmNactivateCallback, ShowCB , 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 60);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 80);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(info_dialog, "close", args, n); XtAddCallback(w, XmNactivateCallback, OkCB, (XtPointer)&info_dialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, w);n++; XtSetArg(args[n], XmNbottomOffset, 10);n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_BEGINNING);n++; IYapp = XmCreateLabel(info_dialog, "info_label", args, n); XtManageChild(IYapp); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, IYapp);n++; XtSetArg(args[n], XmNpacking, XmPACK_COLUMN);n++; XtSetArg(args[n], XmNnumColumns, 2);n++; XtSetArg(args[n], XmNmarginHeight, 0);n++; XtSetArg(args[n], XmNisAligned, FALSE);n++; rc = XmCreateRowColumn(info_dialog, "rc_info", args, n); CreateInfoLabel(rc, "callsign", "Callsign :", XmALIGNMENT_END); CreateInfoLabel(rc, "digis", "Digis :", XmALIGNMENT_END); CreateInfoLabel(rc, "name", "Name :", XmALIGNMENT_END); CreateInfoLabel(rc, "home_bbs", "Home BBS :", XmALIGNMENT_END); CreateInfoLabel(rc, "l_separator", "", XmALIGNMENT_END); CreateInfoLabel(rc, "channel", "Channel :", XmALIGNMENT_END); CreateInfoLabel(rc, "port", "Port :", XmALIGNMENT_END); CreateInfoLabel(rc, "n1_n2_n3", "N1,N2,N3 :", XmALIGNMENT_END); CreateInfoLabel(rc, "flags", "Flags :", XmALIGNMENT_END); CreateInfoLabel(rc, "paclen", "Paclen :", XmALIGNMENT_END); CreateInfoLabel(rc, "status", "Status :", XmALIGNMENT_END); CreateInfoLabel(rc, "l_separator", "", XmALIGNMENT_END); CreateInfoLabel(rc, "mem_used", "Memory used :", XmALIGNMENT_END); CreateInfoLabel(rc, "buffers", "Buffers :", XmALIGNMENT_END); CreateInfoLabel(rc, "retries", "Retries :", XmALIGNMENT_END); CreateInfoLabel(rc, "l_separator", "", XmALIGNMENT_END); CreateInfoLabel(rc, "priv_msg", "Personnal messages :", XmALIGNMENT_END); CreateInfoLabel(rc, "unread_msg", "Unread messages :", XmALIGNMENT_END); ICall = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IDigis = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IName = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IHome = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); CreateInfoLabel(rc, "r_separator", "", XmALIGNMENT_BEGINNING); IChannel = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IPort = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IN1N2N3 = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IFlags = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IPaclen = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IStatus = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); CreateInfoLabel(rc, "r_separator", "", XmALIGNMENT_BEGINNING); IMem = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IBuf = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IRet = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); CreateInfoLabel(rc, "r_separator", "", XmALIGNMENT_BEGINNING); IPerso = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); IUnread = CreateInfoLabel(rc, "info_data", "", XmALIGNMENT_BEGINNING); XtManageChild(rc); DisplayInfoDialog(nb); XtManageChild(info_dialog); } static void InfoLabel(Widget w, char *txt) { XmString string; string = XmStringCreateSimple(txt); XtVaSetValues(w, XmNlabelString, string, NULL); XmStringFree(string); } void DisplayInfoDialog(int voie) { int i; char str[256]; char call[80]; indicat *ind; if ((info_dialog == NULL) || (voie != info_canal)) return; ind = &svoie[info_canal]->sta.indicatif; if (memcmp(ind, &prev.sta.indicatif, sizeof(indicat)) != 0) { prev.sta.indicatif = *ind; if (ind->num) sprintf(call, "%s-%d", ind->call, ind->num); else sprintf(call, "%s", ind->call); InfoLabel(ICall, call); *str = '\0'; for (i = 0 ; i < 2 ; i++) { ind = &svoie[info_canal]->sta.relais[i]; if (*(ind->call)) { if (ind->num) sprintf(call, "%s-%d", ind->call, ind->num); else sprintf(call, "%s", ind->call); if (i > 0) strcat(str, ","); strcat(str, call); } } ind = &svoie[info_canal]->sta.relais[i]; if (*(ind->call)) strcat(str, ",..."); InfoLabel(IDigis, str); } if (strcmp(prev.prenom, svoie[info_canal]->finf.prenom) != 0) { strcpy(prev.prenom, svoie[info_canal]->finf.prenom); InfoLabel(IName, svoie[info_canal]->finf.prenom); } if (strcmp(prev.home, svoie[info_canal]->finf.home) != 0) { strcpy(prev.home, svoie[info_canal]->finf.home); InfoLabel(IHome, svoie[info_canal]->finf.home); } if (info_canal != prev.canal) { prev.canal = info_canal; InfoLabel(IChannel, itoa((info_canal > 0) ? info_canal-1 : info_canal, str, 10)); InfoLabel(IPort, itoa(no_port(info_canal), str, 10)); } if ((svoie[info_canal]->niv1 != prev.niv1) || (svoie[info_canal]->niv2 != prev.niv2) || (svoie[info_canal]->niv3 != prev.niv3)) { prev.niv1 = svoie[info_canal]->niv1; prev.niv2 = svoie[info_canal]->niv2; prev.niv3 = svoie[info_canal]->niv3; sprintf(str, "%02d %02d %02d", svoie[info_canal]->niv1, svoie[info_canal]->niv2, svoie[info_canal]->niv3); InfoLabel(IN1N2N3, str); } if (svoie[info_canal]->finf.flags != prev.flags) { prev.flags = svoie[info_canal]->finf.flags; InfoLabel(IFlags, strflags(&svoie[info_canal]->finf)); } if (svoie[info_canal]->paclen != prev.paclen) { prev.paclen = svoie[info_canal]->paclen; InfoLabel(IPaclen, itoa(svoie[info_canal]->paclen, str, 10)); } if (svoie[info_canal]->sta.stat != prev.sta.stat) { prev.sta.stat = svoie[info_canal]->sta.stat; InfoLabel(IStatus, stat_voie(info_canal)); } if (svoie[info_canal]->memoc != prev.memoc) { prev.memoc = svoie[info_canal]->memoc; InfoLabel(IMem, itoa(svoie[info_canal]->memoc, str, 10)); } if (svoie[info_canal]->sta.ack != prev.sta.ack) { prev.sta.ack = svoie[info_canal]->sta.ack; InfoLabel(IBuf, itoa(svoie[info_canal]->sta.ack, str, 10)); } if (svoie[info_canal]->sta.ret != prev.sta.ret) { prev.sta.ret = svoie[info_canal]->sta.ret; InfoLabel(IRet, itoa(svoie[info_canal]->sta.ret, str, 10)); } if (svoie[info_canal]->ncur) { if (svoie[info_canal]->ncur->nbmess != prev.nbmess) { prev.nbmess = svoie[info_canal]->ncur->nbmess; InfoLabel(IPerso, itoa(svoie[info_canal]->ncur->nbmess, str, 10)); } if (svoie[info_canal]->ncur->nbnew != prev.nbnew) { prev.nbnew = svoie[info_canal]->ncur->nbnew; InfoLabel(IUnread, itoa(svoie[info_canal]->ncur->nbnew, str, 10)); } } else { InfoLabel(IPerso, ""); InfoLabel(IUnread, ""); } if (svoie[info_canal]->niv1 == N_YAPP) yapp_str(info_canal, str); #ifndef __linux__ else if (svoie[info_canal]->niv1 == N_MOD) xmodem_str(info_canal, str); #endif else if (svoie[info_canal]->niv1 == N_BIN) abin_str(info_canal, str); else if (svoie[info_canal]->niv1 == N_XFWD) xfwd_str(info_canal, str); else *str = '\0'; if (strcmp(str, prev.str) != 0) { strcpy(prev.str, str); InfoLabel(IYapp, str); } } fbb-7.0.10/src/X11/xfbbXabtd.c0000644000175000017500000003114513613360505012467 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include #include #include static Widget about_dialog = NULL; static Widget copy_dialog = NULL; static Widget call_dialog = NULL; static XmString StringCreate (char *text) { XmString xmstr; char *deb; if ((text == NULL) || (text[0] == '\0')) { return (XmStringCreateSimple ("")); } xmstr = (XmString) NULL; deb = text; while (*text) { if (*text == '\n') { *text = '\0'; xmstr = XmStringConcat (xmstr, XmStringCreateSimple (deb)); xmstr = XmStringConcat (xmstr, XmStringSeparatorCreate ()); *text++ = '\n'; deb = text; } else ++text; } if (*deb) { xmstr = XmStringConcat (xmstr, XmStringCreateSimple (deb)); } return (xmstr); } char *date (void) { return (__DATE__); } char *version (void) { static char buffer[20]; sprintf (buffer, "%s", VERSION); return (buffer); } static char *XVersion (int dat) { static char prodVersion[80]; char sdate[30]; if (dat) sprintf (sdate, " (%s)", date ()); else *sdate = '\0'; sprintf (prodVersion, "%s%s", version (), sdate); return (prodVersion); } static void CancelCB (Widget w, XtPointer client_data, XtPointer call_data) { Widget *pw; pw = (Widget *) client_data; XtUnmanageChild (*pw); XtDestroyWidget (XtParent (*pw)); *pw = NULL;; } static int is_call (char *call) { int nb; char *trait; char *ptr; trait = strchr (call, '-'); if (trait) *trait = '\0'; nb = 0; ptr = call; while (*ptr) { if (!isalnum (*ptr)) return (0); ++ptr; ++nb; } if ((nb < 4) || (nb > 6)) return (0); if (trait == NULL) return (1); *trait = '-'; nb = 0; ptr = trait + 1; while (*ptr) { if (!isdigit (*ptr)) return (0); ++ptr; } nb = atoi (trait + 1); if ((nb < 0) || (nb > 15)) return (0); return (1); } static void OkCB (Widget w, XtPointer client_data, XtPointer call_data) { Widget *pw; Widget wt; char *ptr; pw = (Widget *) client_data; wt = XmSelectionBoxGetChild (*pw, XmDIALOG_TEXT); ptr = XmTextGetString (wt); if (!is_call (ptr)) { char texte[80]; sprintf (texte, "%s is not a valid callsign !", ptr); MessageBox (60, texte, "Change callsign", MB_ICONEXCLAMATION | MB_OK); } else { strcpy (conf[curconf].mycall, ptr); XtUnmanageChild (*pw); XtDestroyWidget (XtParent (*pw)); *pw = NULL;; Caption (1); } XtFree (ptr); } void CallsignDialog (Widget w, XtPointer client_data, XtPointer call_data) { Arg args[20]; Cardinal n; printf ("calldialog\n"); if (call_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow (XtDisplay (call_dialog), XtWindow (XtParent (call_dialog))); printf ("calldialog up\n"); return; } n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNmessageAlignment, XmALIGNMENT_CENTER); n++; call_dialog = XmCreatePromptDialog (toplevel, "callsign", args, n); XtUnmanageChild (XmSelectionBoxGetChild (call_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback (call_dialog, XmNokCallback, OkCB, (XtPointer) & call_dialog); XtAddCallback (call_dialog, XmNcancelCallback, CancelCB, (XtPointer) & call_dialog); /* get_callsign(buffer); */ XmTextSetString (XmSelectionBoxGetChild (call_dialog, XmDIALOG_TEXT), conf[curconf].mycall); XtManageChild (call_dialog); } typedef struct { Widget wdial; Widget wname; Widget whost; Widget wport; Widget wcall; Widget wpass; } wid_t; static void S_CancelCB (Widget w, XtPointer client_data, XtPointer call_data) { wid_t *pw; pw = (wid_t *) client_data; XtUnmanageChild (pw->wdial); XtDestroyWidget (XtParent (pw->wdial)); pw->wdial = NULL; } int GetConfig (void) { int i; int ret = 0; char *home = getenv ("HOME"); char filename[256]; memset(conf, 0, sizeof(conf)); for (i = 0 ; i < MAX_CONF ; i++) { sprintf(conf[i].name, "Remote %d", i); strcpy(conf[i].host, "localhost"); conf[i].port = 3286; conf[i].mask = FBB_NBCNX | FBB_LISTCNX | FBB_XFBBX; } if (home) { FILE *fptr; char buf[256]; sprintf (filename, "%s/.xfbbX", home); fptr = fopen (filename, "r"); if (fptr) { for (i = 0 ; i < MAX_CONF ; i++) { if (fgets (buf, sizeof(buf), fptr) != NULL) sscanf (buf, "%*s %[^\n]", conf[i].name); if (fgets (buf, sizeof(buf), fptr) != NULL) sscanf (buf, "%*s %s\n", conf[i].host); if (fgets (buf, sizeof(buf), fptr) != NULL) sscanf (buf, "%*s %d\n", &conf[i].port); if (fgets (buf, sizeof(buf), fptr) != NULL) sscanf (buf, "%*s %d\n", &conf[i].mask); if (fgets (buf, sizeof(buf), fptr) != NULL) sscanf (buf, "%*s %[^\n]", conf[i].pass); if (fgets (buf, sizeof(buf), fptr) != NULL) sscanf (buf, "%*s %s\n", conf[i].mycall); LabelSetString (Rmt[i], conf[i].name, NULL); } if (fscanf (fptr, "%*s %d\n", &curconf) != EOF) if (curconf >= MAX_CONF) curconf = 0; fclose (fptr); ret = 1; } else { sprintf (buf, "Cannot read configuration file '%s' !", filename); MessageBox (60, buf, "Configuration", MB_ICONEXCLAMATION | MB_OK); } } for (i = 0 ; i < MAX_CONF ; i++) LabelSetString (Rmt[i], conf[i].name, NULL); /* Set the current config */ XmToggleButtonSetState(Rmt[curconf], True, False); return ret; } int PutConfig (void) { int i; char *home = getenv ("HOME"); if (home) { FILE *fptr; char buf[256], filename[256]; sprintf (filename, "%s/.xfbbX", home); fptr = fopen (filename, "w"); if (fptr) { for (i = 0 ; i < MAX_CONF ; i++) { int mask = conf[i].mask; mask &= ~(FBB_CONSOLE); fprintf (fptr, "name_%d: %s\n", i, conf[i].name); fprintf (fptr, "host_%d: %s\n", i, conf[i].host); fprintf (fptr, "port_%d: %d\n", i, conf[i].port); fprintf (fptr, "mask_%d: %d\n", i, mask); fprintf (fptr, "pass_%d: %s\n", i, conf[i].pass); fprintf (fptr, "call_%d: %s\n", i, conf[i].mycall); } fprintf (fptr, "curr_c: %d\n", curconf); fclose (fptr); return 1; } else { sprintf (buf, "Cannot write configuration file '%s' !", filename); MessageBox (60, buf, "Configuration", MB_ICONEXCLAMATION | MB_OK); } } return 0; } static void S_OkCB (Widget w, XtPointer client_data, XtPointer call_data) { wid_t *pw; char *name; char *host; char *port; char *pass; char *call; char msg[256]; pw = (wid_t *) client_data; /* confname */ name = XmTextFieldGetString (pw->wname); /* hostname */ host = XmTextFieldGetString (pw->whost); /* port */ port = XmTextFieldGetString (pw->wport); /* password */ pass = XmTextFieldGetString (pw->wpass); /* callsign */ call = XmTextFieldGetString (pw->wcall); if (!is_call (call)) { char texte[80]; sprintf (texte, "%s is not a valid callsign !", call); MessageBox (60, texte, "Change callsign", MB_ICONEXCLAMATION | MB_OK); } else { strcpy (conf[curconf].name, name); strcpy (conf[curconf].host, host); strcpy (conf[curconf].pass, pass); strcpy (conf[curconf].mycall, call); conf[curconf].port = atoi (port); LabelSetString (Rmt[curconf], conf[curconf].name, NULL); PutConfig (); XtUnmanageChild (pw->wdial); XtDestroyWidget (XtParent (pw->wdial)); pw->wdial = NULL; close_connection (); sleep(2); if (!init_orb (msg)) { MessageBox (0, msg, "Client connection", MB_OK | MB_ICONEXCLAMATION); } } } void SetupDialog (Widget w, XtPointer client_data, XtPointer call_data) { Arg args[20]; Cardinal n; Widget work_area; int conf_ok; static wid_t wid = {NULL, NULL, NULL, NULL, NULL}; if (wid.wdial) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow (XtDisplay (wid.wdial), XtWindow (XtParent (wid.wdial))); return; } conf_ok = GetConfig (); n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNmessageAlignment, XmALIGNMENT_CENTER); n++; wid.wdial = XmCreatePromptDialog (toplevel, "setup", args, n); XtUnmanageChild (XmSelectionBoxGetChild (wid.wdial, XmDIALOG_HELP_BUTTON)); XtUnmanageChild (XmSelectionBoxGetChild (wid.wdial, XmDIALOG_TEXT)); XtUnmanageChild (XmSelectionBoxGetChild (wid.wdial, XmDIALOG_SELECTION_LABEL)); XtAddCallback (wid.wdial, XmNokCallback, S_OkCB, (XtPointer) & wid); XtAddCallback (wid.wdial, XmNcancelCallback, S_CancelCB, (XtPointer) & wid); n = 0; work_area = XmCreateWorkArea (wid.wdial, "workarea", args, n); n = 0; XtManageChild (XmCreateLabel (work_area, "confname", NULL, 0)); wid.wname = XmCreateTextField (work_area, "txt_host", NULL, 0); XmTextFieldSetString (wid.wname, conf[curconf].name); XtManageChild (wid.wname); XtManageChild (XmCreateLabel (work_area, "hostname", NULL, 0)); wid.whost = XmCreateTextField (work_area, "txt_host", NULL, 0); XmTextFieldSetString (wid.whost, conf[curconf].host); XtManageChild (wid.whost); XtManageChild (XmCreateLabel (work_area, "portnb", NULL, 0)); wid.wport = XmCreateTextField (work_area, "txt_port", NULL, 0); { char txt[80]; sprintf (txt, "%d", conf[curconf].port); XmTextFieldSetString (wid.wport, txt); } XtManageChild (wid.wport); XtManageChild (XmCreateLabel (work_area, "callsign", NULL, 0)); wid.wcall = XmCreateTextField (work_area, "txt_call", NULL, 0); XmTextFieldSetString (wid.wcall, conf[curconf].mycall); XtManageChild (wid.wcall); XtManageChild (XmCreateLabel (work_area, "password", NULL, 0)); wid.wpass = XmCreateTextField (work_area, "txt_pass", NULL, 0); XmTextFieldSetString (wid.wpass, conf[curconf].pass); XtManageChild (wid.wpass); XtManageChild (work_area); XtManageChild (wid.wdial); } void AboutDialog (Widget w, XtPointer client_data, XtPointer call_data) { char buffer[512]; Arg args[20]; Cardinal n; XmString string; if (about_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow (XtDisplay (about_dialog), XtWindow (XtParent (about_dialog))); return; } sprintf (buffer, "xfbbX (Linux version)\n\nVersion %s\n\n" "Copyright 1986-1998. All rights reserved." "\n", XVersion (TRUE)); string = StringCreate (buffer); n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNmessageAlignment, XmALIGNMENT_CENTER); n++; XtSetArg (args[n], XmNmessageString, string); n++; about_dialog = XmCreateMessageDialog (toplevel, "about", args, n); XmStringFree (string); XtUnmanageChild (XmMessageBoxGetChild (about_dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (about_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback (about_dialog, XmNokCallback, CancelCB, (XtPointer) & about_dialog); XtManageChild (about_dialog); } void CopyDialog (Widget w, XtPointer client_data, XtPointer call_data) { char buffer[1024]; Arg args[20]; Cardinal n; XmString string; if (copy_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow (XtDisplay (copy_dialog), XtWindow (XtParent (copy_dialog))); return; } sprintf (buffer, "\n" " AX25 BBS software - XFBB version %s\n" " (C) F6FBB 1986-1998 (%s)\n\n" "This software is in the public domain. It can be copied or\n" "installed only for amateur use abiding by the laws.\n\n" "All commercial or professional use is prohibited.\n\n" "F6FBB (Jean-Paul ROUBELAT) declines any responsibilty\n" "in the use of XFBB software.\n\n" /* "This software is free of charge, but a 100 FF or 20 US $\n" "(or more) contribution will be appreciated.\n\n", */ , XVersion (0), date () ); string = StringCreate (buffer); n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNmessageString, string); n++; copy_dialog = XmCreateMessageDialog (toplevel, "copyright", args, n); XmStringFree (string); XtUnmanageChild (XmMessageBoxGetChild (copy_dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (copy_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback (copy_dialog, XmNokCallback, CancelCB, (XtPointer) & copy_dialog); XtManageChild (copy_dialog); } fbb-7.0.10/src/X11/xfbbedtm.c0000644000175000017500000006221013613360505012353 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include static Widget MsgList; static Widget EditMsgDialog; static Widget From; static Widget Bid; static Widget To; static Widget Via; static Widget Title; static Widget Sent; static Widget Recv; static Widget Size; static Widget EditFwdDialog; static Widget tog_w; static Widget tog_d; static Widget fwd_toggle[NBBBS]; static int fwd_t_val[NBBBS]; static Widget Type[4]; static Widget Stat[7]; static Widget Data; static int on_w; static int on_d; static Pixel color_w; static Pixel color_d; static bullist bullig; static void EditFwdStatus(void); void EditMsgCB(Widget w, XtPointer client_data, XtPointer call_data) { if (XtIsManaged(EditMsgDialog)) { /* Passer la fenetre au 1er plan */ XRaiseWindow(XtDisplay(EditMsgDialog),XtWindow(XtParent(EditMsgDialog))); return; } cursor_wait(); printf("EditMsgCB\n"); FbbRequestMessageList(); XmListSelectPos(MsgList, 1, TRUE); /* XmListSetBottomPos(MsgList, 0); */ XtManageChild(EditMsgDialog); end_wait(); } static void ApplyCB(Widget w, XtPointer client_data, XtPointer call_data) { TextFieldGetString(From, bullig.exped, 6, TRUE); TextFieldGetString(Bid, bullig.bid, 12, TRUE); TextFieldGetString(To, bullig.desti, 6, TRUE); TextFieldGetString(Via, bullig.bbsv, 40, TRUE); TextFieldGetString(Title,bullig.titre, 60, FALSE); if (XmToggleButtonGetState(Type[0])) bullig.type = 'A'; if (XmToggleButtonGetState(Type[1])) bullig.type = 'B'; if (XmToggleButtonGetState(Type[2])) bullig.type = 'P'; if (XmToggleButtonGetState(Type[3])) bullig.type = 'T'; if (XmToggleButtonGetState(Stat[0])) bullig.status = '$'; if (XmToggleButtonGetState(Stat[1])) bullig.status = 'N'; if (XmToggleButtonGetState(Stat[2])) bullig.status = 'Y'; if (XmToggleButtonGetState(Stat[3])) bullig.status = 'F'; if (XmToggleButtonGetState(Stat[4])) bullig.status = 'X'; if (XmToggleButtonGetState(Stat[5])) bullig.status = 'K'; if (XmToggleButtonGetState(Stat[6])) bullig.status = 'A'; SetMsgInfo(&bullig, bullig.numero); } static void CloseCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("CloseCB\n"); XtUnmanageChild((Widget)client_data); XmListDeleteAllItems(MsgList); } static void EditFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("EditFwdCB\n"); EditFwdStatus(); } static void EditTxtCB(Widget w, XtPointer client_data, XtPointer call_data) { char nom[80]; char numero[40]; char msgname[256]; printf("EditTxtCB\n"); sprintf(numero, "Msg #%ld", bullig.numero); strcpy(msgname, mess_name(MessPath(), bullig.numero, nom)); EditorOff = FALSE; CreateEditor(msgname, NULL, numero, 0, TRUE); } static void SelectCB(Widget w, XtPointer client_data, XtPointer call_data) { XmListCallbackStruct *cd = (XmListCallbackStruct *)call_data; char *text; long nb; char buf[80]; XmStringGetLtoR(cd->item, XmSTRING_DEFAULT_CHARSET, &text); sscanf(text, "%ld", &nb); printf("SelectCB %ld\n", nb); if (!GetMsgInfos(&bullig, nb)) return; XmTextFieldSetString(From, bullig.exped); XmTextFieldSetString(To, bullig.desti); XmTextFieldSetString(Via, bullig.bbsv); XmTextFieldSetString(Title, bullig.titre); XmTextFieldSetString(Bid, bullig.bid); sprintf(buf,"%ld", bullig.taille); XmTextFieldSetString(Size, buf); XmTextFieldSetString(Recv, strdt(bullig.date)); XmTextFieldSetString(Sent, strdt(bullig.datesd)); XmToggleButtonSetState(Type[0], (bullig.type == 'A'), FALSE); XmToggleButtonSetState(Type[1], (bullig.type == 'B'), FALSE); XmToggleButtonSetState(Type[2], (bullig.type == 'P'), FALSE); XmToggleButtonSetState(Type[3], (bullig.type == 'T'), FALSE); XmToggleButtonSetState(Stat[0], (bullig.status == '$'), FALSE); XmToggleButtonSetState(Stat[1], (bullig.status == 'N'), FALSE); XmToggleButtonSetState(Stat[2], (bullig.status == 'Y'), FALSE); XmToggleButtonSetState(Stat[3], (bullig.status == 'F'), FALSE); XmToggleButtonSetState(Stat[4], (bullig.status == 'X'), FALSE); XmToggleButtonSetState(Stat[5], (bullig.status == 'K'), FALSE); XmToggleButtonSetState(Stat[6], (bullig.status == 'A'), FALSE); XmToggleButtonSetState(Data, (bullig.bin), FALSE); } void EditMessage(Widget toplevel) { Arg args[20] ; Cardinal n; Widget rcl; Widget rcr; Widget rc2; Widget rc3; Widget rc4; Widget w; Widget f; Widget rcTitle; Widget rcVia; Widget rcType; Widget rcData; Widget rcStat; n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; EditMsgDialog = XmCreateFormDialog(toplevel, "edit_msg", args, n); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 2);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 22);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditMsgDialog, "apply", args, n); XtAddCallback(w, XmNactivateCallback, ApplyCB, 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 27);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 47);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditMsgDialog, "edit_fwd", args, n); XtAddCallback(w, XmNactivateCallback, EditFwdCB, 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 52);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 72);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditMsgDialog, "edit_text", args, n); XtAddCallback(w, XmNactivateCallback, EditTxtCB, 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 77);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 97);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditMsgDialog, "close", args, n); XtAddCallback(w, XmNactivateCallback, CloseCB, (XtPointer)EditMsgDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, w);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcTitle = XmCreateRowColumn(EditMsgDialog, "rcTitle", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcTitle, "title", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 40);n++; Title = XmCreateTextField(rcTitle, "TextF", args, n); XtManageChild(Title); XtManageChild(rcTitle); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcTitle);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rcVia = XmCreateRowColumn(EditMsgDialog, "rcVia", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rcVia, "via", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 40);n++; Via = XmCreateTextField(rcVia, "TextF", args, n); XtManageChild(Via); XtManageChild(rcVia); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 50);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcVia);n++; rcl = XmCreateForm(EditMsgDialog, "rc", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 50);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcVia);n++; rcr = XmCreateForm(EditMsgDialog, "rc", args, n); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rc2 = XmCreateRowColumn(rcl, "rc", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rc2, "to", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 15);n++; To = XmCreateTextField(rc2, "TextF", args, n); XtManageChild(To); XtManageChild(rc2); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rc2);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rc3 = XmCreateRowColumn(rcl, "rc", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rc3, "bid", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 15);n++; Bid = XmCreateTextField(rc3, "TextF", args, n); XtManageChild(Bid); XtManageChild(rc3); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rc3);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rc4 = XmCreateRowColumn(rcl, "rc", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rc4, "from", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 15);n++; From = XmCreateTextField(rc4, "TextF", args, n); XtManageChild(From); XtManageChild(rc4); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_END);n++; w = XmCreateLabel(rcl, "msg", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNtopOffset, 5);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNleftOffset, 5);n++; XtSetArg(args[n], XmNleftWidget, w);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rc4);n++; XtSetArg(args[n], XmNbottomOffset, 5);n++; XtSetArg(args[n], XmNvisibleItemCount, 15);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; MsgList = XmCreateScrolledList(rcl, "message_list", args, n); XtAddCallback(MsgList, XmNbrowseSelectionCallback, SelectCB, NULL); XtManageChild(MsgList); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rc2 = XmCreateRowColumn(rcr, "rc", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rc2, "size", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 15);n++; XtSetArg(args[n], XmNeditable, FALSE);n++; XtSetArg(args[n], XmNcursorPositionVisible, FALSE);n++; Size = XmCreateTextField(rc2, "TextF", args, n); XtManageChild(Size); XtManageChild(rc2); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rc2);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rc3 = XmCreateRowColumn(rcr, "rc", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rc3, "recv", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 15);n++; XtSetArg(args[n], XmNeditable, FALSE);n++; XtSetArg(args[n], XmNcursorPositionVisible, FALSE);n++; Recv = XmCreateTextField(rc3, "TextF", args, n); XtManageChild(Recv); XtManageChild(rc3); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rc3);n++; XtSetArg(args[n], XmNorientation, XmHORIZONTAL);n++; XtSetArg(args[n], XmNentryAlignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNmarginWidth, 0);n++; rc4 = XmCreateRowColumn(rcr, "rc", args, n); n = 0; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(rc4, "sent", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNcolumns, 15);n++; XtSetArg(args[n], XmNeditable, FALSE);n++; XtSetArg(args[n], XmNcursorPositionVisible, FALSE);n++; Sent = XmCreateTextField(rc4, "TextF", args, n); XtManageChild(Sent); XtManageChild(rc4); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; f = XmCreateForm(rcr, "form", args, n); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; rcStat = XmCreateRadioBox(f, "rcStat", args, n); n = 0; XtSetArg(args[n], XmNhighlightThickness, 0);n++; Stat[0] = XmCreateToggleButton(rcStat, "$", args, n); Stat[1] = XmCreateToggleButton(rcStat, "N", args, n); Stat[2] = XmCreateToggleButton(rcStat, "Y", args, n); Stat[3] = XmCreateToggleButton(rcStat, "F", args, n); Stat[4] = XmCreateToggleButton(rcStat, "X", args, n); Stat[5] = XmCreateToggleButton(rcStat, "K", args, n); Stat[6] = XmCreateToggleButton(rcStat, "A", args, n); XtManageChildren(Stat, 7); XtManageChild(rcStat); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightWidget, rcStat);n++; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_END);n++; w = XmCreateLabel(f, "status", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightWidget, rcStat);n++; XtSetArg(args[n], XmNrightOffset, 30);n++; rcType = XmCreateRadioBox(f, "rcType", args, n); n = 0; XtSetArg(args[n], XmNhighlightThickness, 0);n++; Type[0] = XmCreateToggleButton(rcType, "A", args, n); Type[1] = XmCreateToggleButton(rcType, "B", args, n); Type[2] = XmCreateToggleButton(rcType, "P", args, n); Type[3] = XmCreateToggleButton(rcType, "T", args, n); XtManageChildren(Type, 4); XtManageChild(rcType); n = 0; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, rcType);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightWidget, rcStat);n++; XtSetArg(args[n], XmNrightOffset, 30);n++; rcData = XmCreateRadioBox(f, "rcData", args, n); n = 0; XtSetArg(args[n], XmNhighlightThickness, 0);n++; XtSetArg(args[n], XmNshadowThickness, 0);n++; Data = XmCreateToggleButton(rcData, " ", args, n); XtManageChild(Data); XtSetSensitive(Data, FALSE); XtManageChild(rcData); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, rcType);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightWidget, rcType);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(f, "type", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_OPPOSITE_WIDGET);n++; XtSetArg(args[n], XmNtopWidget, rcData);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNrightWidget, rcData);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNwidth, 40);n++; XtSetArg(args[n], XmNalignment, XmALIGNMENT_END);n++; XtSetArg(args[n], XmNrecomputeSize, FALSE);n++; w = XmCreateLabel(f, "data", args, n); XtManageChild(w); XtManageChild(f); XtManageChild(rcl); XtManageChild(rcr); } #if 0 main(int ac, char **av) { Arg args[20] ; Cardinal n; Widget toplevel; Widget rc; Widget bp; Widget EditMsgDialog; XtAppContext app_context; toplevel = XtAppInitialize(&app_context, "TM", NULL, 0, &ac, av, NULL,NULL, 0); n = 0; XtSetArg(args[n], XmNallowShellResize, True);n++; XtSetValues(toplevel, args, n); EditMessage(toplevel); rc = XmCreateRowColumn(toplevel, "rc", NULL, 0); bp = XmCreatePushButton(rc, "Edit Message", NULL, 0); XtAddCallback(bp, XmNactivateCallback, EditMsgCB, NULL); XtManageChild(bp); XtManageChild(rc); XtRealizeWidget(toplevel); /* Main Loop */ XtAppMainLoop(app_context); } #endif void AddMessageList(char *number) { XmString string; string = XmStringCreateSimple(number); XmListAddItem(MsgList, string, 0); XmStringFree(string); } static void ApplyFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { int nobbs; int noctet; int cmpmsk; for (nobbs = 0 ; nobbs < NBBBS ; nobbs++) { noctet = nobbs / 8 ; cmpmsk = 1 << (nobbs % 8) ; switch (fwd_t_val[nobbs]) { case 0 : clr_bit_fwd(bullig.fbbs, nobbs+1); clr_bit_fwd(bullig.forw, nobbs+1); break; case 1 : clr_bit_fwd(bullig.fbbs, nobbs+1); set_bit_fwd(bullig.forw, nobbs+1); break; case 2 : set_bit_fwd(bullig.fbbs, nobbs+1); clr_bit_fwd(bullig.forw, nobbs+1); break; } } SetMsgInfo(&bullig, bullig.numero); clear_fwd(bullig.numero) ; ins_fwd(&bullig) ; } static void CloseFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { printf("CloseCB\n"); XtUnmanageChild((Widget)client_data); XtDestroyWidget(XtParent((Widget)client_data)); } static void DisplayToggle(Widget w, int val) { Cardinal n; Arg args[20] ; n = 0; switch (val) { case 0 : XtSetArg(args[n], XmNset, False); n++; XtSetArg(args[n], XmNselectColor, color_w); n++; XtSetArg(args[n], XmNindicatorOn, on_w); n++; break; case 1 : XtSetArg(args[n], XmNset, True); n++; XtSetArg(args[n], XmNselectColor, color_w); n++; XtSetArg(args[n], XmNindicatorOn, on_w); n++; break; case 2 : XtSetArg(args[n], XmNset, True); n++; XtSetArg(args[n], XmNselectColor, color_d); n++; XtSetArg(args[n], XmNindicatorOn, on_d); n++; break; } XtSetValues(w, args, n); } static void EditToggleCB(Widget w, XtPointer client_data, XtPointer call_data) { int num = (uintptr_t)client_data; if (fwd_t_val[num] == -1) { DisplayToggle(w, 0); } else { if (++fwd_t_val[num] == 3) fwd_t_val[num] = 0; DisplayToggle(w, fwd_t_val[num]); } } static void UpdateFwdChecks(Widget *toggle) { int i; int val; int noctet; int cmpmsk; XtVaGetValues(tog_w, XmNselectColor, &color_w, XmNindicatorOn, &on_w, NULL); XtVaGetValues(tog_d, XmNselectColor, &color_d, XmNindicatorOn, &on_d, NULL); for (i = 0 ; i < NBBBS ; i++) { if (fwd_t_val[i] == -1) { DisplayToggle(toggle[i], 0); XtSetSensitive(toggle[i], False); continue; } noctet = i / 8 ; cmpmsk = 1 << (i % 8) ; val = ((bullig.forw[noctet]) & (cmpmsk)) ? 1 : 0; if (val == 0) val = ((bullig.fbbs[noctet]) & (cmpmsk)) ? 2 : 0; fwd_t_val[i] = val; DisplayToggle(toggle[i], val); } } static void EditFwdStatus(void) { Cardinal n; Arg args[20] ; Widget w; Widget fwd_rc; int i; XmString string; char ifwd[NBBBS][7]; ch_bbs(1, ifwd); printf("Msg #%ld\n", bullig.numero); n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; EditFwdDialog = XmCreateFormDialog(toplevel, "edit_fwd", args, n); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditFwdDialog, "apply", args, n); XtAddCallback(w, XmNactivateCallback, ApplyFwdCB, 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNleftWidget, w);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(EditFwdDialog, "close", args, n); XtAddCallback(w, XmNactivateCallback, CloseFwdCB, (XtPointer)EditFwdDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreateLabel(EditFwdDialog, "fwd_label_exd", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightWidget, w);n++; tog_d = XmCreateToggleButton(EditFwdDialog, "fwd_toggle_exd", args, n); XtManageChild(tog_d); n = 0; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, tog_d);n++; w = XmCreateLabel(EditFwdDialog, "fwd_label_exw", args, n); XtManageChild(w); n = 0; XtSetArg(args[n], XmNrightAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, tog_d);n++; XtSetArg(args[n], XmNrightWidget, w);n++; tog_w = XmCreateToggleButton(EditFwdDialog, "fwd_toggle_exw", args, n); XtManageChild(tog_w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, tog_w);n++; XtSetArg(args[n], XmNpacking, XmPACK_COLUMN);n++; XtSetArg(args[n], XmNnumColumns, 4);n++; fwd_rc = XmCreateRowColumn(EditFwdDialog, "fwd_rc", args, n); XtManageChild(fwd_rc); for (i = 0 ; i < NBBBS ; i++) { n = 0; if (*ifwd[i]) { string = XmStringCreateSimple(ifwd[i]); XtSetArg(args[n], XmNfillOnSelect, True); n++; } else { string = XmStringCreateSimple(" "); XtSetArg(args[n], XmNfillOnSelect, False); n++; fwd_t_val[i] = -1; } XtSetArg(args[n], XmNlabelString, string);n++; XtSetArg(args[n], XmNvisibleWhenOff, True); n++; fwd_toggle[i] = XmCreateToggleButton(fwd_rc, "fwd_toggle", args, n); XtAddCallback(fwd_toggle[i], XmNvalueChangedCallback, EditToggleCB, (XtPointer)(intptr_t)i); XmStringFree(string); } XtManageChildren(fwd_toggle, NBBBS); UpdateFwdChecks(fwd_toggle); XtManageChild(EditFwdDialog); } fbb-7.0.10/src/X11/xfbbmain.c0000644000175000017500000011064413613360505012353 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include void WinMessage (int temps, char *text); void WinDebug (char *fmt,...); int can_talk (int); static int orig_percent; static int orig_pitch; static int orig_duration; /* char *strlwr(char *txt) { char *ptr = txt; while (*ptr) { if (isupper(*ptr)) *ptr = tolower(*ptr); ++ptr; } return(txt); } */ void FbbSync (void) { /* XEvent event; while (XtAppPending(app_context)) { printf("Deb\n"); XtAppNextEvent(app_context, &event); XtDispatchEvent(&event); printf("Fin\n"); } */ XmUpdateDisplay (toplevel); XmUpdateDisplay (toplevel); } void WinMSleep (unsigned milliseconds) { usleep (milliseconds * 1000); } void WinSleep (unsigned seconds) { sleep (seconds); } void DialogHelpCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 2; } void DialogOkCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 1; } void DialogCancelCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 0; } void RaiseEV (Widget w, XtPointer client_data, XEvent * event) { if (event->type != VisibilityNotify) return; XRaiseWindow (XtDisplay (w), XtWindow (XtParent (w))); } /* static void MessageBoxTimeOutCB(XtPointer client_data, XtIntervalId id) { printf("MessageBoxTimeOutCB\n"); *((int *)client_data) = 1; } */ int MessageBox (int sec, char *texte, char *titre, int flags) { Arg args[20]; Cardinal n; Widget dialog; XEvent event; XmString string; int type; time_t temps; int retour = -1; n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; XtSetArg (args[n], XmNtitle, titre); n++; /* XtSetArg(args[n], XmNdialogType, XmDIALOG_QUESTION);n++; */ dialog = XmCreateMessageDialog (toplevel, "Warning", args, n); XtAddCallback (dialog, XmNokCallback, DialogOkCB, (XtPointer) & retour); XtAddCallback (dialog, XmNcancelCallback, DialogCancelCB, (XtPointer) & retour); XtAddCallback (dialog, XmNhelpCallback, DialogHelpCB, (XtPointer) & retour); XtAddEventHandler (dialog, VisibilityChangeMask, FALSE, (XtEventHandler) RaiseEV, NULL); switch (flags & 0xf0) { case 0x10: type = XmDIALOG_ERROR; break; case 0x20: type = XmDIALOG_QUESTION; break; case 0x30: type = XmDIALOG_WARNING; break; case 0x40: type = XmDIALOG_INFORMATION; break; default: type = XmDIALOG_MESSAGE; break; } string = XmStringCreateSimple ("No"); n = 0; XtSetArg (args[n], XmNdialogType, type); n++; XtSetArg (args[n], XmNhelpLabelString, string); n++; XtSetValues (dialog, args, n); XmStringFree (string); flags &= 0xf; if (flags == MB_OK) { XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON)); } else if (flags == MB_OKCANCEL) { XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_HELP_BUTTON)); } else { /* YESNO et YESNOCANCEL */ string = XmStringCreateSimple ("Yes"); n = 0; XtSetArg (args[n], XmNokLabelString, string); n++; XtSetValues (dialog, args, n); XmStringFree (string); if (flags == MB_YESNO) { XtUnmanageChild (XmMessageBoxGetChild (dialog, XmDIALOG_CANCEL_BUTTON)); } } string = XmStringCreateSimple (texte); n = 0; XtSetArg (args[n], XmNmessageString, string); n++; XtSetValues (dialog, args, n); XmStringFree (string); XtManageChild (dialog); XtAddGrab (dialog, TRUE, TRUE); if (sec > 0) { temps = time (NULL) + (time_t) sec; } else { temps = 0; } while (retour == -1) { if (XtAppPending (app_context)) { XtAppNextEvent (app_context, &event); XtDispatchEvent (&event); } else usleep (100000); if ((temps) && (temps < time (NULL))) { retour = 1; break; } } XtRemoveGrab (dialog); XtUnmanageChild (dialog); XtDestroyWidget (XtParent (dialog)); return (retour); } int editor_on (void) { return (EditorOff != TRUE); } int xfbb_edit (void) { int error = 0; char tmp[1024]; char fn[128]; char bbsv[40]; printf ("xfbb_edit, reply = %d\n", reply); *tmp = '\0'; if (reply) { char ftmp[80]; if (pvoie->enrcur) strcpy (fn, mess_name (MESSDIR, pvoie->enrcur, ftmp)); else *fn = '\0'; } if (*ptmes->bbsv) { sprintf (bbsv, "@ %s", ptmes->bbsv); } else *bbsv = '\0'; if (reply == 1) { sprintf (tmp, "Reply: %s %s", ptmes->desti, bbsv); } else if (reply == 3) { sprintf (tmp, "Mail: %s %s", ptmes->desti, bbsv); } else if (reply == 4) { sprintf (tmp, "Msg: %ld", pvoie->enrcur); } tmp[50] = '\0'; if (reply == 4) CreateEditor (fn, NULL, tmp, ED_EDITMSG, TRUE); else CreateEditor (NULL, fn, tmp, ED_MESSAGE, TRUE); return (error); } int end_xfbb_edit (void) { return 1; } void end_edit (int check) { if (check) { cursor_wait (); init_bbs (); test_buf_fwd (); init_buf_swap (); init_buf_rej (); load_themes (); end_wait (); } EditorOff = TRUE; } int record_message (char *ptr, int len) { selvoie (CONSOLE); if (ptr) { if (!get_mess_fwd ('\0', ptr, len, 2)) get_mess_fwd ('\0', "\032", 1, 2); } retour_mbl (); aff_etat ('E'); send_buf (voiecur); reply = 0; return (1); } int fbb_exec (char *commande) { return (False); } void fbb_quit (unsigned retour) { /* closecom(); */ sortie_prg (); exit (retour); } int fbb_list (int update) { static int nb_prec = -1; int nb = 0; int i; XmString string; for (i = 0; i < NBVOIES; i++) { if (svoie[i]->sta.connect) ++nb; } if ((nb >= 0) && (nb != nb_prec)) { char buffer[80]; nb_prec = nb; if (DEBUG) { strcpy (buffer, "TEST Mode"); } else { if (nb == 0) strcpy (buffer, "No connected station"); else sprintf (buffer, "%d connected station%c", nb, (nb > 1) ? 's' : '\0'); } LabelSetString (ConnectLabel, buffer, (DEBUG) ? "RC" : NULL); } XmListDeleteAllItems (ConnectList); for (i = 0; i < NBVOIES; i++) { if (svoie[i]->sta.connect) { int ok = 0; int nobbs; int ch; struct tm *sdate; unsigned t_cnx; Forward *pfwd; char bbs[10]; char buffer[80]; char call[20]; int choix = 0; int fwd = 0; /* Test du forward */ ok = 0; *bbs = '\0'; pfwd = p_port[no_port (i)].listfwd; while (pfwd) { if ((svoie[i]->curfwd) && (pfwd->forward == i)) { nobbs = svoie[i]->bbsfwd; choix = (int) svoie[i]->cur_choix; strn_cpy (6, bbs, bbs_ptr + (nobbs - 1) * 7); ok = 1; fwd = 1; } pfwd = pfwd->suite; } if ((!ok) && (svoie[i]->mode & F_FOR) && (i != CONSOLE)) { fwd = 2; strcpy (bbs, svoie[i]->sta.indicatif.call); } strlwr (bbs); if (P_TOR (i)) { int port = no_port (i); if (p_port[port].t_wait) { fwd = 3; strcpy (bbs, "F-Wait"); } else if (p_port[port].t_busy) { fwd = 3; strcpy (bbs, "F-Chck"); } } /* Affichage */ sdate = localtime (&(svoie[i]->debut)); t_cnx = (unsigned) (time (NULL) - svoie[i]->debut); if (i == 1) ch = 99; else ch = (i > 0) ? i - 1 : i; if (svoie[i]->sta.indicatif.num) sprintf (call, "%s-%d", svoie[i]->sta.indicatif.call, svoie[i]->sta.indicatif.num); else sprintf (call, "%s", svoie[i]->sta.indicatif.call); sprintf (buffer, "%02d %-9s %02d:%02d %02d:%02d %2d %3d %c%c%s", ch, call, sdate->tm_hour, sdate->tm_min, t_cnx / 3600, (t_cnx / 60) % 60, svoie[i]->sta.ret, svoie[i]->sta.ack, (choix < 2) ? ' ' : '0' + choix, (choix < 2) ? ' ' : '/', bbs ); if (fwd == 1) string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "RC"); else if (fwd == 2) string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "BC"); else if (fwd == 3) string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "BF"); else string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "NO"); XmListAddItem (ConnectList, string, 0); XmStringFree (string); } } SetChList (FALSE); return (nb); } int call_dll (char *cmd, int mode, char *buffer, int len, char *data) { /* int i; int point = 0; char dll_name[80]; char *ptr; int retour = -1; // Looking for DLL in the command ptr = cmd; i = 0; while (*ptr) { if (!isgraph(*ptr)) break; if (*ptr == '.') point = 1; dll_name[i++] = *ptr; ++ptr; } dll_name[i] = '\0'; if (!point) strcat(dll_name, ".DLL"); { // Appel DLL HINSTANCE hinstFilter; SetErrorMode(DEFAULT_ERROR_MODE|SEM_NOOPENFILEERRORBOX); hinstFilter = LoadLibrary(dll_name); if (hinstFilter > HINSTANCE_ERROR) { int ac = 0; char *av[30]; av[ac] = strtok(cmd, " "); while (av[ac]) { ++ac; av[ac] = strtok(NULL, " "); } if (mode == REPORT_MODE) { int (FAR PASCAL *DllProc)(int ac, char FAR **av, char FAR *, int len); (FARPROC) DllProc = GetProcAddress(hinstFilter, "svc_main"); if (DllProc) retour = (*DllProc)(ac, (char FAR **)av, (char FAR *)buffer, len); } else { int (FAR PASCAL *DllProc)(int ac, char FAR **av); (FARPROC) DllProc = GetProcAddress(hinstFilter, "dll_main"); if (DllProc) retour = (*DllProc)(ac, (char FAR **)av); } FreeLibrary(hinstFilter); } SetErrorMode(DEFAULT_ERROR_MODE); } return(retour); */ return (-1); } /* cmd : tableau des commandes a executer nb_cmd : nombre de commandes a executer mode : REPORT_MODE : attend un fichier log en retour NO_REPORT_MODE : pas de fichier log en retour log : nom du fichier de retour xdir : repertoire dans lequel doivent s'executer les commandes */ int call_nbdos (char **cmd, int nb_cmd, int mode, char *log, char *xdir, char *data) { /* Appel DOS */ int i; int ExitCode = 0; char *ptr; char file[256]; char buf[256]; char dir[256]; char arg[256]; if (log) sprintf (file, " %s 2>&1", back2slash (log)); else sprintf (file, " > 8; printf ("retour = %x\n", retour); if (ExitCode == 127) ExitCode = -1; printf ("ExitCode = %d\n", ExitCode); } return (ExitCode); } int filter (char *ligne, char *buffer, int len, char *data, char *xdir) { char deroute[80]; int retour; sprintf (deroute, "%sEXECUTE.xxx", MBINDIR); retour = call_nbdos (&ligne, 1, REPORT_MODE, deroute, xdir, data); /* retour = wait_dos(ligne, deroute); */ if (retour != -1) { outfichs (deroute); } unlink (deroute); return (retour); } void CompressPosition (int mode, int val, long numero) { Arg args[10]; Cardinal n; Pixel color; if (val == 0) val = 1; switch (mode) { case 0: color = df_pixel; val = 100; break; case 1: color = rc_pixel; break; case 2: color = bc_pixel; break; default: color = bc_pixel; break; } n = 0; XtSetArg (args[n], XmNsliderSize, val); n++; XtSetArg (args[n], XmNbackground, color); n++; XtSetValues (Jauge, args, n); FbbSync (); } void FbbStatus (char *callsign, char *texte) { if (!foothelp) { char buffer[80]; sprintf (buffer, "%-15s %s", callsign, texte); LabelSetString (Footer, buffer, NULL); } } void FbbMem (int update) { static long old_us = 0xffffffffL; static long old_avail = 0; static time_t old_time = 0L; static int old_getd = 0; static int old_gMem = -1; static long old_nbmess = -1L; static long old_temp = 0; int gMem = nb_ems_pages (); long us = mem_alloue; char texte[80]; time_t new_time = time (NULL); /* positionne tot_mem a la taille de memoire dispo tot_mem = 1000000L; */ if (operationnel == -1) return; /* Mise a jour toutes les secondes */ if (old_time == new_time) return; old_time = new_time; if (us < 0L) us = 0L; if (us != old_us) { sprintf (texte, ": %ld", us); LabelSetString (Used, texte, NULL); old_us = us; } if (gMem != old_gMem) { sprintf (texte, ": %d K", gMem << 4); LabelSetString (GMem, texte, NULL); old_gMem = gMem; } /* Test disque toutes les 10 secondes */ if (old_getd == 0) { struct statfs dfree; fsid_t fsid; if (statfs (DATADIR, &dfree) == 0) { if (dfree.f_bavail != old_avail) { sys_disk = dfree.f_bavail * (dfree.f_bsize / 1024L); LabelSetString (TxtDisk1, "Disk#1 free", (sys_disk < 1000) ? "RC" : NULL); /* FbbApp->FbbDiskTxt->IntVal = (sys_disk < 100); */ sprintf (texte, ": %ld K", sys_disk); /* FbbApp->FbbDisk->IntVal = (sys_disk < 100); */ /* FbbApp->FbbDisk->SetText(texte); */ LabelSetString (Disk1, texte, (sys_disk < 1000) ? "RC" : NULL); old_avail = dfree.f_bavail; memcpy (&fsid, &dfree.f_fsid, sizeof (fsid)); } } if ((statfs (MBINDIR, &dfree) == 0) && (dfree.f_bavail != old_avail)) /* (memcmp(&fsid, &dfree.f_fsid,sizeof(fsid_t)) != 0)) */ { if (dfree.f_bavail != old_temp) { tmp_disk = dfree.f_bavail * (dfree.f_bsize / 1024L); LabelSetString (TxtDisk2, "Disk#2 free", (tmp_disk < 1000) ? "RC" : NULL); /* FbbApp->FbbDiskTxt->IntVal = (sys_disk < 100); */ sprintf (texte, ": %ld K", tmp_disk); /* FbbApp->FbbDisk->IntVal = (sys_disk < 100); */ /* FbbApp->FbbDisk->SetText(texte); */ LabelSetString (Disk2, texte, (tmp_disk < 1000) ? "RC" : NULL); XtManageChild (Disk2); XtManageChild (TxtDisk2); old_temp = dfree.f_bavail; } } else { tmp_disk = sys_disk; XtUnmanageChild (Disk2); XtUnmanageChild (TxtDisk2); } old_getd = 10; } else --old_getd; if (nbmess != old_nbmess) { sprintf (texte, ": %ld", nbmess); LabelSetString (Msgs, texte, NULL); old_nbmess = nbmess; } /* val = GetFreeSystemResources(GFSR_SYSTEMRESOURCES); if (val != old_system) { sprintf(texte, "Syst: %d%%", val); FbbApp->FbbSystem->SetText(texte); FbbApp->FbbSystem->UpdateWindow(); old_system = val; } val = GetFreeSystemResources(GFSR_USERRESOURCES); if (val != old_user) { sprintf(texte, ": %d %%", val); FbbApp->FbbUser->SetText(texte); FbbApp->FbbUser->UpdateWindow(); old_user = val; } val = GetFreeSystemResources(GFSR_GDIRESOURCES); if (val != old_gdi) { sprintf(texte, ": %d %%", val); FbbApp->FbbGdi->SetText(texte); FbbApp->FbbGdi->UpdateWindow(); old_gdi = val; } if (nbmess != old_nbmess) { sprintf(texte, ": %ld", nbmess); FbbApp->FbbMsg->SetText(texte); FbbApp->FbbMsg->UpdateWindow(); old_nbmess = nbmess; } */ } void DisplayResync (int port, int nb) { static int tot_resync = 0; char texte[80]; if (nb) { if (nb == 1) { LabelSetString (TxtResync, "Resynchro", "RC"); ++tot_resync; } sprintf (texte, ": (%d) %d", port, nb); LabelSetString (Resync, texte, "RC"); } else { LabelSetString (TxtResync, "Resynchro", NULL); sprintf (texte, ": %d ", tot_resync); LabelSetString (Resync, texte, NULL); } } /* void AddListFwd(int mode, char *bbs) { switch (mode) { case 0 : FbbApp->ForwardList->SetRedraw(FALSE); FbbApp->ForwardList->ClearList(); break; case 1 : FbbApp->ForwardList->AddString(bbs); break; case 2 : FbbApp->ForwardList->SetRedraw(TRUE); FbbApp->ForwardList->Invalidate(); break; } } */ void ShowError (char *titre, char *info, int lig) { printf ("%s : %s %d\n", titre, info, lig); /* char texte[80]; sndPlaySound("SystemExclamation", SND_ASYNC); if(lig > 0) wsprintf(texte, "%s %d", info, lig); else strcpy(texte, info); FbbApp->Box(60, texte, titre, IDI_EXCLAMATION); */ } void WinMessage (int temps, char *text) { MessageBox (temps, text, "Message", MB_ICONEXCLAMATION | MB_OK); } void WMessage (int temps, char *text, char *message) { MessageBox (temps, text, message, MB_ICONEXCLAMATION | MB_OK); } static void InfoMessageTimeOutCB (XtPointer client_data, XtIntervalId id) { printf ("XtAddTimeOutCB\n"); InfoMessage (-1, NULL, NULL); } void InfoMessage (int temps, char *texte, char *titre) { static Widget InfoW = NULL; Arg args[10]; Cardinal n; if (InfoW == NULL) { n = 0; XtSetArg (args[n], XmNautoUnmanage, FALSE); n++; InfoW = XmCreateMessageDialog (toplevel, "info_msg", args, n); XtUnmanageChild (XmMessageBoxGetChild (InfoW, XmDIALOG_OK_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (InfoW, XmDIALOG_CANCEL_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (InfoW, XmDIALOG_HELP_BUTTON)); XtUnmanageChild (XmMessageBoxGetChild (InfoW, XmDIALOG_SEPARATOR)); } if (texte == NULL) { if (InfoW) { sleep (1); XtUnmanageChild (InfoW); } } else { XmString string; n = 0; if (titre) { XtSetArg (args[n], XmNtitle, titre); n++; } else sleep (1); /* XtSetArg(args[n], XmNwidth, 300);n++; */ XtSetValues (XtParent (InfoW), args, n); string = XmStringCreateSimple (texte); n = 0; XtSetArg (args[n], XmNdialogType, XmDIALOG_INFORMATION); n++; XtSetArg (args[n], XmNmessageString, string); n++; XtSetValues (InfoW, args, n); XmStringFree (string); if (titre) XtManageChild (InfoW); if (temps > 0) { printf ("XtAddTimeOut %d\n", temps); XtAppAddTimeOut (app_context, temps * 1000, (XtTimerCallbackProc) InfoMessageTimeOutCB, NULL); } FbbSync (); } } void CloseFbbWindow (int numero) { if (numero == 0) sysop_end (); HideFbbWindow (numero, toplevel); } int sel_option (char *texte, int *val) { int res = MessageBox (0, texte, NULL, MB_ICONQUESTION | MB_OKCANCEL); if (res == IDOK) *val = 'y'; return (res == IDOK); } int WindowService (void) { /* return (FbbApp->SvcList != NULL); */ return (False); } void GetBell (Display * dpy) { XKeyboardState stateValues; XGetKeyboardControl (dpy, &stateValues); orig_percent = stateValues.bell_percent; orig_pitch = stateValues.bell_pitch; orig_duration = stateValues.bell_duration; } /*--------------------------------------------------------------------* | SetBell | *--------------------------------------------------------------------*/ void SetBell (Display * dpy, int pitch, int duration) { XKeyboardControl controlValues; unsigned long valueMask = KBBellPercent | KBBellPitch | KBBellDuration; controlValues.bell_percent = orig_percent; controlValues.bell_pitch = pitch; controlValues.bell_duration = duration; XChangeKeyboardControl (dpy, valueMask, &controlValues); } #if 0 /*--------------------------------------------------------------------* | Pitch | *--------------------------------------------------------------------*/ int Pitch (int note) { double x, m, n, f; /* notes are calculated from the base frequency. */ /* This is the first note on the keyboard. */ /* The frequency of a note = 2^(index / 12). */ x = (double) 2.0; m = (double) note; n = (double) 12.0; f = (double) appData->baseFrequency * pow (x, (m / n)); return ((int) f); } #endif /*--------------------------------------------------------------------* | PlayNote | *--------------------------------------------------------------------*/ void PlayNote (int Pitch, int Duration) { if (orig_duration == 0) GetBell (XtDisplay (toplevel)); if (Pitch) { SetBell (XtDisplay (toplevel), Pitch, Duration); XBell (XtDisplay (toplevel), 100); SetBell (XtDisplay (toplevel), orig_pitch, orig_duration); FbbSync (); } WinMSleep (Duration); } void bipper (void) { if (!bip) return; if (doub_fen) { if (!play ("connect.wav")) { WinMessage (5, "Error : Cannot play file \"connect.wav\""); } } else { /* XBell(XtDisplay(toplevel), 100); */ PlayNote (2000, 40); PlayNote (1000, 40); #if 0 /* Haut parleur */ /* outportb(0x43, 0xb6); outportb(0x42, 0xffff); asm nop asm nop asm nop outportb(0x42,0xffff); OpenSound(); SetVoiceSound(1, MAKELONG(0, 2000), 20); SetVoiceSound(1, MAKELONG(0, 1000), 20); StartSound(); WaitSoundState(S_QUEUEEMPTY); CloseSound(); */ #endif } } void music (int stat) { static int note[10] = { /* 440, 0, 0, 440, 440, 388, 499, 388, 499, 0, 0, 499 */ /* 44, 0, 44, 44, 42, 45, 42, 45, 0, 45 */ 40, 0, 40, 36, 40, 36, 38, 38, 0, 38 }; /* int res = MessageBox(texte, NULL, MB_ICONQUESTION|MB_OKCANCEL); if (res == IDOK) { */ if (doub_fen) { if (stat) { t_tell = 1000; if (!play ("syscall.wav")) { WinMessage (5, "Error : Cannot play file \"syscall.wav\""); } } else { t_tell = -1; } } else { int i; for (i = 0; i < 10; i++) { double x, m, n, f; /* notes are calculated from the base frequency. */ /* This is the first note on the keyboard. */ /* The frequency of a note = 2^(index / 12). */ if (note[i]) { x = (double) 2.0; m = (double) note[i]; n = (double) 12.0; f = (double) 55 *pow (x, (m / n)); } else f = 0.0; PlayNote ((int) f, 200); WinMSleep (100); } /* outportb(0x43, 0xb6); outportb(0x42, 0xffff); asm nop asm nop asm nop outportb(0x42,0xffff); if (stat) { t_tell = 1000 ; OpenSound(); SetVoiceAccent(1, 120, 255, S_STACCATO, 0); SetVoiceNote(1, 0, 8, 0); for (i = 0 ; i < 10 ; i++) { // if (note[i] == note[i+1]) // SetVoiceSound(1, MAKELONG(0, 0), 5); // SetVoiceSound(1, MAKELONG(0, note[i]), 50); SetVoiceNote(1, note[i], 8, 0); } StartSound(); } else { t_tell = -1 ; } WaitSoundState(S_QUEUEEMPTY); CloseSound(); */ } } void maj_menu_options (void) { XmToggleButtonSetState (Opt[CM_OPTIONEDIT], sed, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONCALL], ok_tell, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONALARM], bip, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONGATEWAY], gate, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONJUSTIF], just, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONAFFICH], ok_aff, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONSOUNDB], doub_fen, FALSE); XmToggleButtonSetState (Opt[CM_OPTIONINEXPORT], aff_inexport, FALSE); XmToggleButtonSetState (ScanMsg, p_forward, FALSE); } void set_option (int id, int val) { switch (id) { case CM_OPTIONEDIT: sed = val; break; case CM_OPTIONCALL: ok_tell = val; break; case CM_OPTIONJUSTIF: just = val; break; case CM_OPTIONALARM: bip = val; break; case CM_OPTIONGATEWAY: gate = val; break; case CM_OPTIONAFFICH: ok_aff = val; break; case CM_OPTIONSOUNDB: doub_fen = val; break; case CM_OPTIONINEXPORT: aff_inexport = val; break; } maj_options (); } int set_callsign (char *buf) { FILE *fptr; if (!ind_console (0, buf)) return (0); aff_msg_cons (); if ((fptr = fopen (d_disque ("ETAT.SYS"), "r+t")) == NULL) fbb_error (ERR_OPEN, d_disque ("ETAT.SYS"), 0); fprintf (fptr, "%-6s-%X\n", cons_call.call, cons_call.num); ferme (fptr, 74); return (1); } void get_callsign (char *buf) { sprintf (buf, "%s-%d", cons_call.call, cons_call.num); } void win_msg_cons (int priv, int hold) { char texte[80]; if (priv >= 0) { sprintf (texte, ": %d", priv); LabelSetString (TxtPriv, "Priv msgs", (priv > 0) ? "RC" : NULL); LabelSetString (Priv, texte, (priv > 0) ? "RC" : NULL); /* FbbApp->FbbPriv->IntVal = priv; */ } if (hold >= 0) { sprintf (texte, ": %d", hold); LabelSetString (TxtHold, "Hold msgs", (hold > 0) ? "RC" : NULL); LabelSetString (Hold, texte, (hold > 0) ? "RC" : NULL); /* FbbApp->FbbHoldTxt->IntVal = hold; */ } } void disconnect_channel (int channel, int immediate) { if ((svoie[channel]->sta.connect) && (channel) && (channel < NBVOIES)) { if (immediate) force_deconnexion (channel, 1); else deconnexion (channel, 1); } } int can_talk (int channel) { if ((channel < 0) || (channel >= NBVOIES)) return (FALSE); return ((svoie[channel]->sta.connect) && (channel) && (channel < NBVOIES) && (svoie[channel]->niv3 == 0)); } int talk_to (int channel) { if ((svoie[channel]->sta.connect) && (channel) && (channel < NBVOIES)) { if (svoie[channel]->niv3 == 0) { v_tell = channel; selvoie (CONSOLE); strn_cpy (6, pvoie->sta.indicatif.call, cons_call.call); pvoie->sta.indicatif.num = cons_call.num; pvoie->sta.connect = 16; pvoie->deconnect = FALSE; pvoie->pack = 0; pvoie->read_only = 0; pvoie->vdisk = 2; pvoie->xferok = 1; pvoie->mess_recu = 1; pvoie->mbl = 0; init_timout (CONSOLE); pvoie->temp3 = 0; pvoie->nb_err = 0; pvoie->finf.lang = langue[0]->numlang; init_langue (voiecur); maj_niv (N_MBL, 9, 2); selvoie (v_tell); pvoie->sniv1 = pvoie->niv1; pvoie->sniv2 = pvoie->niv2; pvoie->sniv3 = pvoie->niv3; pvoie->nb_err = 0; init_langue (voiecur); maj_niv (N_MBL, 9, 2); texte (T_MBL + 16); t_tell = -1; ShowFbbWindow (0, toplevel); return (1); } } return (0); } int fct_arret (int type) { long caltemps; #ifdef ENGLISH static char *strtype[4] = {"Error ", "End", "Re-Run ", "Maintenance"}; #else static char *strtype[4] = {"Erreur", "Fin", "Relance", "Maintenance"}; #endif int c; int nb_connect; int res; c = 1; nb_connect = actif (2); if (nb_connect) { res = MessageBox (0, "Immediate", strtype[type], MB_ICONQUESTION | MB_YESNOCANCEL); if (res == IDCANCEL) return (0); if (res == IDNO) c = 2; } type_sortie = type; switch (c) { case 1: if (MessageBox (0, "Are you sure ?", "Quit XFBB", MB_ICONQUESTION | MB_OKCANCEL) == IDOK) { house_keeping (); maintenance (); fbb_quit (type); } else return (0); break; case 2: save_fic = 1; set_busy (); time (&caltemps); stop_min = minute (caltemps); break; case 3: house_keeping (); break; } return (1); } void scan_fwd (int val) { XmToggleButtonSetState (ScanMsg, val, FALSE); if (val) { if (p_forward == 0) { p_forward = 1; init_buf_fwd (); init_buf_swap (); init_buf_rej (); init_bbs (); } } else { if (p_forward) p_forward = 0; } maj_options (); } void win_status (char *txt) { char texte[80]; sprintf (texte, ": %s", txt); LabelSetString (State, texte, NULL); } char *win_memo (int val) { FILE *fptr = fopen (d_disque ("MEMO.SYS"), "rt"); char buffer[257]; char *ptr = NULL; if (fptr) { while (fgets (buffer, 256, fptr)) { if (val-- == 0) { ptr = var_crlf (sup_ln (buffer)); break; } } ferme (fptr, 81); } return (ptr); } void fin_tache (int voie) { selvoie (voie); traite_voie (voie); } void win_execute (char *buffer) { /* WORD diagInst; BOOL bResult; TASKENTRY te; HANDLE hInst; // Attend la reception eventuelle de trames RS232 WinSleep(1); if ((FbbApp->ddeCB == 0) && (FbbApp->pThunk == NULL)) { // Si la liste est vide, lancer la notify Callback //AppWindow = FbbApp->MainWindow->HWindow; //FbbApp->pThunk = MakeProcInstance((FARPROC)Callback, FbbApp->ghInstance); //NotifyRegister(0, (LPFNNOTIFYCALLBACK)FbbApp->pThunk, NF_NORMAL); } ++FbbApp->ddeCB; // diagInst = WinExec(buffer, SW_SHOWNORMAL); diagInst = WinExec(buffer, SW_SHOWMINNOACTIVE); if (diagInst < 32) { FbbApp->MainWindow->MessageBox("WinExec Failed", "Error", MB_OK); } else { hInst = (HANDLE)diagInst; te.dwSize = sizeof(te); bResult = TaskFirst(&te); while (bResult) { if (te.hInst == hInst) { pvoie->task = te.hTask; break; } bResult = TaskNext(&te); } } */ } #if 0 void init_socket (int port) { /* int adresse = p_com[p_port[port].ccom].cbase; FbbApp->Socket = new MySocket(FbbApp->Client->HWindow, adresse, port, p_port[port].nb_voies); */ } void dec_socket (int voie) { /* int canal = no_canal(voie); SOCKET sock; if (canal == -1) return; sock = FbbApp->Socket->SockCan[canal-1].socket; FbbApp->Socket->Server_DestroyConnection(sock); FbbApp->Socket->Disconnection(sock, 0); */ } void free_socket (int port) { /* if (FbbApp->Socket) delete FbbApp->Socket; FbbApp->Socket = NULL; */ } int snd_tcp (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { /* SOCKET sock; if (cmd == UNPROTO) { // Unprotos ? ... return(0); } sock = FbbApp->Socket->SockCan[canal-1].socket; if (sock == 0xffff) return(-1); FbbApp->Socket->Send(sock, buffer, len); return(len); */ } int tcp_busy (int voie) { /* int canal = no_canal(voie); if (canal == -1) return(0); SOCKET sock = FbbApp->Socket->SockCan[canal-1].socket; return((FbbApp->Socket->Full(sock)) ? svoie[voie]->maxbuf * 2 : 0); */ } void connect_tcp (int voie, indicat * call, char *address, int tcport) { /* int canal = no_canal(voie); if (canal == -1) return; MySocket *Socket = FbbApp->Socket; SocketCanal *Canal = &Socket->SockCan[canal-1]; wsprintf(Canal->call, "%s-%d", call->call, call->num); Canal->socket = Socket->ConnectPort((LPSTR)address, tcport); */ } #endif void user_status (int voie) { int i; int trouve = FALSE; int pos = 0; XmString string; DisplayInfoDialog (voie); /* Chercher la voie dans la liste */ for (i = 0; i < NBVOIES; i++) { if (svoie[i]->sta.connect) { ++pos; if (i == voie) { trouve = TRUE; break; } } } if (trouve) { int ok = 0; int nobbs; int ch; struct tm *sdate; unsigned t_cnx; Forward *pfwd; char bbs[10]; char buffer[80]; char call[20]; int choix = 0; int fwd = 0; /* Test du forward */ ok = 0; *bbs = '\0'; pfwd = p_port[no_port (i)].listfwd; while (pfwd) { if ((svoie[i]->curfwd) && (pfwd->forward == i)) { nobbs = svoie[i]->bbsfwd; choix = (int) svoie[i]->cur_choix; strn_cpy (6, bbs, bbs_ptr + (nobbs - 1) * 7); ok = 1; fwd = 1; } pfwd = pfwd->suite; } if ((!ok) && (svoie[i]->mode & F_FOR) && (i != CONSOLE)) { fwd = 2; strcpy (bbs, svoie[i]->sta.indicatif.call); } strlwr (bbs); if (P_TOR (i)) { int port = no_port (i); if (p_port[port].t_wait) { fwd = 3; strcpy (bbs, "F-Wait"); } else if (p_port[port].t_busy) { fwd = 3; strcpy (bbs, "F-Chck"); } } /* Affichage */ sdate = localtime (&(svoie[i]->debut)); t_cnx = (unsigned) (time (NULL) - svoie[i]->debut); if (i == 1) ch = 99; else ch = (i > 0) ? i - 1 : i; if (svoie[i]->sta.indicatif.num) sprintf (call, "%s-%d", svoie[i]->sta.indicatif.call, svoie[i]->sta.indicatif.num); else sprintf (call, "%s", svoie[i]->sta.indicatif.call); sprintf (buffer, "%02d %-9s %02d:%02d %02d:%02d %2d %3d %c%c%s", ch, call, sdate->tm_hour, sdate->tm_min, t_cnx / 3600, (t_cnx / 60) % 60, svoie[i]->sta.ret, svoie[i]->sta.ack, (choix < 2) ? ' ' : '0' + choix, (choix < 2) ? ' ' : '/', bbs ); if (fwd == 1) string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "RC"); else if (fwd == 2) string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "BC"); else if (fwd == 3) string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "BF"); else string = XmStringGenerate (buffer, NULL, XmCHARSET_TEXT, "NO"); /* Remplacer la ligne par la nouvelle ligne */ XmListReplaceItemsPos (ConnectList, &string, 1, pos); XmStringFree (string); SetChList (FALSE); } } void aff_traite (int voie, int val) { /* FbbApp->ConnectList->SetChannelProcess(voie, val); if (1) // if (val) { char buf[40]; char call[30]; Svoie *ptvoie = svoie[voie]; sprintf (buf, "Buf:%03d Task:%02d-%02d-%02d", ptvoie->sta.mem, ptvoie->niv1, ptvoie->niv2, ptvoie->niv3); #ifdef ENGLISH sprintf (call, "Ch:%02d %s-%d", #else sprintf (call, "Vo:%02d %s-%d", #endif virt_canal (voie), ptvoie->sta.indicatif.call, ptvoie->sta.indicatif.num); FbbStatus (call, buf); } */ } void select_con (int voie) { /* char select[10]; wsprintf(select, "%02d", voie); // FbbApp->ConnectList->SetSelString(select, -1); */ } void SpoolLine (int voie, int attr, char *data, int lg) { if (data) { char *ptr; char *buf; int i; if (p_fptr == NULL) { char *ptr; /* Ouvrir le spooler */ ptr = getenv ("XFBB_PRN"); if (ptr) p_fptr = popen (ptr, "w"); else p_fptr = popen ("lpr", "w"); } printf ("spool %d carac ok\n", lg); ptr = buf = malloc (lg); if (buf == NULL) return; for (i = 0; i < lg; i++) { if (data[i] == '\r') *ptr++ = '\n'; else *ptr++ = data[i]; } fwrite (buf, lg, 1, p_fptr); free (buf); } else { /* Fermer l'imprimante */ if (p_fptr) { pclose (p_fptr); p_fptr = NULL; } return; } } #include void WinDebug (char *fmt,...) { va_list argptr; int cnt; va_start (argptr, fmt); cnt = vprintf (fmt, argptr); va_end (argptr); } void SendEchoCmd (char *buf, int lg) { /* int i; int debut; char *ptr; char sauve; if (lg == 0) return; if (!FbbApp->ProgTnc->IsWindow()) return; ptr= buf; debut = 1; for (i = 0 ; i < lg; i++) { // Saute les LF if ((buf[i] == '\r') || (buf[i] == '\n')) { if (debut) { ptr= &buf[i+1]; } else { sauve = buf[i]; buf[i]= '\0'; FbbApp->ProgTnc->ResLine->Insert(ptr); FbbApp->ProgTnc->ResLine->Insert("\r\n"); buf[i] = sauve; ptr= &buf[i+1]; debut = 1; } } else debut = 0; } if (!debut) { FbbApp->ProgTnc->ResLine->Insert(ptr); FbbApp->ProgTnc->ResLine->Insert("\r\n"); } */ } /* void window_write(int numero, char *data, int len, int color, int header) { char buf[300]; char *ptr; memcpy(buf, data, len); buf[len] = '\0'; ptr = buf; while (*ptr) { if (*ptr == '\r') *ptr = '\n'; ++ptr; } printf("%02d:%s", numero, buf); } */ static void FSOkCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 1; } static void FSCancelCB (Widget w, XtPointer client_data, XtPointer call_data) { *((int *) client_data) = 0; } int GetFileNameDialog (char *filename) { Arg args[20]; Cardinal n; XmString string; Widget fs; int retour; XEvent event; n = 0; string = XmStringCreateSimple ("*.imp"); XtSetArg (args[n], XmNpattern, string); n++; fs = XmCreateFileSelectionDialog (toplevel, "file_selection", args, n); XmStringFree (string); XtAddCallback (fs, XmNokCallback, FSOkCB, &retour); XtAddCallback (fs, XmNcancelCallback, FSCancelCB, &retour); XtUnmanageChild (XmFileSelectionBoxGetChild (fs, XmDIALOG_HELP_BUTTON)); XtManageChild (fs); retour = -1; XtAddGrab (fs, TRUE, TRUE); while (retour == -1) { XtAppNextEvent (app_context, &event); XtDispatchEvent (&event); } /* n = 0; XtSetArg(args[n], XmNfileListItemCount, &nb);n++; XtSetArg(args[n], XmNfileListItems, &stable);n++; XtGetValues(fs, args, n); */ if (retour) { char *text; n = 0; XtSetArg (args[n], XmNtextString, &string); n++; XtGetValues (fs, args, n); if (!XmStringGetLtoR (string, XmSTRING_DEFAULT_CHARSET, &text)) retour = 0; else strcpy (filename, text); } XtRemoveGrab (fs); XtUnmanageChild (fs); XtDestroyWidget (XtParent (fs)); return (retour); } fbb-7.0.10/src/X11/xfbbpndd.c0000644000175000017500000004011013613360505012342 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include static int LgList; static Widget PendingDialog; static Widget FwdList[4]; static Widget imp_dialog; static void import_bbs(Widget w, char *call); void PendingCB(Widget w, XtPointer client_data, XtPointer call_data) { int i; if (XtIsManaged(PendingDialog)) { /* Passer la fenetre au 1er plan */ XRaiseWindow(XtDisplay(PendingDialog),XtWindow(XtParent(PendingDialog))); return; } cursor_wait(); LgList = 0; for (i = 0 ; i< 4 ; i++) { XmListDeleteAllItems(FwdList[i]); } fwd_encours(); XtManageChild(PendingDialog); end_wait(); } static void CloseCB(Widget w, XtPointer client_data, XtPointer call_data) { XtUnmanageChild(PendingDialog); } static void StopFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { int *tab; int nb; int nb_bbs; int i; char str[80]; char bbs[8]; int bbs_list[80]; int port_fwd; char ifwd[NBBBS][7]; ch_bbs (1, ifwd); nb_bbs = 0; for (i = 0 ; i< 4 ; i++) { if (XmListGetSelectedPos(FwdList[i], &tab, &nb)) { nb_bbs = 1; bbs_list[0] = (i*20) + tab[0] - 1; free(tab); break; } } if (nb_bbs == 0) { strcpy(str, "Select a BBS"); MessageBox(60, str, "STOP", MB_OK | MB_ICONEXCLAMATION); return; } for (i = 0 ; i < nb_bbs ; i++) { if (!isgraph(ifwd[bbs_list[i]][0])) continue; strn_cpy(6, bbs, ifwd[bbs_list[i]]); sprintf(str, "Stops forwarding to BBS %s", bbs); /* ret = MessageBox(60, str, "STOP", MB_OKCANCEL | MB_ICONQUESTION); if (ret == IDCANCEL) continue; */ *str= '\0'; switch (port_fwd = dec_fwd(bbs)) { case -1 : sprintf(str, "BBS %s is not forwarding", bbs); break; case -2 : sprintf(str, "Unknown BBS %s", bbs); break; default : break; } if (*str) { MessageBox(60, str, "STOP", MB_OK | MB_ICONEXCLAMATION); return; } } CloseCB(w, NULL, NULL); } static void SelectFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { int i; for (i = 0 ; i< 4 ; i++) { if (i == (uintptr_t)client_data) continue; XmListDeselectAllItems(FwdList[i]); } } static void StartFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { int nb_bbs; char str[80]; int bbs_list[80]; int i; int nb; int *tab; char ifwd[NBBBS][7]; ch_bbs (1, ifwd); nb_bbs = 0; for (i = 0 ; i< 4 ; i++) { if (XmListGetSelectedPos(FwdList[i], &tab, &nb)) { nb_bbs = 1; bbs_list[0] = (i*20) + tab[0] - 1; free(tab); break; } } if (nb_bbs == 0) { strcpy(str, "Select a BBS"); MessageBox(60, str, "START", MB_OK | MB_ICONEXCLAMATION); return; } for (i = 0 ; i < nb_bbs ; i++) { int retour; int port_fwd; int reverse = 1; char bbs[8]; *str = '\0'; if (!isgraph(ifwd[bbs_list[i]][0])) continue; strn_cpy(6, bbs, ifwd[bbs_list[i]]); retour = val_fwd(bbs, &port_fwd, reverse); if (retour < 0) { switch (retour) { case -1 : sprintf(str, "No forwarding channel on port %d", port_fwd); break; case -2: sprintf(str, "No port affected to %s", bbs); break; case -3 : sprintf(str, "Unknown BBS %s", bbs); break; case -4 : sprintf(str, "BBS %s already connected", bbs); break; } if (*str) { MessageBox(60, str, "START", MB_OK | MB_ICONEXCLAMATION); return; } } } CloseCB(w, NULL, NULL); } static void StartAllCB(Widget w, XtPointer client_data, XtPointer call_data) { char str[80]; int port_fwd; int reverse =0; int retour; char bbs[8]; *str = '\0'; strcpy(bbs, "9"); retour = val_fwd(bbs, &port_fwd, reverse); if (retour < 0) { switch (retour) { case -1 : sprintf(str, "No forwarding channel on port %d", port_fwd); break; case -2: sprintf(str, "No port affected to %s", bbs); break; case -3 : sprintf(str, "Unknown BBS %s", bbs); break; case -4 : sprintf(str, "BBS %s already connected", bbs); break; } if (*str) { MessageBox(60, str, "START", MB_OK | MB_ICONEXCLAMATION); return; } } if (*str == '\0') CloseCB(w, NULL, NULL); } static void OkCB(Widget w, XtPointer client_data, XtPointer call_data) { Widget *pw; pw = (Widget *)client_data; XtUnmanageChild(imp_dialog); XtDestroyWidget(XtParent(imp_dialog)); imp_dialog = NULL; } static void ApplyCB(Widget w, XtPointer client_data, XtPointer call_data) { Widget wt; Widget wf; char *ptr; wf = (Widget)client_data; /* wt = XmSelectionBoxGetChild(call_dialog, XmDIALOG_TEXT); */ wt = XmSelectionBoxGetChild(w, XmDIALOG_TEXT); ptr = XmTextGetString(wt); XtUnmanageChild(imp_dialog); XtDestroyWidget(XtParent(imp_dialog)); imp_dialog = NULL; if (find(ptr)) { import_bbs(wf, ptr); } else { char str[80]; sprintf(str, "Invalid callsign %s", ptr); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); } XtFree(ptr); } static void ImportCallsign(Widget w) { Arg args[20] ; Cardinal n; if (imp_dialog) { /* Dialog deja ouvert, on le passe devant */ XRaiseWindow(XtDisplay(imp_dialog),XtWindow(XtParent(imp_dialog))); return; } n = 0; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; XtSetArg(args[n], XmNmessageAlignment, XmALIGNMENT_CENTER);n++; imp_dialog = XmCreatePromptDialog(toplevel, "callsign", args, n); XtManageChild(XmSelectionBoxGetChild(imp_dialog, XmDIALOG_APPLY_BUTTON)); XtUnmanageChild(XmSelectionBoxGetChild(imp_dialog, XmDIALOG_OK_BUTTON)); XtUnmanageChild(XmSelectionBoxGetChild(imp_dialog, XmDIALOG_HELP_BUTTON)); XtAddCallback(imp_dialog, XmNapplyCallback, ApplyCB, (XtPointer)w); XtAddCallback(imp_dialog, XmNcancelCallback, OkCB, (XtPointer)w); XtManageChild(imp_dialog); } static void import_bbs(Widget w, char *call) { int fd; int retour; char filename[512]; char str[80]; retour = GetFileNameDialog(filename); if (retour == 0) return; if ((fd = open(filename, S_IREAD)) != -1) close(fd); else { sprintf(str, "Cannot find %s", filename); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); return; } n_cpy(6, svoie[INEXPORT]->sta.indicatif.call, call) ; svoie[INEXPORT]->sta.indicatif.num = 0 ; strcpy(io_fich,filename); mail_ch = INEXPORT; selvoie(mail_ch) ; pvoie->sta.connect = inexport = 4 ; pvoie->enrcur = 0L ; pvoie->debut = time(NULL); pvoie->mode = F_FOR | F_HIE | F_BID | F_MID ; pvoie->finf.lang = langue[0]->numlang ; aff_event(voiecur, 1); maj_niv(N_MBL, 99, 0) ; CloseCB(w, NULL, NULL); } static void ImportFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { int nb_bbs; int bbs_list[80]; char callsign[10]; char str[80]; int i; int nb; int *tab; char ifwd[NBBBS][7]; ch_bbs (1, ifwd); if (svoie[INEXPORT]->sta.connect) { sprintf(str, "Channel busy, cannot import"); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); return; } nb_bbs = 0; for (i = 0 ; i< 4 ; i++) { if (XmListGetSelectedPos(FwdList[i], &tab, &nb)) { nb_bbs = 1; bbs_list[0] = (i*20) + tab[0] - 1; free(tab); n_cpy(6, callsign, ifwd[bbs_list[0]]) ; if (!isgraph(callsign[0])) { nb_bbs = 0; } break; } } if (nb_bbs == 0) { /* sprintf(str, "Select a BBS"); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); */ ImportCallsign(w); return; } if (nb_bbs > 1) { sprintf(str, "Only one selection allowed"); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); return; } import_bbs(w, callsign); } static void ExportFwdCB(Widget w, XtPointer client_data, XtPointer call_data) { int fd; int nb_bbs; char str[80]; int bbs_list[80]; int i; int *tab; int nb; int retour; char filename[512]; char ifwd[NBBBS][7]; char callsign[10]; ch_bbs (1, ifwd); if (svoie[INEXPORT]->sta.connect) { sprintf(str, "Channel busy, cannot export"); MessageBox(60, str, "Export", MB_OK | MB_ICONEXCLAMATION); return; } nb_bbs = 0; for (i = 0 ; i< 4 ; i++) { if (XmListGetSelectedPos(FwdList[i], &tab, &nb)) { nb_bbs = 1; bbs_list[0] = (i*20) + tab[0] - 1; free(tab); n_cpy(6, callsign, ifwd[bbs_list[0]]) ; if (!isgraph(callsign[0])) { nb_bbs = 0; } break; } } if (nb_bbs == 0) { sprintf(str, "Select a BBS"); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); return; } if (nb_bbs > 1) { sprintf(str, "Only one selection allowed"); MessageBox(60, str, "Import", MB_OK | MB_ICONEXCLAMATION); return; } n_cpy(6, svoie[INEXPORT]->sta.indicatif.call, callsign) ; svoie[INEXPORT]->sta.indicatif.num = 0 ; selvoie(INEXPORT) ; pvoie->mode = F_FOR ; if (!appel_rev_fwd(1)) { sprintf(str, "No mail for %s", svoie[INEXPORT]->sta.indicatif.call); MessageBox(60, str, "Export", MB_OK | MB_ICONEXCLAMATION); return; } retour = GetFileNameDialog(filename); if (retour == 0) return; strcpy(io_fich, filename); if ((fd = creat(io_fich, S_IREAD | S_IWRITE)) != -1) close(fd); else { sprintf(str, "Cannot create %s", io_fich); MessageBox(60, str, "Export", MB_OK | MB_ICONEXCLAMATION); return; } unlink(io_fich) ; /* supprime un eventuel fichier */ mail_ch = INEXPORT; selvoie(mail_ch) ; pvoie->sta.connect = inexport = 4 ; pvoie->debut = time(NULL); pvoie->finf.lang = langue[0]->numlang ; aff_event(voiecur, 1); maj_niv(N_MBL, 98, 0) ; CloseCB(w, NULL, NULL); } void PendingForward(Widget toplevel) { int i; Arg args[20] ; Cardinal n; Widget w; XmRenderTable rt; n = 0; XtSetArg(args[n], XmNmarginHeight, 5);n++; XtSetArg(args[n], XmNmarginWidth, 5);n++; XtSetArg(args[n], XmNautoUnmanage, FALSE);n++; PendingDialog = XmCreateFormDialog(toplevel, "pending_fwd", args, n); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 2);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 17);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(PendingDialog, "stop_fwd", args, n); XtAddCallback(w, XmNactivateCallback, StopFwdCB, 0); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 18);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 33);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(PendingDialog, "start_fwd", args, n); XtAddCallback(w, XmNactivateCallback, StartFwdCB, (XtPointer)PendingDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 34);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 49);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(PendingDialog, "start_all", args, n); XtAddCallback(w, XmNactivateCallback, StartAllCB, (XtPointer)PendingDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 50);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 65);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(PendingDialog, "import_fwd", args, n); XtAddCallback(w, XmNactivateCallback, ImportFwdCB, (XtPointer)PendingDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 66);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 81);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(PendingDialog, "export_fwd", args, n); XtAddCallback(w, XmNactivateCallback, ExportFwdCB, (XtPointer)PendingDialog); XtManageChild(w); n = 0; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, 82);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, 97);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_FORM);n++; w = XmCreatePushButton(PendingDialog, "close", args, n); XtAddCallback(w, XmNactivateCallback, CloseCB, (XtPointer)PendingDialog); XtManageChild(w); for (i = 0 ; i < 4 ; i++) { n= 0; XtSetArg(args[n], XmNtopAttachment, XmATTACH_FORM);n++; XtSetArg(args[n], XmNleftAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNleftPosition, i * 25);n++; XtSetArg(args[n], XmNrightAttachment, XmATTACH_POSITION);n++; XtSetArg(args[n], XmNrightPosition, i* 25 + 24);n++; XtSetArg(args[n], XmNbottomAttachment, XmATTACH_WIDGET);n++; XtSetArg(args[n], XmNbottomWidget, w);n++; XtSetArg(args[n], XmNhighlightThickness, 0);n++; XtSetArg(args[n], XmNvisibleItemCount, 20);n++; FwdList[i] = XmCreateList(PendingDialog, "fwd_list", args, n); XtAddCallback(FwdList[i], XmNbrowseSelectionCallback, SelectFwdCB, (XtPointer)(intptr_t)i); XtAddCallback(FwdList[i], XmNdefaultActionCallback, StartFwdCB, (XtPointer)(intptr_t)i); XtVaGetValues(FwdList[i], XmNrenderTable, &rt, NULL, NULL); /* Make a copy so that setvalues will work correctly */ rt = XmRenderTableCopy(rt, NULL, 0); rt = XmRenderTableAddRenditions(rt, r_rend, r_index, XmMERGE_NEW); XtVaSetValues(FwdList[i], XmNrenderTable, rt, NULL, NULL); XmRenderTableFree(rt); } XtManageChildren(FwdList, 4); } #if 0 main(int ac, char **av) { Arg args[20] ; Cardinal n; Widget toplevel; Widget rc; Widget bp; Widget EditUsrDialog; XtAppContext app_context; toplevel = XtAppInitialize(&app_context, "TM", NULL, 0, &ac, av, NULL,NULL, 0); n = 0; XtSetArg(args[n], XmNallowShellResize, True);n++; XtSetValues(toplevel, args, n); EditUsrDialog = EditUser(toplevel); rc = XmCreateRowColumn(toplevel, "rc", NULL, 0); bp = XmCreatePushButton(rc, "Edit User", NULL, 0); XtAddCallback(bp, XmNactivateCallback, EditUsrCB, (XtPointer)EditUsrDialog); XtManageChild(bp); XtManageChild(rc); XtRealizeWidget(toplevel); /* Main Loop */ XtAppMainLoop(app_context); } #endif void AddPendingLine(char *call, int priv, int bull, int kb) { char str[80]; XmString string; if (*call) { sprintf(str, "%-6s:%d/%d-%dk", call, priv, bull, kb); if (priv) string = XmStringGenerate(str, NULL, XmCHARSET_TEXT, "RC"); else if (bull) string = XmStringGenerate(str, NULL, XmCHARSET_TEXT, "BC"); else string = XmStringGenerate(str, NULL, XmCHARSET_TEXT, "NO"); } else { str[0] = '.'; str[1] = '\0'; string = XmStringCreateSimple(str); } XmListAddItem(FwdList[LgList/20], string, 0); XmStringFree(string); ++LgList; } fbb-7.0.10/src/edit.c0000644000175000017500000003020213613360505011130 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #define RECSIZ 256 static char *fic (char *); static int cmd_edit (void); static int edit_find (char *); static int edit_replace (char *, char *); static int ouvre_temp (void); static void cree_temp (void); static void edit_insert (char *); static void edit_append (char *); static void edit_kill (int); static void edit_aff (int); static void kill_temp (void); static void prompt_edit (void); static void sauve_temp (void); int cmd_edit (void) { int c, nb, moins; char chaine1[300]; char chaine2[300]; char *pbuf; sup_ln (indd); while (*indd) { moins = 0; if (*indd == '+') ++indd; else if (*indd == '-') { moins = 1; ++indd; } if (isdigit (*indd)) { nb = 0; while (isdigit (*indd)) { nb *= 10; nb += (*indd++ - '0'); } } else nb = 1; if (moins) nb = -nb; c = *indd++; switch (toupper (c)) { case ' ': break; case '?': outln ("A,B,E,F,I,K,L,N,P,R,S,Q,?", 25); break; case 'A': pbuf = chaine1; while ((c = *indd++) != 0) { if (c == '\\') c = *indd++; else if (c == '/') break; *pbuf++ = c; } *pbuf = '\0'; if (pvoie->tete_edit.max == 0) edit_insert (chaine1); else edit_append (chaine1); break; case 'B': pvoie->tete_edit.ligne = 1; break; case 'E': pvoie->tete_edit.ligne = pvoie->tete_edit.max; if (pvoie->tete_edit.ligne < 1) pvoie->tete_edit.ligne = 1; break; case 'F': pbuf = chaine1; while ((c = *indd++) != 0) { if (c == '\\') c = *indd++; else if (c == '/') break; *pbuf++ = c; } *pbuf = '\0'; if (edit_find (chaine1) == 0) { texte (T_ERR + 0); return (1); } break; case 'I': pbuf = chaine1; while ((c = *indd++) != 0) { if (c == '\\') c = *indd++; else if (c == '/') break; *pbuf++ = c; } *pbuf = '\0'; edit_insert (chaine1); break; case 'K': edit_kill (nb); break; case 'L': pvoie->tete_edit.ligne += nb; if (pvoie->tete_edit.ligne < 1) pvoie->tete_edit.ligne = 1; if (pvoie->tete_edit.ligne > pvoie->tete_edit.max) pvoie->tete_edit.ligne = pvoie->tete_edit.max; break; case 'N': pvoie->tete_edit.numero = !pvoie->tete_edit.numero; break; case 'P': edit_aff (nb); break; case 'R': pbuf = chaine1; while ((c = *indd++) != 0) { if (c == '\\') c = *indd++; else if (c == '/') break; *pbuf++ = c; } *pbuf = '\0'; pbuf = chaine2; while ((c = *indd++) != 0) { if (c == '\\') c = *indd++; else if (c == '/') break; *pbuf++ = c; } *pbuf = '\0'; if (edit_replace (chaine1, chaine2) == 0) { texte (T_ERR + 0); return (1); } break; case 'S': sauve_temp (); break; case 'Q': libere_edit (voiecur); return (0); default: varx[0][0] = c; varx[0][1] = '\0'; texte (T_ERR + 1); return (1); } } return (1); } void prompt_edit (void) { outs ("EDIT>", 5); } int ouvre_temp (void) { int ftemp; char nom_temp[80]; sprintf (nom_temp, "TEMP_%d.$$$", voiecur); if ((ftemp = open (nom_temp, O_RDWR | O_BINARY)) == -1) fbb_error (ERR_OPEN, nom_temp, 1); return (ftemp); } void kill_temp (void) { char nom_temp[80]; sprintf (nom_temp, "TEMP_%d.$$$", voiecur); unlink (nom_temp); } static char *fic (char *nomfic) { char *ptr; if ((ptr = strrchr (nomfic, '\\')) != NULL) return (ptr + 1); else return (nomfic); } void libere_edit (int voie) { edit_ch *edit_temp, *ch_ptr; edit_temp = svoie[voie]->tete_edit.liste; while ((ch_ptr = edit_temp) != NULL) { edit_temp = edit_temp->suite; m_libere (ch_ptr, sizeof (edit_ch)); } svoie[voie]->tete_edit.liste = NULL; } void edit_aff (int nblig) { int ftemp, pos; edit_ch *edit_temp; char buffer[RECSIZ + 2]; char chaine[300]; ftemp = ouvre_temp (); edit_temp = pvoie->tete_edit.liste; pos = 1; while (edit_temp) { if (pos >= pvoie->tete_edit.ligne) { if (nblig-- <= 0) break; lseek (ftemp, RECSIZ * (long) edit_temp->record, 0); read (ftemp, buffer, RECSIZ); if (pvoie->tete_edit.numero) sprintf (chaine, "%03d %s", pos, buffer); else strcpy (chaine, buffer); outs (chaine, strlen (chaine)); } edit_temp = edit_temp->suite; ++pos; } close (ftemp); } void edit_kill (int nblig) { int ftemp, pos; edit_ch *edit_temp, *ch_deb = NULL, *ch_ptr; char buffer[RECSIZ + 2]; ftemp = ouvre_temp (); edit_temp = pvoie->tete_edit.liste; pos = 1; while (edit_temp) { if (pos == pvoie->tete_edit.ligne) break; ch_deb = edit_temp; edit_temp = edit_temp->suite; ++pos; } while (edit_temp) { if (nblig-- <= 0) break; lseek (ftemp, (long) RECSIZ * (long) edit_temp->record, 0); read (ftemp, buffer, RECSIZ); buffer[0] = '\0'; lseek (ftemp, (long) RECSIZ * (long) edit_temp->record, 0); write (ftemp, buffer, RECSIZ); ch_ptr = edit_temp; edit_temp = edit_temp->suite; m_libere (ch_ptr, sizeof (edit_ch)); --pvoie->tete_edit.max; } if (pvoie->tete_edit.ligne == 1) pvoie->tete_edit.liste = edit_temp; else ch_deb->suite = edit_temp; close (ftemp); } void edit_insert (char *chaine) { int ftemp, pos; char *ptr; edit_ch *edit_temp, *ch_deb; ftemp = ouvre_temp (); pos = 1; if (pvoie->tete_edit.ligne == 1) { ch_deb = pvoie->tete_edit.liste; edit_temp = pvoie->tete_edit.liste = (edit_ch *) m_alloue (sizeof (edit_ch)); } else { edit_temp = pvoie->tete_edit.liste; while (edit_temp) { if (pos == pvoie->tete_edit.ligne - 1) break; edit_temp = edit_temp->suite; ++pos; } ch_deb = edit_temp->suite; edit_temp->suite = (edit_ch *) m_alloue (sizeof (edit_ch)); edit_temp = edit_temp->suite; } edit_temp->suite = ch_deb; ptr = chaine; while (*ptr) ++ptr; *ptr++ = '\n'; *ptr = '\0'; lseek (ftemp, 0L, 2); edit_temp->record = (int) (tell (ftemp) / RECSIZ); write (ftemp, chaine, RECSIZ); close (ftemp); ++pvoie->tete_edit.max; } void edit_append (char *chaine) { int ftemp, pos; char *ptr; edit_ch *edit_temp, *ch_deb; ftemp = ouvre_temp (); pos = 1; edit_temp = pvoie->tete_edit.liste; while (edit_temp) { if (pos == pvoie->tete_edit.ligne) break; edit_temp = edit_temp->suite; ++pos; } if (edit_temp) { ch_deb = edit_temp->suite; edit_temp->suite = (edit_ch *) m_alloue (sizeof (edit_ch)); edit_temp = edit_temp->suite; } else { edit_temp = (edit_ch *) m_alloue (sizeof (edit_ch)); ch_deb = NULL; } edit_temp->suite = ch_deb; ptr = chaine; while (*ptr) ++ptr; *ptr++ = '\n'; *ptr = '\0'; lseek (ftemp, 0L, 2); edit_temp->record = (int) (tell (ftemp) / RECSIZ); write (ftemp, chaine, RECSIZ); close (ftemp); ++pvoie->tete_edit.max; ++pvoie->tete_edit.ligne; } int edit_find (char *chaine) { int ftemp, pos, ok = 0; edit_ch *edit_temp; char buffer[RECSIZ + 2]; ftemp = ouvre_temp (); edit_temp = pvoie->tete_edit.liste; pos = 1; while (edit_temp) { if (pos >= pvoie->tete_edit.ligne) { lseek (ftemp, RECSIZ * (long) edit_temp->record, 0); read (ftemp, buffer, RECSIZ); if (strstr (buffer, chaine)) { pvoie->tete_edit.ligne = pos; ok = 1; break; } } edit_temp = edit_temp->suite; ++pos; } close (ftemp); return (ok); } int edit_replace (char *avant, char *apres) { int ftemp, pos, ok = 0; edit_ch *edit_temp; char buffer[RECSIZ + 2]; char change[300]; char *ptr, *nptr, *cptr; ftemp = ouvre_temp (); edit_temp = pvoie->tete_edit.liste; pos = 1; while (edit_temp) { if (pos >= pvoie->tete_edit.ligne) { lseek (ftemp, RECSIZ * (long) edit_temp->record, 0); read (ftemp, buffer, RECSIZ); ptr = buffer; if ((cptr = strstr (buffer, avant)) != NULL) { pvoie->tete_edit.ligne = pos; nptr = change; while (ptr != cptr) *nptr++ = *ptr++; while (*apres) *nptr++ = *apres++; while (*avant) { ++avant; ++ptr; } while ((*nptr++ = *ptr++) != '\0'); if (strlen (change) > 256) { /* printf ("<>\n"); */ outln ("<>", 2); } else { lseek (ftemp, RECSIZ * (long) edit_temp->record, 0); write (ftemp, change, RECSIZ); } ok = 1; break; } } edit_temp = edit_temp->suite; ++pos; } close (ftemp); return (ok); } void cree_temp (void) { FILE *fptr; long nbcar = 0L; int ftemp, lg, pos; edit_ch *edit_temp; char buffer[RECSIZ + 2]; char nom_temp[80]; sprintf (nom_temp, "TEMP_%d.$$$", voiecur); if ((ftemp = open (nom_temp, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE) ) == -1) fbb_error (ERR_CREATE, nom_temp, 2); pos = 0; pvoie->tete_edit.ligne = 1; pvoie->tete_edit.carac = 0; pvoie->tete_edit.liste = NULL; edit_temp = pvoie->tete_edit.liste; if ((fptr = fopen (pvoie->sr_fic, "rt")) != NULL) { while (fgets (buffer, RECSIZ + 2, fptr)) { if ((lg = strlen (buffer)) > RECSIZ) { #ifdef ENGLISH outln ("Line too long ! ", 19); #else outln ("Ligne trop longue !", 19); #endif break; } if ((lg) && (buffer[lg - 1] != '\n')) { buffer[lg] = '\n'; buffer[lg + 1] = '\0'; ++lg; } write (ftemp, buffer, RECSIZ); if (edit_temp) { edit_temp->suite = (edit_ch *) m_alloue (sizeof (edit_ch)); edit_temp = edit_temp->suite; } else { edit_temp = pvoie->tete_edit.liste = (edit_ch *) m_alloue (sizeof (edit_ch)); } edit_temp->suite = NULL; edit_temp->record = pos++; nbcar += (long) lg + 1; } fclose (fptr); pvoie->tete_edit.new_t = 0; } else pvoie->tete_edit.new_t = 1; pvoie->tete_edit.max = pos; close (ftemp); sprintf (buffer, "%s : %d/%ld", fic (pvoie->sr_fic), pos, nbcar + 1); outsln (buffer, strlen (buffer)); } void sauve_temp (void) { FILE *fptr; int ftemp, pos = 0; long nbcar = 0L; edit_ch *edit_temp; char buffer[RECSIZ + 2]; if (pvoie->tete_edit.new_t) pvoie->tete_edit.new_t = 2; if ((fptr = fopen (pvoie->sr_fic, "wt")) == NULL) fbb_error (ERR_CREATE, pvoie->sr_fic, 3); ftemp = ouvre_temp (); edit_temp = pvoie->tete_edit.liste; while (edit_temp) { lseek (ftemp, RECSIZ * (long) edit_temp->record, 0); read (ftemp, buffer, RECSIZ); fputs (buffer, fptr); nbcar += (long) strlen (buffer) + 1; ++pos; edit_temp = edit_temp->suite; } /* fputc ('\032', fptr); */ fclose (fptr); close (ftemp); wr_dir (pvoie->sr_fic, pvoie->sta.indicatif.call); sprintf (buffer, "%s : %d/%ld", fic (pvoie->sr_fic), pos, nbcar + 1); outsln (buffer, strlen (buffer)); } void edit (void) { char *ptr; pvoie->lignes = -1; switch (pvoie->niv3) { case 0: strtok (indd, " \r"); /* cprintf("Commande : <%s>\r\n", indd) ; */ if ((ptr = strtok (NULL, " \r")) == NULL) { texte (T_ERR + 20); } else { if (tst_point (ptr)) { if (aut_ecr (ch_slash (ptr), 1)) { pvoie->tete_edit.numero = 0; strcpy (pvoie->sr_fic, tot_path (ch_slash (ptr), pvoie->dos_path)); cree_temp (); prompt_edit (); ch_niv3 (1); break; } } } maj_niv (9, 0, 0); prompt_dos (); break; case 1: if (!cmd_edit ()) { kill_temp (); if (pvoie->tete_edit.new_t == 2) { ch_niv3 (2); texte (T_YAP + 3); break; } else { maj_niv (9, 0, 0); prompt_dos (); break; } } prompt_edit (); break; case 2: new_label (); maj_niv (9, 0, 0); prompt_dos (); break; } } fbb-7.0.10/src/devio.c0000644000175000017500000001670413613360505011324 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Routines d'entrees-Sorties * */ #include #include #include #include #include #include static int car_tnc_linux(int port); static int closecom_linux(int com); int initcom_linux (int com); static int rec_tnc_linux (int port); static void send_tnc_linux (int port, int carac); int drsi_port (int port, int canal) { int i; df ("drsi_port", 2); for (i = 1; i < NBPORT; i++) { if (DRSI (i)) { if (p_port[i].ccanal == canal) { ff (); return (i); } } } ff (); return (port); } int hst_port (int port, int canal) { int i; for (i = 1; i < NBPORT; i++) { if (HST (i)) { if (p_port[i].ccanal == canal) { ff (); return (i); } } } return (port); } int bpq_port (int port, int canal) { int i; df ("bpq_port", 2); for (i = 1; i < NBPORT; i++) { if (BPQ (i)) { if (p_port[i].ccanal == canal) { ff (); return (i); } } } ff (); return (port); } int linux_port (int port, int canal) { return (canal); } int initcom (void) { int com, port, valid; df ("initcom", 0); #ifdef ENGLISH if (DEBUG) cprintf ("Debug valid \r\n"); #else if (DEBUG) cprintf ("Debug valide\r\n"); #endif else { for (com = 1; com < NBPORT; com++) { valid = 0; p_com[com].comfd = -1; for (port = 1; port < NBPORT; port++) { if ((p_port[port].pvalid) && (p_port[port].ccom == com)) { switch (p_port[port].typort) { case TYP_MOD : case TYP_DED : case TYP_HST : valid = 1; break; default : valid = 0; break; } break; } } if (valid) { int ret = 0; switch (p_com[com].combios) { case P_LINUX: ret = initcom_linux (com); break; } if (!ret) return(FALSE); } } } sleep_ (1); ff (); return(TRUE); } void closecom (void) { int com, port, valid; #ifdef ENGLISH if (DEBUG) cprintf ("Debug valid \r\n"); #else if (DEBUG) cprintf ("Debug valide\r\n"); #endif else { if (p_port == NULL) return; for (com = 1; com < NBPORT; com++) { valid = 0; for (port = 1; port < NBPORT; port++) { #ifdef __WINDOWS__ if ((p_port[port].pvalid) && (ETHER (port))) { free_socket (port); } #endif if ((p_port[port].pvalid) && (p_port[port].ccom == com)) { switch (p_port[port].typort) { case TYP_MOD : case TYP_DED : case TYP_HST : valid = 1; break; default : valid = 0; break; } break; } } if (valid) { switch (p_com[com].combios) { case P_LINUX: closecom_linux(com); break; } } } } sleep_ (1); return; } int car_tnc (int port) { int val; df ("car_tnc", 1); switch (BIOS (port)) { case P_LINUX: val = car_tnc_linux (port); return(val); } ff (); return (1); } int rec_tnc (int port) { int c = -1; df ("rec_tnc", 1); switch (BIOS (port)) { case P_LINUX: c = rec_tnc_linux (port); break; default: fbb_error (ERR_TNC, "RECEIVE: WRONG INTERFACE", BIOS (port)); break; } ff (); return (c); } void send_tnc (int port, int carac) { df ("send_tnc", 2); switch (BIOS (port)) { case P_LINUX: send_tnc_linux (port, carac); break; default: fbb_error (ERR_TNC, "SEND: WRONG INTERFACE", BIOS (port)); } ff (); return; } int car_tx (int port) { return (0); } #undef inportb #undef outportb void selcanal (int port) { return; } /* * Routines Entrees-Sortie ... Interface avec LINUX * */ static struct termios def_tty; int default_tty(int com) { return tcsetattr(p_com[com].comfd, TCSANOW, &def_tty); } #undef open #undef close #undef read #undef write int initcom_linux (int com) { int spd; int comfd; int newbaud; struct termios tty; /* Ferme le port si deja ouvert */ closecom_linux (com); /* sprintf(buf, "/dev/cua%d", com-1); */ printf("Init %s\n", p_com[com].name); comfd = open(p_com[com].name, O_RDWR); if (comfd == -1) { fprintf(stderr, "com%d : cannot open the device %s\n", com, p_com[com].name); return(0); } p_com[com].comfd = comfd; tcgetattr(comfd, &def_tty); tcgetattr(comfd, &tty); newbaud = (int)(p_com[com].baud >> 5); if (p_com[com].options & 0x20) newbaud += 10; printf("newbaud = %d\n", newbaud); switch(newbaud) { case 2: spd = B300; break; case 3: spd = B600; break; case 4: spd = B1200; break; case 5: spd = B2400; break; case 6: spd = B4800; break; case 7: spd = B9600; break; case 12: spd = B19200; break; case 14: spd = B38400; break; case 15: spd = B57600; break; case 16: spd = B115200; break; default: spd = -1; break; } if (spd != -1) { cfsetospeed(&tty, (speed_t)spd); cfsetispeed(&tty, (speed_t)spd); } tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; /* Set into raw, no echo mode */ tty.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | IUCLC | IXANY | IXON | IXOFF | INPCK | ISTRIP); tty.c_iflag |= (BRKINT | IGNPAR); tty.c_oflag &= ~OPOST; tty.c_lflag = ~(ICANON | ISIG | ECHO | ECHONL | ECHOE | ECHOK); tty.c_cflag |= CREAD | CRTSCTS; /* #else Okay, this is better. XXX - Fix the above. tty.c_iflag = IGNBRK; tty.c_lflag = 0; tty.c_oflag = 0; tty.c_cflag |= CLOCAL | CREAD; #endif */ tty.c_cc[VMIN] = 1; tty.c_cc[VTIME] = 5; /* Flow control. */ /* if (!hwf) tty.c_cflag &= ~CRTSCTS; if (swf) tty.c_iflag |= IXON; */ tty.c_cflag &= ~(PARENB | PARODD); /* if (par[0] == 'E') tty.c_cflag |= PARENB; else if (par[0] == 'O') tty.c_cflag |= PARODD; */ tcsetattr(comfd, TCSANOW, &tty); tcflow(comfd, TCOON); /* { / Set RTS / int mcs; ioctl(comfd, TIOCMGET, &mcs); mcs |= TIOCM_RTS; ioctl(comfd, TIOCMSET, &mcs); } */ return (TRUE); } static int rec_tnc_linux (int port) { int chr; if (!car_tnc_linux(port)) return(-1); read(p_com[(int)p_port[port].ccom].comfd, &chr, 1); return (chr & 0xff); } static void send_tnc_linux (int port, int carac) { write(p_com[(int)p_port[port].ccom].comfd, &carac, 1); } static int car_tnc_linux(int port) { long i = 0; (void) ioctl(p_com[(int)p_port[port].ccom].comfd, FIONREAD, &i); return((int)i); } static int closecom_linux(int com) { if (p_com[com].comfd == -1) return(0) ; sleep(2); xprintf("Close com !\n"); close(p_com[com].comfd); p_com[com].comfd = -1; return(1); } /* * end of devio.c * */ fbb-7.0.10/src/mbl_read.c0000644000175000017500000004310013613360505011751 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module MBL_READ.C */ #define NO_STATUS static int mbl_rx (int); static int read_mine (int); static int teste_liste (bullist *); /* Commande 'R' -> Read message */ /* Commande 'V' -> Read verbose message */ #include "aff_stat.c" static int strfind (bullist * pbul, char *cherche) { return (strmatch (ltitre (1, pbul), cherche)); } static int teste_liste (bullist * lbul) { if (lbul->numero < pvoie->recliste.debut) return (0); if (lbul->numero > pvoie->recliste.fin) return (0); if (lbul->date < pvoie->recliste.avant) return (0); if (lbul->date > pvoie->recliste.apres) return (0); if (!droits (COSYSOP)) { if (strcmp (lbul->desti, "KILL") == 0) return (0); if (lbul->type == 'A') return (0); if ((lbul->status == 'K') && (pvoie->recliste.status != 'K')) return (0); if ((lbul->status == 'A') && (pvoie->recliste.status != 'A')) return (0); } if (*pvoie->recliste.find) return (strfind (lbul, pvoie->recliste.find)); if ((pvoie->recliste.type) && (pvoie->recliste.type != lbul->type)) return (0); if ((pvoie->recliste.status) && (pvoie->recliste.status != lbul->status)) return (0); if ((*pvoie->recliste.exp) && (!strmatch (lbul->exped, pvoie->recliste.exp))) return (0); if ((*pvoie->recliste.dest) && (!strmatch (lbul->desti, pvoie->recliste.dest))) return (0); if (*pvoie->recliste.bbs) { if (*pvoie->recliste.bbs == '-') { if (*lbul->bbsv) return (0); } else { if (!strmatch (lbul->bbsv, pvoie->recliste.bbs)) return (0); } } return (1); } static int read_mine (int mode) { /* Lecture des messages personnels */ bloc_mess *temp = tete_dir; int i, nouveau = 0, trouve = 0; unsigned indic; bullist pbul; mess_noeud *lptr; char s[80]; rd_list *ptemp = NULL; if (isdigit (mode)) { s[0] = (char) mode; s[1] = '\0'; insnoeud (s, &indic); } else { if (mode == 'N') nouveau = 1; indic = pvoie->no_indic; } ouvre_dir (); while (temp->suiv) temp = temp->suiv; while (temp) { i = T_BLOC_MESS; while (i--) { lptr = &temp->st_mess[i]; if ((lptr->noenr) && (lptr->no_indic == indic)) { read_dir (lptr->noenr, &pbul); if ((pbul.type) && (pbul.status != 'H') && ((!nouveau) || (nouveau && (pbul.status == 'N')))) { trouve = 1; if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else pvoie->t_read = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); ptemp->suite = NULL; ptemp->nmess = lptr->nmess; ptemp->verb = pvoie->recliste.l; } } } temp = prec_dir (temp); } ferme_dir (); if (!trouve) { if (nouveau) texte (T_MBL + 4); else texte (T_MBL + 3); } return (trouve); } int mbl_bloc_list (void) { int retour = 0; bullist ligne; rd_list *ptemp; unsigned offset = pvoie->recliste.offset; bloc_mess *bptr = pvoie->recliste.ptemp; mess_noeud *mptr; ptemp = pvoie->t_read; while (ptemp) ptemp = ptemp->suite; pvoie->seq = FALSE; ouvre_dir (); while (bptr) { --offset; mptr = &(bptr->st_mess[offset]); read_dir (mptr->noenr, &ligne); if (ligne.numero < pvoie->recliste.debut) break; if ((mptr->noenr) && (droit_ok (&ligne, 1)) && (teste_liste (&ligne))) { if (pvoie->recliste.last-- == 0L) break; if (pvoie->temp1) pvoie->temp1 = 0; /* Entre le numero trouve en liste */ if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_read = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = ligne.numero; ptemp->verb = pvoie->recliste.l; } if (offset == 0) { bptr = prec_dir (bptr); offset = T_BLOC_MESS; } if (!(POP (no_port (voiecur))) && (trait_time > MAXTACHE)) { pvoie->seq = TRUE; retour = 1; break; } } ferme_dir (); pvoie->recliste.offset = offset; pvoie->recliste.ptemp = bptr; if ((!retour) && (pvoie->t_read)) retour = 2; return (retour); } int mbl_rx (int verbose) { int error = 0; long no; int c, ok = TRUE; bullist *pbul; rd_list *ptemp = NULL; df ("mbl_rx", 1); /* print_fonction(stdout); print_history(stdout); sleep_(10); for (;;); */ sup_ln (indd); c = toupper (*indd); ++indd; if ((c != ' ') && (*indd != ' ') && (*indd != '\0')) { ff (); return (1); } pvoie->aut_nc = 1; libere_tread (voiecur); init_recliste (voiecur); pvoie->recliste.l = verbose; switch (c) { case 'A': pvoie->recliste.status = 'A'; break; case 'B': pvoie->recliste.type = 'B'; break; case 'E': if (droits (COSYSOP)) { int v; for (v = 0; v < NBVOIES; v++) { if ((svoie[v]->niv1 == N_MBL) && (svoie[v]->niv2 == 18)) { texte (T_TRT + 0); ok = 0; /* Interdit le multi-acces */ break; } } if (ok) { maj_niv (N_MBL, 18, 0); ff (); return (review ()); } } else { --indd; error = 1; ok = 4; } break; case 'F': pvoie->recliste.status = 'F'; break; case 'K': pvoie->recliste.status = 'K'; break; case 'L': if (teste_espace ()) { if (isdigit (*indd)) pvoie->recliste.last = lit_chiffre (0); else { texte (T_ERR + 3); ok = 0; } } else { /* texte(T_ERR + 2) ; */ --indd; error = 1; ok = 4; } break; case 'M': case 'N': if (read_mine (c)) ok = 2; else ok = 0; break; case 'P': pvoie->recliste.type = 'P'; break; case 'S': if (teste_espace ()) strn_cpy (19, pvoie->recliste.find, indd); else { /* texte(T_ERR + 2) ; */ --indd; error = 1; ok = 4; } break; case 'T': pvoie->recliste.type = 'T'; break; case 'U': pvoie->recliste.type = 'P'; pvoie->recliste.status = 'N'; break; case 'X': pvoie->recliste.status = 'X'; break; case 'Y': pvoie->recliste.status = 'Y'; break; case '$': pvoie->recliste.status = '$'; break; case '<': if (teste_espace ()) { strn_cpy (6, pvoie->recliste.exp, indd); } else { texte (T_ERR + 2); ok = 0; } break; case '>': if (teste_espace ()) { strn_cpy (6, pvoie->recliste.dest, indd); } else { texte (T_ERR + 2); ok = 0; } break; case '@': if (teste_espace ()) { strn_cpy (6, pvoie->recliste.bbs, indd); } else { /* texte(T_ERR + 2) ; */ --indd; error = 1; ok = 4; } break; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': if (read_mine (c)) ok = 2; else ok = 0; break; case ' ': if (strchr (indd, '-')) { if (isdigit (*indd)) pvoie->recliste.debut = lit_chiffre (1); else { texte (T_ERR + 3); ok = 0; break; } ++indd; /* saute le tiret */ if (isdigit (*indd)) pvoie->recliste.fin = lit_chiffre (1); if (pvoie->recliste.fin <= pvoie->recliste.debut) ok = 0; } else { ok = 0; while ((no = lit_chiffre (1)) != 0L) { if ((pbul = ch_record (NULL, no, ' ')) != NULL) { if (droit_ok (pbul, 1)) { if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_read = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = no; ptemp->verb = verbose; ok = 2; } else texte (T_ERR + 10); } else texte (T_ERR + 10); /* Only one message by request in POP mode */ if (POP (no_port (voiecur))) break; } } break; default: if ((c == '\0') && (verbose)) { texte (T_MBL + 8); ok = 0; } else { error = 1; --indd; ok = 4; } break; } switch (ok) { case 0: retour_mbl (); break; case 1: pvoie->recliste.ptemp = last_dir (); pvoie->recliste.offset = T_BLOC_MESS; pvoie->temp1 = 1; pvoie->sr_mem = 1; ch_niv3 (1); mbl_read (verbose); break; case 2: pvoie->sr_mem = 1; ch_niv3 (2); mbl_read (verbose); break; } ff (); return (error); } int mbl_read (int verbose) { int error = 0; df ("mbl_read", 1); switch (pvoie->niv3) { case 0: error = mbl_rx (verbose); break; case 1: switch (mbl_bloc_list ()) { case 0: /* Pas de message */ texte (T_MBL + 3); retour_mbl (); case 1: /* Pas fini */ break; case 2: /* Termine */ ch_niv3 (2); mbl_read (verbose); break; } break; case 2: if (mbl_mess_read () == 0) { retour_mbl (); } break; case 3: if (read_mess (1) == 0) ch_niv3 (2); break; default: fbb_error (ERR_NIVEAU, "MSG-READ", pvoie->niv3); } ff (); return (error); } static void entete_mess (bullist * ligne) { *ptmes = *ligne; if (*(ligne->bbsv)) sprintf (varx[0], "@%-6s ", ligne->bbsv); else *varx[0] = '\0'; texte (T_MBL + 35); texte (T_MBL + 38); } static void end_read_mess (void) { char s[80]; rd_list *ptemp = pvoie->t_read; if (ptemp) { sprintf (s, "R %ld", ptemp->nmess); fbb_log (voiecur, 'M', s); cr_cond (); if (POP (no_port (voiecur))) { out("\033", 1); } else { texte (T_MBL + 33); } marque_obuf (); pvoie->t_read = ptemp->suite; m_libere (ptemp, sizeof (rd_list)); } } char *pop_date(long date) { char *day[] = {"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; char *mon[]= {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; struct tm *sdate; static char cdate[40]; sdate = localtime (&date); sprintf (cdate, "%s, %02d %s %d %02d:%02d:%02d %+03ld00", day[sdate->tm_wday], sdate->tm_mday, mon[sdate->tm_mon], sdate->tm_year %100 + 2000, sdate->tm_hour, sdate->tm_min, sdate->tm_sec, -timezone/3600); return cdate; } int read_mess (int verbose) { int nb; FILE *fptr; char chaine[256]; rd_list *ptemp = pvoie->t_read; nb = 0; if ((fptr = ouvre_mess (O_TEXT, ptemp->nmess, '\0')) != NULL) { fseek (fptr, pvoie->enrcur, 0); if (!verbose) fseek (fptr, supp_header (fptr, 1), 0); fflush (fptr); while ((nb = read (fileno (fptr), chaine, 250)) > 0) { outs (chaine, nb); if (!(POP (no_port (voiecur))) && (pvoie->memoc >= MAXMEM)) { /* if (!getvoie(CONSOLE]->connect) cprintf("Max atteint\r\n") ; */ pvoie->enrcur = ftell (fptr); break; } } ferme (fptr, 45); } if (nb == 0) end_read_mess (); return (nb); } static void trans_header (char *ptr, char *bbsfrom, long date) { static char ligne[80]; int c; int champ; int nb; int len; int bbs; char rbbs[80]; char home[41]; ptr += 2; champ = 2; nb = 0; bbs = 0; *home = '\0'; date = 0L; do { c = *ptr; switch (champ) { case 0: switch (c) { case '@': bbs = 1; champ = 3; nb = 0; break; case '#': champ = 6; nb = 0; break; case '$': champ = 7; nb = 0; break; case '[': champ = 4; nb = 0; break; case 'Z': if (*(ptr + 1) == ':') { ++ptr; champ = 5; nb = 0; } break; default: if ((bbs == 0) && (isdigit (c))) { nb = 0; rbbs[nb++] = c; champ = 6; } } case 1: if (isspace (c)) champ = 0; break; case 2: /* Lecture de la date - Mettre la date la plus ancienne */ if (nb <= 10) rbbs[nb] = c; if (nb == 10) { long rdate ; rbbs[11] = '\0'; rbbs[6] = '\0'; if ((rdate = date_to_time (rbbs)) != 0L) date = rdate + hour_to_time (rbbs + 7); champ = 1; } ++nb; break; case 3: /* Lecture du home BBS */ if ((nb == 0) && (c == ':')) break; if ((ISGRAPH (c)) && (nb < 40)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; strn_cpy (40, home, rbbs); champ = 0; } break; case 4: /* Lecture du Qth */ if ((c != ']') && (nb < 30)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; champ = 0; } break; case 5: /* Lecture du Zip Code */ if ((ISGRAPH (c)) && (nb < 8)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; champ = 0; } break; case 6: /* Lecture du home premier numero */ if ((nb == 0) && (c == ':')) break; if ((isdigit (c)) && (nb < 10)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; if ((bbs == 0) && (c == '@')) { bbs = 1; champ = 3; nb = 0; } else champ = 0; } break; case 7: /* Lecture du BID/MID */ if ((nb == 0) && (c == ':')) break; if ((ISGRAPH (c)) && (nb < 12)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; champ = 0; } break; } ++ptr; } while (ISPRINT (c)); len = sprintf(ligne, "Received: from %s ; %s", home, pop_date(date)); outsln(ligne, len); strcpy(bbsfrom, home); } static char *read_headers(long date) { int nb; FILE *fptr; char chaine[256]; rd_list *ptemp = pvoie->t_read; static char bbs[41]; nb = 0; *bbs = '\0'; if ((fptr = ouvre_mess (O_TEXT, ptemp->nmess, '\0')) != NULL) { while (fgets(chaine, sizeof(chaine), fptr)) { if (strncmp("R:", chaine, 2) != 0) break; trans_header(chaine, bbs, date); } ferme (fptr, 45); } return bbs; } char *xuidl(long numero, char *callsign) { int i; char call[10]; static char str[50]; sprintf(call, "%6s", callsign); for (i = 0 ; i < 6 ; i++) sprintf(str+i*2, "%02x", call[i] & 0xff); sprintf(str+i*2, "%032lx", numero); return str; } int mbl_mess_read (void) { bullist *pbul; rd_list *ptemp; while ((ptemp = pvoie->t_read) != NULL) { /* cprintf("Lit le %ld\r\n", ptemp->nmess) ; */ if ((pbul = ch_record (NULL, ptemp->nmess, 'Y')) != NULL) { if (POP (no_port (voiecur))) { int nb; char chaine[80]; char name[80]; char exped[80]; char *reply; Wps *wps; /* Get the name from WP */ wps = wp_find(pbul->exped, 0); if ((wps) && (*wps->name) && (*wps->name != '?')) { sprintf(name, "%s (%s)", pbul->exped, wps->name); } else { strcpy(name, pbul->exped); } /* Dump headers and get the older BBS for return address */ reply = read_headers(pbul->date); if (*reply == '\0') reply = mypath; /**** SHOULD BE CONFIGURABLE (BEGIN) ****/ if (*pop_host) { /*** address like f6fbb%f6fbb.fmlr.fra.eu@f6fbb.ampr.org */ nb = snprintf(exped, sizeof(exped)-1, "%s%%%s@%s", pbul->exped, reply, pop_host); exped[sizeof(exped)-1] = 0; } else { nb = snprintf(exped, sizeof(exped)-1, "%s@%s", pbul->exped, reply); exped[sizeof(exped)-1] = 0; } /**** SHOULD BE CONFIGURABLE (END) ****/ nb = snprintf(chaine, sizeof(chaine), "Date: %s", pop_date(pbul->datesd)); outsln (chaine, nb); nb = snprintf(chaine, sizeof(chaine), "From: %s <%s>", name, exped); outsln (chaine, nb); if (pbul->type == 'B') { /* News -- When user enters Reply, this is where reply goes. Thunderbird, at least, doesn't mind that these names don't match the group name, and it makes replies go to the correct distribution */ if (!pbul->bbsv[0]) { nb = snprintf(chaine, sizeof(chaine)-1, "Newsgroups: %s", pbul->desti ); } else { nb = snprintf(chaine, sizeof(chaine)-1, "Newsgroups: %s@%s", pbul->desti, pbul->bbsv ); } outsln(chaine, nb); nb = snprintf(chaine,sizeof(chaine), "Subject: %s", pbul->titre); // Removed [desti] to prevent Subjects from being changed during reply outsln (chaine, nb); nb = snprintf(chaine, sizeof(chaine), "Message-ID: <%s>", pbul->bid); /* Use BID for Message-ID. This allows messages to be downloaded even if they change groups. Reading will now ref bid */ outsln (chaine, nb); } else { /* To: Moved here. To: is not correct for */ nb = snprintf(chaine, sizeof(chaine), "To: %s", pbul->desti); outsln (chaine, nb); /* Mail */ nb = snprintf(chaine,sizeof(chaine), "Subject: %s", pbul->titre); outsln (chaine, nb); nb = snprintf(chaine, sizeof(chaine), "Message-ID: <%ld@%s>", pbul->numero, mycall); outsln (chaine, nb); nb = snprintf(chaine, sizeof(chaine), "X-UIDL: %s", xuidl(pbul->numero, mycall)); outsln (chaine, nb); } cr(); } else { entete_mess (pbul); } pvoie->enrcur = 0L; if (read_mess (ptemp->verb)) { ch_niv3 (3); return (1); } } else { pvoie->t_read = ptemp->suite; m_libere (ptemp, sizeof (rd_list)); } } return (0); } void libere_tread (int voie) { rd_list *ptemp = svoie[voie]->t_read; rd_list *pprec; while ((pprec = ptemp) != NULL) { ptemp = pprec->suite; m_libere (pprec, sizeof (rd_list)); } svoie[voie]->t_read = NULL; } void libere_tlist (int voie) { rd_list *ptemp = svoie[voie]->t_list; rd_list *pprec; while ((pprec = ptemp) != NULL) { ptemp = pprec->suite; m_libere (pprec, sizeof (rd_list)); } svoie[voie]->t_list = NULL; } fbb-7.0.10/src/redist.c0000644000175000017500000002741613613360505011512 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE REDIST.C Server from G7FCI * * * REDIST.C - Allows SP messages sent to the server to be redistributed * as bulletins to the relevant local bulletin grouping. * * The intention of this server is to allow users to send local, regional or * national bulletins in areas, regions or countries that are remote from * them. For example, someone could send a bulletin to all BBSs in an * area local to a BBS in Los Angeles, even though they don't know the * relevant bulletin grouping for that area. Messages are also sent as * SP, so they don't leave a trail of useless bulletins at all the BBSs on * the way. * * The server also has the side effect that allows TNC PMS users to send * personal messages which will be translated into bulletins. This can also * be used by users who can't remember the relevant groupings for the bulletin * groupings. * * Three bulletin groupings are allowed, ie LOCAL, REGION and * NATION. The translation for each grouping is held in the * file SYSTEM\REDIST.SYS. This file contains one line for each * translation. For example, the file at GB7FCI would contain * the following three lines : * * #NW * #ZONEA * GBR * * With the above file, the server will translate a message in the following * format : * * SP LOCAL @ GB7FCI < G3UVQ * Subject line * R:.............. * R:.............. * * Lines of message text * /EX * * ...into a bulletin with the format : * * SB ALL @ #NW < G3UVQ * Subject line * R:............. * * Lines of message text * /EX * * The subject line and full text are copied. * * The copied message is appended onto the MAIL.IN BBS file. * * Next 2 lines remove exception handling */ #include #define BBS_CALL 1 /* Offset of BBS Call in INIT.SRV */ #define BBS_QRA 3 /* Offset of QRA line in INIT.SRV */ #define BBS_QTH 4 /* Offset of QTH line in INIT.SRV */ #define HOST_SYS 12 /* Offset of SYSOP callsign in INIT.SRV */ #define MAIL_IN 14 /* Offset of MAIL.IN path in INIT.SRV */ #define LINE 128 /* line 'buffer' length */ #define AT_FLD 32 /* Length of fields to hold addresses */ #define DESC_FLD 32 /* Length of a description field */ #define TO_FLD 7 /* Length of TO field */ /* Global variables */ char locbbs_addr[LINE] = ""; char locbbs_desc[DESC_FLD] = ""; char local_addr[LINE] = ""; char local_desc[DESC_FLD] = ""; char region_addr[LINE] = ""; char region_desc[DESC_FLD] = ""; char nation_addr[LINE] = ""; char nation_desc[DESC_FLD] = ""; char default_to[TO_FLD] = ""; int mail_sysop = 1; /* Does the sysop need to be mailed? */ int redist_update = 0; /* Infos got from config file */ FILE *mail_file; char *strupr (char *str) { char *tmp = str; while (*tmp) { if (islower (*tmp)) *tmp = toupper (*tmp); ++tmp; } return str; } /* * Copy string 2 into string 1 removing spaces * Copy until NULL in str2 or length reached. */ void tidy_string (char *str1, char *str2, int length) { char *ptr1, *ptr2; int cntr = 0; ptr1 = str1; ptr2 = str2; while (*ptr2 != '\0' && cntr < length) { if (*ptr2 == ' ' || *ptr2 == '=') { ptr2++; } else { *ptr1 = *ptr2; ptr1++; ptr2++; cntr++; } } } /* * Read values from config file into global variables. */ int read_config (void) { char buffer[LINE]; char *string_id; char *ptr; char str_val[LINE]; char tmp_str[2]; FILE *config; if (redist_update) return (1); config = fopen (c_disque ("REDIST.SYS"), "rt"); if (config == NULL) return (0); while (!feof (config) && !ferror (config)) { fgets (buffer, LINE, config); string_id = strtok (buffer, " =\n"); if (*string_id == '#') continue; ptr = strtok (NULL, "\n"); if (ptr) strcpy (str_val, ptr); if (strcmpi (string_id, "LOCBBS") == 0) { tidy_string (locbbs_addr, str_val, LINE); locbbs_addr[LINE - 1] = '\0'; } if (strcmpi (string_id, "LOCBBS_DESC") == 0) { strncpy (locbbs_desc, str_val, DESC_FLD); locbbs_desc[DESC_FLD - 1] = '\0'; } if (strcmpi (string_id, "LOCAL") == 0) { tidy_string (local_addr, str_val, LINE); local_addr[LINE - 1] = '\0'; } if (strcmpi (string_id, "LOCAL_DESC") == 0) { strncpy (local_desc, str_val, DESC_FLD); local_desc[DESC_FLD - 1] = '\0'; } if (strcmpi (string_id, "REGION") == 0) { tidy_string (region_addr, str_val, LINE); region_addr[LINE - 1] = '\0'; } if (strcmpi (string_id, "REGION_DESC") == 0) { strncpy (region_desc, str_val, DESC_FLD); region_desc[DESC_FLD - 1] = '\0'; } if (strcmpi (string_id, "NATION") == 0) { tidy_string (nation_addr, str_val, LINE); nation_addr[LINE - 1] = '\0'; } if (strcmpi (string_id, "NATION_DESC") == 0) { strncpy (nation_desc, str_val, DESC_FLD); nation_desc[DESC_FLD - 1] = '\0'; } if (strcmpi (string_id, "DEFAULT_TO") == 0) { strncpy (default_to, str_val, TO_FLD); default_to[TO_FLD - 1] = '\0'; } /* if (strcmpi(string_id,"MAIL_IN") == 0) { strncpy(mail_in,str_val,LINE); mail_in[LINE-1] = '\0'; } */ if (strcmpi (string_id, "MAIL_SYSOP") == 0) { tidy_string (tmp_str, str_val, 1); tmp_str[1] = '\0'; strupr (tmp_str); if (tmp_str[0] == 'N') mail_sysop = 0; } } fclose (config); if (strlen (locbbs_addr) < 1) { strcpy (locbbs_addr, my_call); } redist_update = 1; /* Has an update been sent yet? 0 = no */ return (1); } int redist (char *filename) { FILE *fptr1; FILE *temp_file; char buffer[LINE] = ""; char who_from[TO_FLD] = ""; char what_area[TO_FLD] = ""; char to_field[TO_FLD] = ""; char new_area[LINE] = ""; char area_desc[DESC_FLD] = ""; char at_field[LINE] = ""; char from_bbs[LINE] = ""; char subject_line[LINE] = ""; char *buffptr; char *buffptr2; char *ptr; int in_header; int cntr; fptr1 = fopen (filename, "rt"); /* Open the received message */ if (fptr1 == NULL) return (1); if (!read_config ()) return (1); /* Get the REDIST config values */ mail_file = fappend (MAILIN, "b"); if (mail_file == NULL) { return (1); } fgets (buffer, LINE, fptr1); /* Read the command line */ sscanf (buffer, "%*s %s %*s %s\n", /* Extract details of area */ what_area, /* and who sent the message */ who_from); if (strcmp (what_area, "LOCBBS") == 0) { strcpy (new_area, locbbs_addr); strcpy (area_desc, locbbs_desc); } else if (strcmp (what_area, "LOCAL") == 0) { strcpy (new_area, local_addr); strcpy (area_desc, local_desc); } else if (strcmp (what_area, "REGION") == 0) { strcpy (new_area, region_addr); strcpy (area_desc, region_desc); } else if (strcmp (what_area, "NATION") == 0) { strcpy (new_area, nation_addr); strcpy (area_desc, nation_desc); } else { strcpy (new_area, locbbs_addr); strcpy (area_desc, locbbs_desc); } if (strlen (area_desc) < 1) /* If descriptions not set up */ { strcpy (area_desc, new_area); } temp_file = fopen ("REDIST.$$$", "wb"); if (temp_file == NULL) return (1); /* Append the copies to mail in file */ fgets (buffer, LINE, fptr1); /* Get subject line */ buffer[strlen (buffer) - 1] = '\0'; /* Strip LF at end of line */ buffptr = buffer; if (*buffer == '#') /* User requested TO field? */ { buffptr++; /* Skip past # */ while ((*buffptr) && (isspace (*buffptr))) buffptr++; cntr = 0; buffptr2 = to_field; while (isalnum (*buffptr)) { if (cntr < 6) { *buffptr2 = toupper (*buffptr); buffptr2++; cntr++; } buffptr++; } *buffptr2 = '\0'; while ((*buffptr) && (isspace (*buffptr))) buffptr++; } buffptr2 = subject_line; cntr = 0; while (*buffptr != '\0') { if (cntr == 78) break; *buffptr2 = *buffptr; buffptr++; buffptr2++; cntr++; } *buffptr2 = '\0'; if (strlen (to_field) < 1) { if (strlen (default_to) > 0) { strcpy (to_field, default_to); } else { strcpy (to_field, "REDIST"); } } fprintf (temp_file, "%s\r\n", subject_line); /* Output subject line */ in_header = 1; fgets (buffer, LINE, fptr1); buffer[strlen (buffer) - 1] = '\0'; /* Strip LF at end of line */ while (!feof (fptr1) && !ferror (fptr1)) { if (in_header == 1) { if (strncmp (buffer, "R:", 2) == 0) { strupr (buffer); /* Capitalize */ /* Get FROM_BBS */ buffptr = buffer; /* Point at buffer */ buffptr = strchr (buffptr, '@'); /* Find the '@' */ if (buffptr != NULL) { buffptr++; if (!isalnum (*buffptr)) buffptr++; /* Skip past the ':' */ buffptr = strtok (buffptr, " "); if (buffptr) { ptr = strtok (buffptr, " "); if (ptr) { strcpy (from_bbs, ptr); } } } fgets (buffer, LINE, fptr1); buffer[strlen (buffer) - 1] = '\0'; /* Strip LF at EOL */ continue; } else in_header = 0; if (strlen (from_bbs) > 0) { /* Work out the date and time for the new BBS header */ long temps; struct tm *sdate; temps = time (NULL); sdate = gmtime (&temps); fprintf (temp_file, "R:%02d%02d%02d/%02d%02dZ @:%s {REDIST}\r\n", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min, from_bbs); } } fprintf (temp_file, "%s\r\n", buffer); fgets (buffer, LINE, fptr1); sup_ln (buffer); } fclose (temp_file); fclose (fptr1); /* * Make copies of the temp file for each destination in the * new_area variable. */ ptr = strtok (new_area, ",\r\n"); while (ptr) { n_cpy (AT_FLD - 1, at_field, ptr); fprintf (mail_file, "#\nSB %s @ %s < %s\r\n", to_field, at_field, who_from); fptr1 = fopen ("REDIST.$$$", "rb"); if (fptr1 == NULL) return (1); fgets (buffer, LINE, fptr1); sup_ln (buffer); while (!feof (fptr1) && !ferror (fptr1)) { if (strcmpi (buffer, "/EX") == 0) { fprintf (mail_file, "\r\n** This bulletin was distributed in your area using a local REDIST server.\r\n"); } fprintf (mail_file, "%s\r\n", buffer); fgets (buffer, LINE, fptr1); buffer[strlen (buffer) - 1] = '\0'; /* Strip LF at end of line */ } fclose (fptr1); ptr = strtok (NULL, ",\r\n"); } /* Report successful distribution to sender */ if (strlen (from_bbs) > 0) { fprintf (mail_file, "SP %s @ %s < %s\r\n", who_from, from_bbs, mycall); } else { fprintf (mail_file, "SP %s < %s\r\n", who_from, mycall); } fprintf (mail_file, "Re: %s\r\n\r\n", subject_line); fprintf (mail_file, "The %s server at %s has redistributed your message as\r\n", what_area, mycall); fprintf (mail_file, "a bulletin covering %s.\r\n", area_desc); fprintf (mail_file, "/EX\r\n"); /* Mail sysop if required */ if (mail_sysop == 1) { fprintf (mail_file, "SP %s < REDIST\r\n", admin); fprintf (mail_file, "Report\r\n\r\n"); fprintf (mail_file, "The %s REDIST server has distributed a bulletin from %s.\r\n", what_area, who_from); fprintf (mail_file, "/EX\r\n"); } fclose (mail_file); remove ("redist.$$$"); return (0); /* Tell BBS all is correct */ } fbb-7.0.10/src/drv_pop.c0000644000175000017500000023242113613360505011663 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /****************************** * * DRIVER pour POP IP access * ******************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #undef open #undef read #undef write #undef close #define AX25_CALLSID 10 #define READ_EVENT 1 #define WRITE_EVENT 2 #define EXCEPT_EVENT 4 #define QUEUE_EVENT 8 #define DISCONNECT 0 #define CPROGRESS 1 #define POP_USER 10 #define POP_PASS 11 #define POP_TRANS 12 #define POP_MSG 13 #define SMTP_START 20 #define SMTP_USER 21 #define SMTP_MD5 22 #define SMTP_PASS 23 #define SMTP_TRANS 24 #define SMTP_MSG 25 #define NNTP_USER 30 #define NNTP_TRANS 31 #define NNTP_MSG 32 #define NNTP_LINE 33 #define NNTP_POSTMSG 34 #define DISC_EVENT 1 #define CONN_EVENT 2 #define RETR_EVENT 4 #define BUSY_EVENT 8 #define TIME_EVENT 16 #define SMTP_AUTH_NO 1 #define SMTP_AUTH_LOGIN 2 #define SMTP_AUTH_PLAIN 4 #define SMTP_AUTH_CRMD5 8 #define POP_AUTH_USER 1 #define POP_AUTH_APOP 2 typedef struct { long mess_num; long mess_size; char mess_stat; char mess_del; } tmess_t; typedef struct taddr { char *address; struct taddr *next; } taddr_t; typedef struct dbuf { char *data; int len; struct dbuf *next; } dbuf_t; typedef struct { int cr; int head; int ncan; int sock; int port; int state; int paclen; int maxframe; int event; int queue; int lpos; int lqueue; int nb_try; int nb_ret; int nb_lines; int lgcall; int mess_nb; int mess_cur; int disc_request; int quit_request; int auth_ok; int extra; long mess_tot; long timeout; char call[80]; char md5string[80]; taddr_t *mail_from; taddr_t *rcpt_to; taddr_t *content; indicat callsign; char *lbuf; dbuf_t *lsend; dbuf_t *msgbuf; tmess_t *mess; } tcan_t; typedef struct { int pop_fd; int smtp_fd; int nntp_fd; int rem_port; int curcan; int nbcan; int pop_auth; int smtp_auth; char rem_addr[80]; tcan_t *tcan; } tport_t; static tport_t tport[NBPORT]; static int stop_cnx (int port); static int s_free (tcan_t *); static int s_status (tcan_t *); static void clear_can (int port, int canal); static int pop_paclen (int port, int); static int pop_getline (int port, int can, char *buffer); static int pop_snd_dt (int port, int can, char *, int); static int pop_cmd (int port, int canal, char *cmd); static int pop_ini (int port, int canal, char *cmd); static int pop_stat (int port, int can, stat_ch *); static int pop_check_call (int port, int can, char *callsign, struct sockaddr_in *address); static int pop_check_pass (int port, int can, char *callsign); static int pop_send(int port, int canal, char *fmt, ...); static int pop_delete(int port, int canal); static int pop_process_read(int port, int canal, int *cmd, char *buffer, int nb); static int pop_to_bbs(int port, int canal, char *buffer, int clean); static int smtp_rcv_dt(int port, int can, char *buffer, int len); static int nntp_rcv_dt(int port, int can, char *buffer, int len); static char *base64_to_str(char *str); static char *str_to_base64(char *str); static int pop_quit(int port, int can); /*** pop commands ***/ static int pop_cmd_apop (int port, int can, char *buffer); static int pop_cmd_dele (int port, int can, char *buffer); static int pop_cmd_last (int port, int can, char *buffer); static int pop_cmd_list (int port, int can, char *buffer); static int pop_cmd_noop (int port, int can, char *buffer); static int pop_cmd_pass (int port, int can, char *buffer); static int pop_cmd_quit (int port, int can, char *buffer); static int pop_cmd_retr (int port, int can, char *buffer); static int pop_cmd_rset (int port, int can, char *buffer); static int pop_cmd_stat (int port, int can, char *buffer); static int pop_cmd_top (int port, int can, char *buffer); static int pop_cmd_uidl (int port, int can, char *buffer); static int pop_cmd_user (int port, int can, char *buffer); /*** smtp commands ***/ static int smtp_cmd_md5 (int port, int can, char *buffer); static int smtp_cmd_auth(int port, int can, char *buffer); static int smtp_cmd_data(int port, int can, char *buffer); static int smtp_cmd_ehlo(int port, int can, char *buffer); static int smtp_cmd_helo(int port, int can, char *buffer); static int smtp_cmd_mail(int port, int can, char *buffer); static int smtp_cmd_noop(int port, int can, char *buffer); static int smtp_cmd_pass(int port, int can, char *buffer, int base64); static int smtp_cmd_quit(int port, int can, char *buffer); static int smtp_cmd_rcpt(int port, int can, char *buffer); static int smtp_cmd_rset(int port, int can, char *buffer); static int smtp_cmd_user(int port, int can, char *buffer); static int smtp_cmd_vrfy(int port, int can, char *buffer); /*** nntp commands ***/ static int nntp_cmd_article(int port, int can, char *buffer); static int nntp_cmd_body(int port, int can, char *buffer); static int nntp_cmd_group(int port, int can, char *buffer); static int nntp_cmd_head(int port, int can, char *buffer); static int nntp_cmd_help(int port, int can, char *buffer); static int nntp_cmd_ihave(int port, int can, char *buffer); static int nntp_cmd_last(int port, int can, char *buffer); static int nntp_cmd_list(int port, int can, char *buffer); static int nntp_cmd_mode(int port, int can, char *buffer); static int nntp_cmd_newgroups(int port, int can, char *buffer); static int nntp_cmd_newnews(int port, int can, char *buffer); static int nntp_cmd_next(int port, int can, char *buffer); static int nntp_cmd_post(int port, int can, char *buffer); static int nntp_cmd_quit(int port, int can, char *buffer); static int nntp_cmd_slave(int port, int can, char *buffer); static int nntp_cmd_stat(int port, int can, char *buffer); static int nntp_cmd_xhdr(int port, int can, char *buffer); static int nntp_cmd_xover(int port, int can, char *buffer); static int nntp_cmd_authinfo(int port, int can, char *buffer); static char *INVALID_CMD = "-ERR Invalid command; valid commands:"; /* * Driver's generic functions. */ int snd_pop (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { switch (cmd) { case DATA: return pop_snd_dt (port, canal, buffer, len); } return 0; } /* receives data */ int rcv_pop (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { #define LGBUF 252 char buf[LGBUF + 2]; int can; /* int valid;*/ int res; int i; *cmd = INVCMD; /* valid = 0;*/ /* Checks if there is a POP connection */ res = 0; if (tport[*port].pop_fd) { tport[*port].tcan[0].sock = tport[*port].pop_fd; res = s_status (&tport[*port].tcan[0]); } if (res & READ_EVENT) { int new; int i; unsigned addr_len; struct sockaddr_in sock_addr; addr_len = sizeof (sock_addr); new = accept (tport[*port].pop_fd, (struct sockaddr *) &sock_addr, &addr_len); /* Assigns the new socket to an empty channel. */ for (i = 1; i <= tport[*port].nbcan; i++) { if (tport[*port].tcan[i].state == DISCONNECT) { break; } } if (i > tport[*port].nbcan) { /* If cannot assign the channel, then disconnect. */ sprintf (buf, "-ERR FBB POP3 server at %s - No free channel!\r\n", mycall); write (new, buf, strlen (buf)); close (new); } else { int val = 0; tport[*port].tcan[i].state = POP_USER; tport[*port].tcan[i].sock = new; tport[*port].tcan[i].paclen = (val == 0) ? 250 : val; tport[*port].tcan[i].queue = s_free (&tport[*port].tcan[i]); tport[*port].tcan[i].timeout = time (NULL) + 120L; sprintf (tport[*port].tcan[i].md5string, "<%d.%ld@%s>", getpid(), time(NULL), mypath); sprintf (buf, "+OK FBB POP3 server ready %s\r\n", tport[*port].tcan[i].md5string); write (new, buf, strlen (buf)); val = p_port[*port].pk_t; return (FALSE); } } /* Tests if there is a SMTP connection. */ res = 0; if (tport[*port].smtp_fd) { tport[*port].tcan[0].sock = tport[*port].smtp_fd; res = s_status (&tport[*port].tcan[0]); } if (res & READ_EVENT) { int new; int i; unsigned addr_len; struct sockaddr_in sock_addr; addr_len = sizeof (sock_addr); new = accept (tport[*port].smtp_fd, (struct sockaddr *) &sock_addr, &addr_len); /* Assigns the new socket to an empty channel. */ for (i = 1; i <= tport[*port].nbcan; i++) { if (tport[*port].tcan[i].state == DISCONNECT) { break; } } if (i > tport[*port].nbcan) { /* If cannot assign the channel, then disconnects. */ sprintf (buf, "421 FBB SMTP server at %s - No free channel!\r\n", mypath); write (new, buf, strlen (buf)); close (new); } else { int val = 0; tport[*port].tcan[i].state = SMTP_START; tport[*port].tcan[i].sock = new; tport[*port].tcan[i].paclen = (val == 0) ? 250 : val; tport[*port].tcan[i].queue = s_free (&tport[*port].tcan[i]); tport[*port].tcan[i].timeout = time (NULL) + 120L; /* sprintf (buf, "220 FBB SMTP server ready at %s\r\n", mypath); */ sprintf (buf, "220 FBB ESMTP server ready at %s\r\n", mypath); write (new, buf, strlen (buf)); val = p_port[*port].pk_t; return (FALSE); } } /* Checks if there is a NNTP connection. */ res = 0; if (tport[*port].nntp_fd) { tport[*port].tcan[0].sock = tport[*port].nntp_fd; res = s_status (&tport[*port].tcan[0]); } if (res & READ_EVENT) { int new; unsigned addr_len; struct sockaddr_in sock_addr; addr_len = sizeof (sock_addr); new = accept (tport[*port].nntp_fd, (struct sockaddr *) &sock_addr, &addr_len); /* Assign the new socket to an empty channel. */ for (i = 1; i <= tport[*port].nbcan; i++) { if (tport[*port].tcan[i].state == DISCONNECT) { break; } } if (i > tport[*port].nbcan) { /* If cannot assign the channel, then disconnect. */ sprintf (buf, "400 FBB NNTP server at %s - No free channel!\r\n", mypath); write (new, buf, strlen (buf)); close (new); } else { int val = 0; tport[*port].tcan[i].state = NNTP_USER; tport[*port].tcan[i].sock = new; tport[*port].tcan[i].paclen = (val == 0) ? 250 : val; tport[*port].tcan[i].queue = s_free (&tport[*port].tcan[i]); tport[*port].tcan[i].timeout = time (NULL) + 120L; sprintf (buf, "201 FBB NNTP server ready at %s\r\n", mypath); write (new, buf, strlen (buf)); val = p_port[*port].pk_t; if (tport[*port].tcan[i].state == NNTP_USER) { int nb; /* Connection */ nb = sprintf (buffer, "(%d) CONNECTED to %s", i, mycall); tport[*port].tcan[i].state = NNTP_TRANS; *len = nb; *cmd = COMMAND; *canal = i; return (TRUE); } return (FALSE); } } for (i = 1 ; i <= tport[*port].nbcan ; i++) { /* Next channel for polling */ ++tport[*port].curcan; if (tport[*port].curcan > tport[*port].nbcan) tport[*port].curcan = 1; can = tport[*port].curcan; if (tport[*port].tcan[can].lsend) { int nb = 0; dbuf_t *buf = tport[*port].tcan[can].lsend; /* for (;;) */ { memcpy(buffer+nb, buf->data, buf->len); nb += buf->len; tport[*port].tcan[can].lsend = buf->next; free (buf->data); free (buf); /* buf = tport[*port].tcan[can].lsend; if (buf == NULL) break; if ((nb + buf->len) > RCV_BUFFER_SIZE) break; */ } *len = nb; *cmd = DATA; *canal = can; return (TRUE); } if ((tport[*port].tcan[can].sock == -1) && (tport[*port].tcan[can].state != DISCONNECT)) { tport[*port].tcan[can].disc_request = 1; } if (tport[*port].tcan[can].disc_request) { sprintf (buffer, "(%d) DISCONNECTED fm server", can); tport[*port].tcan[can].state = DISCONNECT; clear_can (*port, can); *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } /* Communication channel */ res = s_status (&tport[*port].tcan[can]); if (res & TIME_EVENT) { int nb; /* pop_send(*port, can, "-ERR time-out %s POP3 Server shutdown.\r\n", mycall); close (tport[*port].tcan[can].sock); clear_can (*port, can); */ strcpy(buffer, "QUIT\r"); // nb = pop_process_read(*port, can, cmd, buffer, strlen(buffer)); nb = pop_quit(*port, can); if (nb > 0) { *len = nb; *cmd = COMMAND; *canal = can; return TRUE; } return (FALSE); } if (res & WRITE_EVENT) { /* Can write to the socket... Unused */ } if (res & EXCEPT_EVENT) { } #define LGTCP 1100 if ((res & QUEUE_EVENT) || (res & READ_EVENT)) { int nb = 0; if (tport[*port].tcan[can].sock == -1) { printf ("read on invalid socket\n"); return (FALSE); } /* Allocates buffer if necessary */ if (tport[*port].tcan[can].lbuf == NULL) { tport[*port].tcan[can].lbuf = calloc (LGTCP, 1); tport[*port].tcan[can].lpos = 0; tport[*port].tcan[can].lqueue = 0; tport[*port].tcan[can].nb_ret = 0; } if (res & READ_EVENT) { int qlen = tport[*port].tcan[can].lqueue; /* Some room left in buffer ? */ nb = ((LGTCP - qlen) > 256) ? 256 : LGTCP - qlen; if (nb) { nb = read (tport[*port].tcan[can].sock, buffer, nb); if ((nb == 0) || ((nb == -1) && (errno == ENOTCONN))) { /* tport[*port].tcan[can].disc_request = 1; */ int nb; close(tport[*port].tcan[can].sock); tport[*port].tcan[can].sock = -1; strcpy(buffer, "QUIT\r"); // nb = pop_process_read(*port, can, cmd, buffer, strlen(buffer)); nb = pop_quit(*port, can); if (nb > 0) { *len = nb; *cmd = COMMAND; *canal = can; return TRUE; } return (FALSE); } else if (nb == -1) { printf ("errno = %d\n", errno); perror ("read"); return (FALSE); } } if (nb > 0) { nb = pop_process_read(*port, can, cmd, buffer, nb); if (nb > 0) { *len = nb; *cmd = COMMAND; *canal = can; return TRUE; } } } } } return (FALSE); } /* Open port */ int opn_pop (int port, int nb) { int i; int val; int len; int ok = TRUE; char s[80]; struct sockaddr_in sock_addr; char *ptr; int pop_port = 0; int smtp_port = 0; int nntp_port = 0; sprintf (s, "Init PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); sock_addr.sin_family = AF_INET; sock_addr.sin_addr.s_addr = 0; /* Test if portname is hex number */ ptr = p_com[(int) p_port[port].ccom].name; if (strcmp (ptr, "0") == 0) { pop_port = p_com[(int) p_port[port].ccom].port; } else if (strspn (ptr, ":0123456789abcdefABCDEF") != strlen (ptr)) { /* It may be tcp address. Port number is in port */ if (inet_aton (ptr, &sock_addr.sin_addr)) pop_port = p_com[(int) p_port[port].ccom].port; else pop_port = p_com[(int) p_port[port].ccom].cbase; } else { sscanf (p_com[(int) p_port[port].ccom].name, "%x:%x:%x", &pop_port, &smtp_port, &nntp_port); } sprintf (s, "Init PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); tport[port].tcan = (tcan_t *)calloc(nb+1, sizeof(tcan_t)); if (tport[port].tcan == NULL) return 0; tport[port].pop_auth = POP_AUTH_USER; tport[port].smtp_auth = SMTP_AUTH_NO; // SMTP_AUTH_LOGIN|SMTP_AUTH_PLAIN; // auth_login does seem to work okay. It would prevent Spammers from sending messages. NOTE: The code currently does work, and you can specify a command in inittnc*.sys. Just the default is now set to no password. tport[port].curcan = 1; tport[port].nbcan = nb; for (i = 0 ; i <= nb ; i++) clear_can(port, i); /* Socket for receiving calls. */ if (tport[port].pop_fd == 0) { sprintf (s, "Open PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); sleep (1); if (pop_port) { /* POP socket */ sock_addr.sin_port = htons (pop_port); if ((tport[port].pop_fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } val = 1; len = sizeof (val); if (setsockopt (tport[port].pop_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &val, len) == -1) { perror ("opn_pop : setsockopt SO_REUSEADDR"); } if (bind (tport[port].pop_fd, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("opn_pop : bind"); close (tport[port].pop_fd); tport[port].pop_fd = -1; return (0); } if (listen (tport[port].pop_fd, SOMAXCONN) == -1) { perror ("listen"); close (tport[port].pop_fd); tport[port].pop_fd = -1; return (0); } } if (nntp_port) { /* NNTP socket */ sock_addr.sin_port = htons (nntp_port); if ((tport[port].nntp_fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } val = 1; len = sizeof (val); if (setsockopt (tport[port].nntp_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &val, len) == -1) { perror ("opn_pop : setsockopt SO_REUSEADDR"); } if (bind (tport[port].nntp_fd, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("opn_pop : bind"); close (tport[port].nntp_fd); tport[port].nntp_fd = -1; return (0); } if (listen (tport[port].nntp_fd, SOMAXCONN) == -1) { perror ("listen"); close (tport[port].nntp_fd); tport[port].nntp_fd = -1; return (0); } } if (smtp_port) { /* SMTP socket */ sock_addr.sin_port = htons (smtp_port); if ((tport[port].smtp_fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } val = 1; len = sizeof (val); if (setsockopt (tport[port].smtp_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &val, len) == -1) { perror ("opn_pop : setsockopt SO_REUSEADDR"); } if (bind (tport[port].smtp_fd, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("opn_pop : bind"); close (tport[port].smtp_fd); tport[port].smtp_fd = -1; return (0); } if (listen (tport[port].smtp_fd, SOMAXCONN) == -1) { perror ("listen"); close (tport[port].smtp_fd); tport[port].smtp_fd = -1; return (0); } } memset (&tport[port].tcan[0], 0, sizeof (tcan_t)); } sprintf (s, "Prog PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); return (ok); } /* Close port */ int cls_pop (int port) { int i; for (i = 1; i <= tport[port].nbcan; i++) { if (tport[port].tcan[i].sock != -1) { close (tport[port].tcan[i].sock); } tport[port].tcan[i].state = DISCONNECT; } if (tport[port].pop_fd) { close (tport[port].pop_fd); tport[port].pop_fd = 0; } if (tport[port].smtp_fd) { close (tport[port].smtp_fd); tport[port].smtp_fd = 0; } free(tport[port].tcan); return (1); } int sta_pop (int port, int canal, int cmd, void *ptr) { switch (cmd) { case TNCSTAT: return (pop_stat (port, canal, (stat_ch *) ptr)); case PACLEN: *((int *) ptr) = pop_paclen (port, canal); return (1); case PORTCMD: return (pop_ini (port, canal, (char *) ptr)); case SNDCMD: return (pop_cmd (port, canal, (char *) ptr)); case SETBUSY: return stop_cnx (port); } return 0; } /********************************************************************/ static void free_address(int port, int can) { taddr_t *head; taddr_t *curr; head = tport[port].tcan[can].mail_from; while (head) { curr = head; head = head->next; if (curr->address) free(curr->address); free(curr); } head = tport[port].tcan[can].rcpt_to; while (head) { curr = head; head = head->next; if (curr->address) free(curr->address); free(curr); } head = tport[port].tcan[can].content; while (head) { curr = head; head = head->next; if (curr->address) free(curr->address); free(curr); } tport[port].tcan[can].rcpt_to = NULL; tport[port].tcan[can].mail_from = NULL; tport[port].tcan[can].content = NULL; } static int pop_quit(int port, int can) // The old code of sending QUIT caused crashes, and seemed unnecessarily complicated. Let's just force the quit routine directly { char buffer[6]; strcpy(buffer, "QUIT\r"); switch (tport[port].tcan[can].state) { case NNTP_USER: case NNTP_TRANS: case NNTP_POSTMSG: nntp_cmd_quit(port, can, buffer); break; case SMTP_START: case SMTP_USER: case SMTP_MD5: case SMTP_PASS: case SMTP_TRANS: case SMTP_MSG: smtp_cmd_quit(port, can, buffer); break; case POP_USER: case POP_PASS: case POP_TRANS: pop_cmd_quit(port, can, buffer); break; default: break; } return 0; } static int pop_process_read(int port, int can, int *cmd, char *buffer, int nb) { int i; int pos; char *ptr; buffer[nb] = '\0'; pos = tport[port].tcan[can].lpos + tport[port].tcan[can].lqueue; if (pos >= LGTCP) pos -= LGTCP; ptr = tport[port].tcan[can].lbuf; for (i = 0; i < nb; i++) { if (tport[port].tcan[can].lqueue > (LGTCP - 10)) { ++tport[port].tcan[can].nb_ret; break; } ptr[pos] = buffer[i]; if (++pos == LGTCP) pos = 0; ++tport[port].tcan[can].lqueue; if (buffer[i] == '\r') { ++tport[port].tcan[can].nb_ret; } } while (tport[port].tcan[can].nb_ret > 0) { /* nb = tport[port].tcan[can].lqueue; if (tport[port].tcan[can].nb_ret <= 0) break; */ tport[port].tcan[can].timeout = time (NULL) + 120L; switch (tport[port].tcan[can].state) { case NNTP_USER: case NNTP_TRANS: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); if (strncmpi(buffer, "QUIT", 4) == 0) { nntp_cmd_quit(port, can, buffer); } else if (strncmpi(buffer, "ARTICLE", 7) == 0) { nntp_cmd_article(port, can, buffer); } else if (strncmpi(buffer, "BODY", 4) == 0) { nntp_cmd_body(port, can, buffer); } else if (strncmpi(buffer, "GROUP", 5) == 0) { nntp_cmd_group(port, can, buffer); } else if (strncmpi(buffer, "HEAD", 4) == 0) { nntp_cmd_head(port, can, buffer); } else if (strncmpi(buffer, "HELP", 4) == 0) { nntp_cmd_help(port, can, buffer); } else if (strncmpi(buffer, "IHAVE", 5) == 0) { nntp_cmd_ihave(port, can, buffer); } else if (strncmpi(buffer, "LAST", 4) == 0) { nntp_cmd_last(port, can, buffer); } else if (strncmpi(buffer, "LIST", 4) == 0) { nntp_cmd_list(port, can, buffer); } else if (strncmpi(buffer, "MODE", 4) == 0) { nntp_cmd_mode(port, can, buffer); } else if (strncmpi(buffer, "NEWGROUPS", 9) == 0) { nntp_cmd_newgroups(port, can, buffer); } else if (strncmpi(buffer, "NEWNEWS", 7) == 0) { nntp_cmd_newnews(port, can, buffer); } else if (strncmpi(buffer, "NEXT", 4) == 0) { nntp_cmd_next(port, can, buffer); } else if (strncmpi(buffer, "POST", 4) == 0) { nntp_cmd_post(port, can, buffer); } else if (strncmpi(buffer, "SLAVE", 5) == 0) { nntp_cmd_slave(port, can, buffer); } else if (strncmpi(buffer, "STAT", 4) == 0) { nntp_cmd_stat(port, can, buffer); } else if (strncmpi(buffer, "XHDR", 4) == 0) { nntp_cmd_xhdr(port, can, buffer); } else if (strncmpi(buffer, "XOVER", 5) == 0) { nntp_cmd_xover(port, can, buffer); } else if (strncmpi(buffer, "AUTHINFO", 8) == 0) { nntp_cmd_authinfo(port, can, buffer); } else if (*buffer != '\0') { pop_send(port, can, "500 Unknown command\r\n"); } break; case NNTP_POSTMSG: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); nntp_rcv_dt(port, can, buffer, strlen(buffer)); break; case SMTP_START: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); if (strncmpi(buffer, "QUIT", 4) == 0) { smtp_cmd_quit(port, can, buffer); } else if (strncmpi(buffer, "EHLO", 4) == 0) { return smtp_cmd_ehlo(port, can, buffer); } else if (strncmpi(buffer, "HELO", 4) == 0) { return smtp_cmd_helo(port, can, buffer); } else if (*buffer != '\0') { pop_send(port, can, "502 Unknown command\r\n",INVALID_CMD); } break; case SMTP_USER: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); smtp_cmd_user(port, can, buffer); break; case SMTP_MD5: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); smtp_cmd_md5(port, can, buffer); break; case SMTP_PASS: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); smtp_cmd_pass(port, can, buffer, 1); break; case SMTP_TRANS: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); if (strncmpi(buffer, "QUIT", 4) == 0) { smtp_cmd_quit(port, can, buffer); } else if (strncmpi(buffer, "AUTH", 4) == 0) { return smtp_cmd_auth(port, can, buffer); } else if (strncmpi(buffer, "MAIL FROM:", 10) == 0) { smtp_cmd_mail(port, can, buffer); } else if (strncmpi(buffer, "RCPT TO:", 8) == 0) { smtp_cmd_rcpt(port, can, buffer); } else if (strncmpi(buffer, "NOOP", 4) == 0) { smtp_cmd_noop(port, can, buffer); } else if (strncmpi(buffer, "RSET", 4) == 0) { smtp_cmd_rset(port, can, buffer); } else if (strncmpi(buffer, "DATA", 4) == 0) { smtp_cmd_data(port, can, buffer); } else if (strncmpi(buffer, "VRFY", 4) == 0) { smtp_cmd_vrfy(port, can, buffer); } else if (*buffer != '\0') { pop_send(port, can, "502 Unknown command\r\n",INVALID_CMD); } break; case SMTP_MSG: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); smtp_rcv_dt(port, can, buffer, strlen(buffer)); break; case POP_USER: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); if (strncmpi(buffer, "QUIT", 4) == 0) { pop_cmd_quit(port, can, buffer); } else if ((tport[port].pop_auth & POP_AUTH_USER) && (strncmpi(buffer, "USER", 4) == 0)) { pop_cmd_user(port, can, buffer); } else if ((tport[port].pop_auth & POP_AUTH_APOP) && (strncmpi(buffer, "APOP", 4) == 0)) { return pop_cmd_apop(port, can, buffer); } else if (*buffer != '\0') { pop_send(port, can, "%s USER, APOP or QUIT\r\n",INVALID_CMD); } break; case POP_PASS: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); if (strncmpi(buffer, "QUIT", 4) == 0) { pop_cmd_quit(port, can, buffer); } else if (strncmpi(buffer, "PASS", 4) == 0) { return pop_cmd_pass(port, can, buffer); } else if (*buffer != '\0') { pop_send(port, can, "%s PASS, QUIT\r\n",INVALID_CMD); } break; case POP_TRANS: if (!pop_getline (port, can, buffer)) break; sup_ln (buffer); if (strncmpi(buffer, "QUIT", 4) == 0) { pop_cmd_quit(port, can, buffer); } else if (strncmpi(buffer, "LIST", 4) == 0) { pop_cmd_list(port, can, buffer); } else if (strncmpi(buffer, "LAST", 4) == 0) { pop_cmd_last(port, can, buffer); } else if (strncmpi(buffer, "DELE", 4) == 0) { pop_cmd_dele(port, can, buffer); } else if (strncmpi(buffer, "NOOP", 4) == 0) { pop_cmd_noop(port, can, buffer); } else if (strncmpi(buffer, "RETR", 4) == 0) { pop_cmd_retr(port, can, buffer); } else if (strncmpi(buffer, "RSET", 4) == 0) { pop_cmd_rset(port, can, buffer); } else if (strncmpi(buffer, "STAT", 4) == 0) { pop_cmd_stat(port, can, buffer); } else if (strncmpi(buffer, "TOP", 3) == 0) { pop_cmd_top(port, can, buffer); } else if (strncmpi(buffer, "UIDL", 4) == 0) { pop_cmd_uidl(port, can, buffer); } else if (*buffer != '\0') { pop_send(port, can, "%s DELE, LAST, LIST, NOOP, RETR, RSET, STAT, TOP, UIDL or QUIT\r\n",INVALID_CMD); } break; default: close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; tport[port].tcan[can].lqueue = 0; tport[port].tcan[can].nb_ret = 0; break; } } return (0); } static int stop_cnx (int port) { if (tport[port].pop_fd) { close(tport[port].pop_fd); tport[port].pop_fd = 0; } if (tport[port].smtp_fd) { close(tport[port].smtp_fd); tport[port].smtp_fd = 0; } return 1; } static int pop_check_call (int port, int can, char *callsign, struct sockaddr_in *address) { int res = 0; tport[port].tcan[can].callsign.num = extind (callsign, tport[port].tcan[can].callsign.call); if (find (tport[port].tcan[can].callsign.call)) { if (chercoord (tport[port].tcan[can].callsign.call) != 0xffff) res = 1; else res = 2; } /* Authorized address ? - To be written... */ if (address) { } return (res); } static int pop_check_pass (int port, int can, char *passwd) { unsigned record; record = chercoord (tport[port].tcan[can].callsign.call); if (record != 0xffff) { FILE *fptr; info frec; fptr = ouvre_nomenc (); fseek (fptr, ((long) record * sizeof (info)), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 92); if (strcmpi (passwd, frec.pass) == 0) { return (TRUE); } } return (FALSE); } static int pop_check_md5 (int port, int can, char *passwd) { unsigned record; record = chercoord (tport[port].tcan[can].callsign.call); if (record != 0xffff) { uchar source[300]; uchar dest[80]; uchar pass[80]; FILE *fptr; info frec; fptr = ouvre_nomenc (); fseek (fptr, ((long) record * sizeof (info)), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 92); strcpy(pass, frec.pass); /* try with recorded password */ strcpy(source, tport[port].tcan[can].md5string); strcat(source, pass); MD5String (dest, source); if (strcmpi (passwd, dest) == 0) { return (TRUE); } /* try with password in lower case */ strcpy(source, tport[port].tcan[can].md5string); strlwr(pass); strcat(source, pass); MD5String (dest, source); if (strcmpi (passwd, dest) == 0) { return (TRUE); } } return (FALSE); } static int pop_snd_dt (int port, int canal, char *buffer, int len) { int i; int cr; int head; int nb_lines; /* int num; */ char *ptr; char buf[600]; if (tport[port].tcan[canal].sock == -1) return (FALSE); if (tport[port].tcan[canal].state == NNTP_LINE) { ptr = strchr(buffer, '\r'); if (ptr) *ptr = '\0'; pop_send(port, canal, "%s\r\n", buffer); tport[port].tcan[canal].state = NNTP_TRANS; } else if (tport[port].tcan[canal].state == NNTP_MSG) { cr = tport[port].tcan[canal].cr; head = tport[port].tcan[canal].head; nb_lines = tport[port].tcan[canal].nb_lines; for (ptr = buf, i = 0; i < len; i++) { if (buffer[i] == '\033') { pop_send(port, canal, ".\r\n"); tport[port].tcan[canal].state = NNTP_TRANS; return 1; } if (buffer[i] == '\032') { tport[port].tcan[canal].state = NNTP_TRANS; return 1; } if (cr && buffer[i] == '.') *ptr++ = '.'; *ptr++ = buffer[i]; if (buffer[i] == '\r') { *ptr++ = '\n'; *ptr = '\0'; if (head == 0 && nb_lines != 1) { /* Mode = 2 : No headers */ pop_send(port, canal, "%s", buf); } if (head == 1 && nb_lines != 2) { /* Mode = 1 : Only headers */ pop_send(port, canal, "%s", buf); } if (cr) { /* Empty line -> End of headers */ head = 0; } ptr = buf; cr = 1; } else { cr = 0; } } *ptr = '\0'; if (*buf) pop_send(port, canal, "%s", buf); tport[port].tcan[canal].cr = cr; tport[port].tcan[canal].head = head; } else if (tport[port].tcan[canal].state == POP_MSG) { cr = tport[port].tcan[canal].cr; head = tport[port].tcan[canal].head; /* num = tport[port].tcan[canal].mess_cur;*/ nb_lines = tport[port].tcan[canal].nb_lines; for (ptr = buf, i = 0; i < len; i++) { if (buffer[i] == '\033') { pop_send(port, canal, ".\r\n"); tport[port].tcan[canal].state = POP_TRANS; return 1; } if (cr && buffer[i] == '.') *ptr++ = '.'; *ptr++ = buffer[i]; if (buffer[i] == '\r') { if (cr) { /* Empty line -> End of headers */ head = 0; } *ptr++ = '\n'; *ptr = '\0'; pop_send(port, canal, "%s", buf); ptr = buf; cr = 1; if (head == 0 && nb_lines-- == 0) { pop_send(port, canal, ".\r\n"); tport[port].tcan[canal].state = POP_TRANS; return 1; } } else { cr = 0; } } *ptr = '\0'; if (*buf) pop_send(port, canal, "%s", buf); tport[port].tcan[canal].cr = cr; tport[port].tcan[canal].head = head; tport[port].tcan[canal].nb_lines = nb_lines; } return 1; } static int pop_send(int port, int canal, char *fmt, ...) { char *buf; // Size was 1200. This was crashing. va_list argptr; if (tport[port].tcan[canal].sock != -1) { int len; va_start (argptr, fmt); len = vsnprintf(0, 0, fmt, argptr); // Return the length of the string va_end (argptr); if (len < 0)return 0; buf = malloc(len+1); va_start (argptr, fmt); vsnprintf (buf,len+1, fmt, argptr); va_end (argptr); //if (1) I think it's best not to touch encoding. Firefox can read and send 850 if needed. This conversion just causes things to break // ibm_to_ansi(buf, strlen(buf)); write (tport[port].tcan[canal].sock, buf, strlen (buf)); free(buf); return 1; } return 0; } static int pop_ini (int port, int canal, char *cmd) { char *ptr; ptr = strtok(cmd, " \t"); if (ptr == NULL) return 0; switch (*ptr) { case 'S': /* SMTP configuration */ ptr = strtok(NULL, " \t"); if (strcmpi(ptr, "AUTH") == 0) { tport[port].smtp_auth = 0; while ((ptr = strtok(NULL, " \t")) != NULL) { if (strcmpi(ptr, "NO") == 0) tport[port].smtp_auth |= SMTP_AUTH_NO; else if (strcmpi(ptr, "LOGIN") == 0) tport[port].smtp_auth |= SMTP_AUTH_LOGIN; else if (strcmpi(ptr, "PLAIN") == 0) tport[port].smtp_auth |= SMTP_AUTH_PLAIN; else if (strcmpi(ptr, "CRAM-MD5") == 0) tport[port].smtp_auth |= SMTP_AUTH_CRMD5; } if (tport[port].smtp_auth == 0) tport[port].smtp_auth = SMTP_AUTH_NO; } break; case 'P': /* POP configuration */ ptr = strtok(NULL, " \t"); if (strcmpi(ptr, "AUTH") == 0) { tport[port].pop_auth = 0; while ((ptr = strtok(NULL, " \t")) != NULL) { if (strcmpi(ptr, "USER") == 0) tport[port].pop_auth |= POP_AUTH_USER; else if (strcmpi(ptr, "APOP") == 0) tport[port].pop_auth |= POP_AUTH_APOP; } if (tport[port].pop_auth == 0) tport[port].pop_auth |= POP_AUTH_USER; } break; } return (0); } static int pop_cmd (int port, int canal, char *cmd) { int i; char status; long nb, size; switch (*cmd++) { case 'D': close (tport[port].tcan[canal].sock); tport[port].tcan[canal].sock = -1; break; case 'S': /* Message information */ sscanf(cmd, "%ld", &nb); tport[port].tcan[canal].mess_nb = nb; tport[port].tcan[canal].mess_cur = 0; tport[port].tcan[canal].mess_tot = 0L; tport[port].tcan[canal].mess = malloc(sizeof(tmess_t) * nb); break; case 'M': if (tport[port].tcan[canal].state != POP_TRANS) break; /* Message list */ nb = 0; sscanf(cmd, "%ld %ld %c", &nb, &size, &status); if (nb == 0) { /* End of list */ pop_send(port, canal, "+OK connected to %s BBS %d messages (%ld bytes)\r\n", tport[port].tcan[canal].callsign.call, tport[port].tcan[canal].mess_nb, tport[port].tcan[canal].mess_tot); } i = tport[port].tcan[canal].mess_cur; if (i < tport[port].tcan[canal].mess_nb) { tport[port].tcan[canal].mess_tot += size; tport[port].tcan[canal].mess[i].mess_num = nb; tport[port].tcan[canal].mess[i].mess_size = size; tport[port].tcan[canal].mess[i].mess_stat = status; tport[port].tcan[canal].mess[i].mess_del = 0; tport[port].tcan[canal].mess_cur = i+1; } break; } return (0); } static int pop_stat (int port, int canal, stat_ch * ptr) { int val; if ((canal == 0) || (tport[port].tcan[canal].sock == -1)) return (0); ptr->mem = 100; val = s_free (&tport[port].tcan[canal]); ptr->ack = 0; if (tport[port].tcan[canal].state == POP_MSG || tport[port].tcan[canal].state == SMTP_MSG || tport[port].tcan[canal].state == NNTP_MSG || tport[port].tcan[canal].state == NNTP_POSTMSG) { ptr->ack = (tport[port].tcan[canal].queue - val) / tport[port].tcan[canal].paclen; if ((tport[port].tcan[canal].queue - val) && (ptr->ack == 0)) ptr->ack = 1; } return (1); } static int s_status (tcan_t * can) { int nb; int res = 0; fd_set tcp_read; fd_set tcp_write; fd_set tcp_excep; struct timeval to; if (can->sock == -1) return (0); if ((can->timeout) && (can->timeout < time (NULL))) { res |= TIME_EVENT; can->timeout = 0L; return (res); } if (can->lqueue) { res |= QUEUE_EVENT; } to.tv_sec = to.tv_usec = 0; can->event = 0; FD_ZERO (&tcp_read); FD_ZERO (&tcp_write); FD_ZERO (&tcp_excep); FD_SET (can->sock, &tcp_read); FD_SET (can->sock, &tcp_write); FD_SET (can->sock, &tcp_excep); nb = select (can->sock + 1, &tcp_read, &tcp_write, &tcp_excep, &to); if (nb == -1) { perror ("select"); return (res); } else if (nb == 0) { return (res); } else { if (FD_ISSET (can->sock, &tcp_read)) { res |= READ_EVENT; } if (FD_ISSET (can->sock, &tcp_write)) { res |= WRITE_EVENT; } if (FD_ISSET (can->sock, &tcp_excep)) { res |= EXCEPT_EVENT; } } return (res); } /* Copies a line in the buffer. */ static int pop_getline (int port, int can, char *buffer) { int i = 0; int c; int pos; char *ptr; pos = tport[port].tcan[can].lpos; ptr = tport[port].tcan[can].lbuf; while (tport[port].tcan[can].lqueue > 0) { c = ptr[pos]; if (++pos == LGTCP) pos = 0; --tport[port].tcan[can].lqueue; if (c != '\n') buffer[i++] = c; if (c == '\r') { --tport[port].tcan[can].nb_ret; break; } } buffer[i] = '\0'; tport[port].tcan[can].lpos = pos; if (tport[port].tcan[can].lqueue == 0) tport[port].tcan[can].nb_ret = 0; return (i); } static void free_lsend(int port, int canal) { dbuf_t *buf; while ((buf = tport[port].tcan[canal].lsend) != NULL) { tport[port].tcan[canal].lsend = buf->next; free(buf->data); free(buf); } } static void free_msgbuf(int port, int canal) { dbuf_t *buf; while ((buf = tport[port].tcan[canal].msgbuf) != NULL) { tport[port].tcan[canal].msgbuf = buf->next; free(buf->data); free(buf); } } static int pop_to_bbs(int port, int canal, char *buf, int clean) { dbuf_t *cur; dbuf_t *sbuf; if (clean) free_lsend(port, canal); cur = malloc(sizeof(dbuf_t)); if (cur == NULL) return 0; cur->len = strlen(buf); cur->data = strdup(buf); cur->next = NULL; sbuf = tport[port].tcan[canal].lsend; if (sbuf) { /* Append to last buffer */ while (sbuf->next != NULL) sbuf = sbuf->next; sbuf->next = cur; } else { tport[port].tcan[canal].lsend = cur; } return 1; } static int pop_delete(int port, int canal) { int i; int nb = 0; char num[80]; char buf[80]; if (tport[port].tcan[canal].disc_request) return 0; strcpy(buf, "K"); for (i = 0 ; i < tport[port].tcan[canal].mess_nb ; i++) { if (tport[port].tcan[canal].mess[i].mess_del) { sprintf(num, " %ld", tport[port].tcan[canal].mess[i].mess_num); strcat(buf, num); if ((++nb % 4) == 0) { strcat(buf, "\r"); pop_to_bbs(port, canal, buf, 0); strcpy(buf, "K"); nb = 0; } } } if (nb > 0) { strcat(buf, "\r"); pop_to_bbs(port, canal, buf, 0); } return 1; } static int pop_paclen (int port, int canal) { if (tport[port].tcan[canal].sock == -1) return (0); return (tport[port].tcan[canal].paclen); } static int s_free (tcan_t * can) { int queue_free; if (ioctl (can->sock, TIOCOUTQ, &queue_free) == -1) { perror ("ioctl : TIOCOUTQ"); return (0); } return (queue_free); } static void clear_can (int port, int canal) { free_address(port, canal); if (tport[port].tcan[canal].lbuf) free (tport[port].tcan[canal].lbuf); if (tport[port].tcan[canal].lsend) free_lsend(port, canal); if (tport[port].tcan[canal].msgbuf) free_msgbuf(port, canal); if (tport[port].tcan[canal].mess) free(tport[port].tcan[canal].mess); memset (&tport[port].tcan[canal], 0, sizeof (tcan_t)); tport[port].tcan[canal].sock = -1; tport[port].tcan[canal].state = DISCONNECT; } /* * POP commands processing ** */ /* Check the given # msg in a pop command */ static int check_num (int port, int can, int num) { if (num < 1 || num > tport[port].tcan[can].mess_nb) { pop_send(port, can, "-ERR invalid message; number out of range.\r\n"); return 0; } if (tport[port].tcan[can].mess[num-1].mess_del) { pop_send(port, can, "-ERR message %d has been marked for deletion.\r\n", num); return 0; } return 1; } static int pop_cmd_quit(int port, int can, char *buffer) { if (tport[port].tcan[can].quit_request) return 0; tport[port].tcan[can].quit_request = 1; /* Received "QUIT" : disconnect */ if (tport[port].tcan[can].state != POP_USER) { pop_delete(port, can); pop_to_bbs(port, can, "B\r", 0); } else { close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; } pop_send(port, can, "+OK %s POP3 Server shutdown.\r\n", mycall); return 0; } static int pop_cmd_list (int port, int can, char *buffer) { int i; int nb; char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; if (*ptr) { nb = atoi(ptr); if (check_num(port, can, nb)) pop_send(port, can, "+OK %d %ld\r\n", nb, tport[port].tcan[can].mess[nb-1].mess_size); return 1; } pop_send(port, can, "+OK %d messages (%ld bytes).\r\n", tport[port].tcan[can].mess_nb, tport[port].tcan[can].mess_tot); for (i = 0 ; i < tport[port].tcan[can].mess_nb ; i++) { if (tport[port].tcan[can].mess[i].mess_del == 0) pop_send(port, can, "%ld %ld \r\n", i+1, tport[port].tcan[can].mess[i].mess_size); } pop_send(port, can, ".\r\n"); return 0; } static int pop_cmd_uidl (int port, int can, char *buffer) { int i; int nb; char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; if (*ptr) { nb = atoi(ptr); if (check_num(port, can, nb)) pop_send(port, can, "+OK %d %s\r\n", nb, xuidl(tport[port].tcan[can].mess[nb-1].mess_num, mycall)); return 1; } pop_send(port, can, "+OK uidl command accepted.\r\n"); for (i = 0 ; i < tport[port].tcan[can].mess_nb ; i++) { if (tport[port].tcan[can].mess[i].mess_del == 0) pop_send(port, can, "%ld %s\r\n", i+1, xuidl(tport[port].tcan[can].mess[i].mess_num, mycall)); } pop_send(port, can, ".\r\n"); return 0; } static int pop_cmd_user (int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; strn_cpy(6, tport[port].tcan[can].callsign.call, ptr); tport[port].tcan[can].state = POP_PASS; pop_send(port, can, "+OK please send PASS command\r\n"); return 0; } static int pop_cmd_pass (int port, int can, char *buffer) { int ok = 0; char *ptr = buffer + 4; char *callsign = tport[port].tcan[can].callsign.call; unsigned addr_len; struct sockaddr_in *address; struct sockaddr_in sock_addr; while (isspace(*ptr)) ++ptr; addr_len = sizeof (sock_addr); if ((getpeername(tport[port].tcan[can].sock, (struct sockaddr *)&sock_addr, &addr_len) == 0) && (sock_addr.sin_family == AF_INET)) address = &sock_addr; else address = NULL; // Check login switch (pop_check_call (port, can, callsign, address)) { case 1: // Check password if (pop_check_pass (port, can, ptr)) { sprintf (buffer, "(%d) CONNECTED to %s-%d", can, tport[port].tcan[can].callsign.call, tport[port].tcan[can].callsign.num); tport[port].tcan[can].state = POP_TRANS; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return (strlen (buffer)); } break; default: break; } if (ok == 0) { pop_send(port, can, "-ERR invalid usercode or password, please try later\r\n"); close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; } return 0; } static int pop_cmd_apop (int port, int can, char *buffer) { int ok = 0; char *ptr = buffer + 4; char *callsign; unsigned addr_len; struct sockaddr_in *address; struct sockaddr_in sock_addr; while (isspace(*ptr)) ++ptr; callsign = ptr; while (*ptr && !isspace(*ptr)) ++ptr; if (*ptr == '\0') { pop_send(port, can, "-ERR password missing\r\n"); close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; return 0; } *ptr++ = '\0'; while (isspace(*ptr)) ++ptr; addr_len = sizeof (sock_addr); if ((getpeername(tport[port].tcan[can].sock, (struct sockaddr *)&sock_addr, &addr_len) == 0) && (sock_addr.sin_family == AF_INET)) address = &sock_addr; else address = NULL; // Check login switch (pop_check_call (port, can, callsign, address)) { case 1: // Check password if (pop_check_md5 (port, can, ptr)) { sprintf (buffer, "(%d) CONNECTED to %s-%d", can, tport[port].tcan[can].callsign.call, tport[port].tcan[can].callsign.num); tport[port].tcan[can].state = POP_TRANS; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return (strlen (buffer)); } break; } if (ok == 0) { pop_send(port, can, "-ERR invalid usercode or password, please try later\r\n"); close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; } return 0; } static int pop_cmd_last (int port, int can, char *buffer) { int i, max = 0; for (i = 0 ; i < tport[port].tcan[can].mess_nb ; i++) if (tport[port].tcan[can].mess[i].mess_del == 0) if (tport[port].tcan[can].mess[i].mess_stat != 'N') max = i+1; pop_send(port, can, "+OK %d\r\n", max); return 0; } static int pop_cmd_dele (int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; if (*ptr == '\0') { pop_send(port, can, "-ERR message number required (e.g. DELE 1)\r\n"); } else { int nb = atoi(ptr); if (nb < 1 || nb > tport[port].tcan[can].mess_nb) { pop_send(port, can, "-ERR invalid message; number out of range\r\n"); } else { tport[port].tcan[can].mess[nb-1].mess_del = 1; pop_send(port, can, "+OK message %d marked for deletion\r\n", nb); } } return 0; } static int pop_cmd_retr (int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; if (*ptr == '\0') { pop_send(port, can, "-ERR message number required (e.g. TOP 1 7)\r\n"); } else { int nb = atoi(ptr); if (check_num (port, can, nb)) { char buf[80]; tport[port].tcan[can].nb_lines = -1; tport[port].tcan[can].mess_cur = nb-1; tport[port].tcan[can].cr = 1; tport[port].tcan[can].head = 1; pop_send(port, can, "+OK message %d (%ld bytes)\r\n", nb, tport[port].tcan[can].mess[nb-1].mess_size); tport[port].tcan[can].mess[nb-1].mess_stat = 'Y'; tport[port].tcan[can].state = POP_MSG; sprintf(buf, "R %ld\r", tport[port].tcan[can].mess[nb-1].mess_num); pop_to_bbs(port, can, buf, 1); } } return 0; } static int pop_cmd_rset (int port, int can, char *buffer) { int i ; for (i = 0 ; i < tport[port].tcan[can].mess_nb ; i++) tport[port].tcan[can].mess[i].mess_del = 0; pop_send(port, can, "+OK %d messages %ld bytes\r\n", tport[port].tcan[can].mess_nb, tport[port].tcan[can].mess_tot); return 0; } static int pop_cmd_top (int port, int can, char *buffer) { char *ptr = buffer + 3; while (isspace(*ptr)) ++ptr; if (*ptr == '\0') { pop_send(port, can, "-ERR message number and line count required (e.g. TOP 1 7)\r\n"); } else { int nb = atoi(ptr); while (!isspace(*ptr)) ++ptr; while (isspace(*ptr)) ++ptr; if (*ptr == '\0') { pop_send(port, can, "-ERR line count required (e.g. TOP 1 7)\r\n"); } else { int lines = atoi(ptr); if (check_num (port, can, nb)) { char buf[80]; tport[port].tcan[can].nb_lines = lines; tport[port].tcan[can].mess_cur = nb-1; tport[port].tcan[can].cr = 1; tport[port].tcan[can].head = 1; pop_send(port, can, "+OK message %d (%ld bytes)\r\n", nb, tport[port].tcan[can].mess[nb-1].mess_size); tport[port].tcan[can].mess[nb-1].mess_stat = 'Y'; tport[port].tcan[can].state = POP_MSG; sprintf(buf, "R %ld\r", tport[port].tcan[can].mess[nb-1].mess_num); pop_to_bbs(port, can, buf, 1); } } } return 0; } static int pop_cmd_stat (int port, int can, char *buffer) { pop_send(port, can, "+OK %d %ld\r\n", tport[port].tcan[can].mess_nb, tport[port].tcan[can].mess_tot); return 0; } static int pop_cmd_noop (int port, int can, char *buffer) { pop_send(port, can, "+OK\r\n"); return 0; } /* * SMTP commands processing ** */ static int smtp_reply(int port, int can, int next, int num, char *fmt, ...) { int nb; char buf[1024]; va_list argptr; if (tport[port].tcan[can].sock != -1) { va_start (argptr, fmt); nb = sprintf(buf, "%d%c", num, (next) ? '-' : ' '); vsprintf (buf+nb, fmt, argptr); va_end (argptr); strcat(buf, "\r\n"); write (tport[port].tcan[can].sock, buf, strlen (buf)); return 1; } return 0; } static int smtp_message(int port, int canal) { taddr_t *dest = tport[port].tcan[canal].rcpt_to; char *ptr; char str[256]; char *exped = tport[port].tcan[canal].mail_from->address; int ret = 1; ptr = strchr(exped, '@'); if (ptr) *ptr = '\0'; /* Send the message to all recipients of the list */ while (dest) { dbuf_t *buf; snprintf(str, sizeof(str)-1, "SP %s < %s\r", dest->address, exped); str[sizeof(str)-1] = 0; if (!pop_to_bbs(port, canal, str, 0)) { ret = 0; break; } buf = tport[port].tcan[canal].msgbuf; while (buf) { if (!pop_to_bbs(port, canal, buf->data, 0)) { ret = 0; break; } buf = buf->next; } if (ret == 0) break; dest = dest->next; } free_address(port, canal); free_msgbuf(port, canal); return ret; } static int nntp_message(int port, int canal) { taddr_t *dest = tport[port].tcan[canal].rcpt_to; char *ptr; char str[256]; char *exped = tport[port].tcan[canal].mail_from->address; int ret = 1; ptr = strchr(exped, '@'); if (ptr) *ptr = '\0'; /* Send the message to all recipients of the list */ while (dest) { dbuf_t *buf; snprintf(str, sizeof(str)-1, "SB %s < %s\r", dest->address, exped); str[sizeof(str)-1] = 0; if (!pop_to_bbs(port, canal, str, 0)) { ret = 0; break; } buf = tport[port].tcan[canal].msgbuf; while (buf) { if (!pop_to_bbs(port, canal, buf->data, 0)) { ret = 0; break; } buf = buf->next; } if (ret == 0) break; dest = dest->next; } free_address(port, canal); free_msgbuf(port, canal); return ret; } static int add_to_msg(int port, int can, char *buffer) { int lg; dbuf_t *cur; cur = malloc(sizeof(dbuf_t)); if (cur == NULL) return 0; lg = strlen(buffer); cur->len = lg; cur->data = strdup(buffer); cur->next = NULL; //if (1) // Remove the encoding change. Leaving the text untouched allows other encodings to pass through the nntp server intact. The user can always choose the IBM850 encoding from Thunderbird, if they need to. // ansi_to_ibm(cur->data, lg); if (tport[port].tcan[can].msgbuf) { dbuf_t *buf = tport[port].tcan[can].msgbuf; /* Append to last buffer */ while (buf->next) buf = buf->next; buf->next = cur; } else { tport[port].tcan[can].msgbuf = cur; } return 1; } static int smtp_rcv_dt(int port, int can, char *buffer, int len) { char *ptr = buffer; if (tport[port].tcan[can].sock == -1) return (FALSE); if (tport[port].tcan[can].state != SMTP_MSG) return TRUE; /* Main message */ if (*ptr == '.') { if (len == 1) { /* End of the message */ add_to_msg(port, can, "/EX\r"); tport[port].tcan[can].state = SMTP_TRANS; if (smtp_message(port, can)) smtp_reply(port, can, 0, 250, "Message accepted"); else smtp_reply(port, can, 0, 552, "Message failed"); return 1; } if (ptr[1] == '.') ++ptr; } if (tport[port].tcan[can].head) { /* Read the headers */ if (len == 0) { char str[256]; taddr_t *dest, *extra; extra = tport[port].tcan[can].content; if (extra) { while (extra) { snprintf(str, sizeof(str)-1, "%s\r", extra->address); str[sizeof(str)-1] = 0; add_to_msg(port, can, str); extra = extra->next; } } else { snprintf(str, sizeof(str)-1, "From: %s\r", tport[port].tcan[can].mail_from->address); str[sizeof(str)-1] = 0; add_to_msg(port, can, str); dest = tport[port].tcan[can].rcpt_to; while (dest) { sprintf(str, "To: %s\r", dest->address); add_to_msg(port, can, str); dest = dest->next; } } /* End of headers */ tport[port].tcan[can].head = 0; add_to_msg(port, can, "\r"); } else if (tport[port].tcan[can].extra) { taddr_t *cur = tport[port].tcan[can].content; taddr_t *cont = malloc(sizeof(taddr_t)); cont->address = strdup(ptr); cont->next = NULL; if (cur) { /* Add the extra header to the end of list */ while (cur->next) cur = cur->next; cur->next = cont; } tport[port].tcan[can].extra = (ptr[strlen(ptr)-1] == ';'); } else if (strncmpi("content-type:", ptr, 13) == 0) { if (strstr(ptr, "multipart")) { taddr_t *cur = tport[port].tcan[can].content; taddr_t *cont = malloc(sizeof(taddr_t)); cont->address = strdup(ptr); cont->next = NULL; if (cur) { /* Add the extra header to the end of list */ while (cur->next) cur = cur->next; cur->next = cont; } else { tport[port].tcan[can].content = cont; } tport[port].tcan[can].extra = (ptr[strlen(ptr)-1] == ';'); } } else if (strncmpi("subject:", ptr, 8) == 0) { /* Add the title */ ptr += 8; while (isspace (*ptr)) ++ptr; strcat(ptr, "\r"); add_to_msg(port, can, ptr); } return 1; } strcat(ptr, "\r"); add_to_msg(port, can, ptr); return 1; } static char *get_address(char *ptr) { static char add[41]; char *end, *ptr_tmp; ptr_tmp = strchr(ptr, '<'); if (ptr_tmp) { ptr = ptr_tmp+1; end = strchr(ptr, '>'); if (end) *end = '\0'; else return NULL; } /* If address does not match '"nickname" ', takes all chars*/ else { /* Consistency check */ end = strchr(ptr, '>'); if (end) return NULL ; } /**** SHOULD BE CONFIGURABLE (BEGIN) ****/ /* Translate address like f6fbb%f6fbb.fmlr.fra.eu@f6fbb.ampr.org */ end = strchr(ptr, '%'); if (end) { *end = '@'; end = strchr(end+1, '@'); if (end) *end = '\0'; } /**** SHOULD BE CONFIGURABLE (END) ****/ /* copy and upcase */ strn_cpy(sizeof(add)-1, add, ptr); return add; } static int smtp_cmd_ehlo(int port, int can, char *buffer) { char line[80]; smtp_reply(port, can, 1, 250, "%s", mypath); strcpy(line, "AUTH"); if (tport[port].smtp_auth & SMTP_AUTH_LOGIN) strcat(line, " LOGIN"); if (tport[port].smtp_auth & SMTP_AUTH_PLAIN) strcat(line, " PLAIN"); if (tport[port].smtp_auth & SMTP_AUTH_CRMD5) strcat(line, " CRAM-MD5"); smtp_reply(port, can, 0, 250, line); sprintf (buffer, "(%d) CONNECTED to %s", can, mycall); tport[port].tcan[can].state = SMTP_TRANS; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; if (tport[port].smtp_auth & SMTP_AUTH_NO) { /* No authentication needed */ tport[port].tcan[can].auth_ok = 1; } return (strlen (buffer)); } static int smtp_cmd_auth(int port, int can, char *buffer) { char *pstr; char *ptr = buffer + 4; if (tport[port].tcan[can].auth_ok == 2) { smtp_reply(port, can, 0, 503, "Authentication already done !"); return 0; } while (isspace(*ptr)) ++ptr; if ((tport[port].smtp_auth & SMTP_AUTH_LOGIN) && (strncmpi(ptr, "LOGIN", 5) == 0)) { ptr += 5; while (isspace(*ptr)) ++ptr; if (*ptr) { /* Login name on the same line */ strn_cpy(6, tport[port].tcan[can].callsign.call, base64_to_str(ptr)); smtp_reply(port, can, 0, 334, "%s", str_to_base64("Password:")); tport[port].tcan[can].state = SMTP_PASS; } else { /* Ask for login name */ smtp_reply(port, can, 0, 334, "%s", str_to_base64("Username:")); tport[port].tcan[can].state = SMTP_USER; } tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; } else if ((tport[port].smtp_auth & SMTP_AUTH_PLAIN) && (strncmpi(ptr, "PLAIN", 5) == 0)) { ptr += 5; while (isspace(*ptr)) ++ptr; /* Login name and password on the same line */ pstr = base64_to_str(ptr); if (*pstr == '\0') ++pstr; strn_cpy(6, tport[port].tcan[can].callsign.call, pstr); pstr += strlen(pstr)+1; smtp_cmd_pass(port, can, pstr, 0); } else if ((tport[port].smtp_auth & SMTP_AUTH_CRMD5) && (strncmpi(ptr, "CRAM-MD5", 5) == 0)) { sprintf (tport[port].tcan[can].md5string, "<%d.%ld@%s>", getpid(), time(NULL), mypath); smtp_reply(port, can, 0, 334, "%s", str_to_base64(tport[port].tcan[can].md5string)); tport[port].tcan[can].state = SMTP_MD5; } else { smtp_reply(port, can, 0, 502, "Unrecognized authentication type."); return 0; } return 0; } static int smtp_cmd_user(int port, int can, char *buffer) { char *ptr = buffer; while (isspace(*ptr)) ++ptr; strn_cpy(6, tport[port].tcan[can].callsign.call, base64_to_str(ptr)); smtp_reply(port, can, 0, 334, "%s", str_to_base64("Password:")); tport[port].tcan[can].state = SMTP_PASS; return 0; } static int smtp_cmd_md5(int port, int can, char *buffer) { char *callsign; char *ptr = buffer; unsigned addr_len; struct sockaddr_in *address; struct sockaddr_in sock_addr; while (isspace(*ptr)) ++ptr; addr_len = sizeof (sock_addr); if ((getpeername(tport[port].tcan[can].sock, (struct sockaddr *)&sock_addr, &addr_len) == 0) && (sock_addr.sin_family == AF_INET)) address = &sock_addr; else address = NULL; ptr = base64_to_str(ptr); callsign = ptr; while (*ptr && !isspace(*ptr)) ++ptr; if (*ptr == '\0') { smtp_reply(port, can, 0, 501, "Authentication error."); close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; return 0; } *ptr++ = '\0'; while (isspace(*ptr)) ++ptr; strn_cpy(6, tport[port].tcan[can].callsign.call, callsign); switch (pop_check_call (port, can, tport[port].tcan[can].callsign.call, address)) { case 1: // Check password if (pop_check_md5 (port, can, ptr)) { tport[port].tcan[can].state = SMTP_TRANS; smtp_reply(port, can, 0, 235, "Authentication successful."); tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; tport[port].tcan[can].auth_ok = 2; return 0; } break; } smtp_reply(port, can, 0, 501, "Authentication error."); close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; return 0; } static int smtp_cmd_pass(int port, int can, char *buffer, int base64) { char *ptr = buffer; unsigned addr_len; struct sockaddr_in *address; struct sockaddr_in sock_addr; while (isspace(*ptr)) ++ptr; addr_len = sizeof (sock_addr); if ((getpeername(tport[port].tcan[can].sock, (struct sockaddr *)&sock_addr, &addr_len) == 0) && (sock_addr.sin_family == AF_INET)) address = &sock_addr; else address = NULL; if (base64) ptr = base64_to_str(ptr); switch (pop_check_call (port, can, tport[port].tcan[can].callsign.call, address)) { case 1: // Check password if (pop_check_pass (port, can, ptr)) { tport[port].tcan[can].state = SMTP_TRANS; smtp_reply(port, can, 0, 235, "Authentication successful."); tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; tport[port].tcan[can].auth_ok = 2; return 0; } break; } smtp_reply(port, can, 0, 501, "Authentication error."); close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; return 0; } static int smtp_cmd_helo(int port, int can, char *buffer) { smtp_reply(port, can, 0, 250, "%s", mypath); sprintf (buffer, "(%d) CONNECTED to %s", can, mycall); tport[port].tcan[can].state = SMTP_TRANS; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; if (tport[port].smtp_auth & SMTP_AUTH_NO) { /* No authentication needed */ tport[port].tcan[can].auth_ok = 1; } return (strlen (buffer)); } static int smtp_cmd_quit(int port, int can, char *buffer) { smtp_reply(port, can, 0, 221, "Bye!"); if (tport[port].tcan[can].state != SMTP_START) { pop_to_bbs(port, can, "B\r", 0); } else { close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; } return 0; } static int smtp_cmd_mail(int port, int can, char *buffer) { char *ptr = buffer + 10; if (!tport[port].tcan[can].auth_ok) { smtp_reply(port, can, 0, 503, "Authentication required !"); return 0; } if (tport[port].tcan[can].mail_from) { smtp_reply(port, can, 0, 503, "Duplicate MAIL FROM:"); return 0; } while (isspace(*ptr)) ++ptr; ptr = get_address(ptr); if (ptr) { taddr_t *mailfrom = calloc(sizeof(taddr_t), 1); mailfrom->address = strdup(ptr); mailfrom->next = tport[port].tcan[can].mail_from; tport[port].tcan[can].mail_from = mailfrom; smtp_reply(port, can, 0, 250, "OK"); } else { smtp_reply(port, can, 0, 501, "Error : MAIL FROM:
"); } return 0; } static int smtp_cmd_rcpt(int port, int can, char *buffer) { char *ptr = buffer + 8; if (!tport[port].tcan[can].auth_ok) { smtp_reply(port, can, 0, 503, "Authentication required !"); return 0; } if (!tport[port].tcan[can].mail_from) { smtp_reply(port, can, 0, 513, "Missing MAIL FROM:"); return 0; } while (isspace(*ptr)) ++ptr; ptr = get_address(ptr); if (ptr) { taddr_t *cur = tport[port].tcan[can].rcpt_to; taddr_t *rcptto = malloc(sizeof(taddr_t)); rcptto->address = strdup(ptr); rcptto->next = NULL; if (cur) { /* Add the recipient to the end of list */ while (cur->next) cur = cur->next; cur->next = rcptto; } else { tport[port].tcan[can].rcpt_to = rcptto; } smtp_reply(port, can, 0, 250, "OK"); } else { smtp_reply(port, can, 0, 501, "Error : RCPT TP:
"); } return 0; } static int smtp_cmd_noop(int port, int can, char *buffer) { smtp_reply(port, can, 0, 250, "OK"); return 0; } static int smtp_cmd_rset(int port, int can, char *buffer) { free_address(port, can); smtp_reply(port, can, 0, 250, "OK"); return 0; } static int smtp_cmd_data(int port, int can, char *buffer) { if (!tport[port].tcan[can].auth_ok) { smtp_reply(port, can, 0, 503, "Authentication required !"); return 0; } if (!tport[port].tcan[can].rcpt_to) smtp_reply(port, can, 0, 513, "Missing RCPT TO:"); else { tport[port].tcan[can].head = 1; tport[port].tcan[can].state = SMTP_MSG; smtp_reply(port, can, 0, 354, "End with ."); } return 0; } static int smtp_cmd_vrfy(int port, int can, char *buffer) { char *ptr = buffer + 4; if (!tport[port].tcan[can].auth_ok) { smtp_reply(port, can, 0, 503, "Authentication required !"); return 0; } while (isspace(*ptr)) ++ptr; smtp_reply(port, can, 0, 252, "Cannot VRFY %s", ptr); return 0; } /* * NNTP commands processing ** */ /* Get a bulletin */ static int nntp_bull(int port, int can, int mode, char *str) { char buf[80]; int bid; tport[port].tcan[can].nb_lines = mode; tport[port].tcan[can].cr = 1; tport[port].tcan[can].head = 1; if (mode == 3) tport[port].tcan[can].state = NNTP_LINE; else tport[port].tcan[can].state = NNTP_MSG; bid = search_bid(str); // Use BID's as the Message ID. if (bid > 0) { sprintf(buf, "TH R %d %d\r", mode, bid); } else // But fallback to the old code, in case old messages are still around { snprintf(buf, sizeof(buf)-1, "TH R %d %s\r", mode, str); buf[sizeof(buf)-1]= 0; } pop_to_bbs(port, can, buf, 1); return 0; } static int nntp_cmd_quit(int port, int can, char *buffer) { /* Received "QUIT" : disconnect */ pop_send(port, can, "205 NNTP Server shutdown.\r\n", mycall); if (tport[port].tcan[can].state != NNTP_USER) { pop_to_bbs(port, can, "B\r", 0); } else { close (tport[port].tcan[can].sock); tport[port].tcan[can].sock = -1; } return 0; } static int nntp_cmd_group(int port, int can, char *buffer) { char buf[80]; char *ptr = buffer + 5; /* smtp_reply(port, can, 0, 480, "Authentivation required"); return 0; */ while (isspace(*ptr)) ++ptr; if (*ptr == '\0') { pop_send(port, can, "411 Group name missing\r\n"); return 0; } snprintf(buf, sizeof(buf)-1, "TH G %s\r", ptr); buf[sizeof(buf)-1] = 0; pop_to_bbs(port, can, buf, 1); tport[port].tcan[can].state = NNTP_LINE; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return 0; } static int nntp_cmd_list(int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; if (strcmpi(ptr, "NEWSGROUP") == 0) { char name[80]; smtp_reply(port, can, 0, 215, "List of groups information"); ptr = first_group(); while (ptr) { sscanf(ptr, "%s", name); pop_send(port, can, "%s %s\r\n", name, name); ptr = next_group(); } } else { smtp_reply(port, can, 0, 215, "List of groups"); ptr = first_group(); while (ptr) { pop_send(port, can, "%s\r\n", ptr); ptr = next_group(); } } pop_send(port, can, ".\r\n"); return 0; } static int nntp_cmd_stat(int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; nntp_bull(port, can, 3, ptr); return 0; } static int nntp_cmd_head(int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; nntp_bull(port, can, 1, ptr); return 0; } static int nntp_cmd_body(int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; nntp_bull(port, can, 2, ptr); return 0; } static int nntp_cmd_next(int port, int can, char *buffer) { char buf[80]; sprintf(buf, "TH N\r"); pop_to_bbs(port, can, buf, 1); tport[port].tcan[can].state = NNTP_LINE; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return 0; } static int nntp_cmd_post(int port, int can, char *buffer) { if (!tport[port].tcan[can].auth_ok) { pop_send(port, can, "480 Authentication required\r\n"); return 0; } tport[port].tcan[can].head = 1; tport[port].tcan[can].state = NNTP_POSTMSG; pop_send(port, can, "340 Ok\r\n"); return 0; } static int nntp_cmd_article(int port, int can, char *buffer) { char *ptr = buffer + 7; while (isspace(*ptr)) ++ptr; nntp_bull(port, can, 0, ptr); return 0; } static int nntp_cmd_help(int port, int can, char *buffer) { pop_send(port, can, "100 Help text follows\r\n"); pop_send(port, can, "Commands : \r\n"); pop_send(port, can, "ARTICLE BODY GROUP HEAD\r\n"); pop_send(port, can, "HELP IHAVE LAST LIST\r\n"); pop_send(port, can, "NEWGROUPS NEWNEWS NEXT POST\r\n"); pop_send(port, can, "QUIT SLAVE STAT\r\n"); pop_send(port, can, ".\r\n"); return 0; } static int nntp_cmd_ihave(int port, int can, char *buffer) { pop_send(port, can, "437 Posting not allowed\r\n"); return 0; } static int nntp_cmd_last(int port, int can, char *buffer) { char buf[80]; sprintf(buf, "TH P\r"); pop_to_bbs(port, can, buf, 1); tport[port].tcan[can].state = NNTP_LINE; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return 0; } static int nntp_cmd_xhdr(int port, int can, char *buffer) { char buf[80]; char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; snprintf(buf, sizeof(buf)-1, "TH H %s\r", ptr); buf[sizeof(buf)-1] = 0; pop_to_bbs(port, can, buf, 1); tport[port].tcan[can].state = NNTP_MSG; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return 0; } static int nntp_cmd_xover(int port, int can, char *buffer) { char buf[80]; char *ptr = buffer + 5; while (isspace(*ptr)) ++ptr; snprintf(buf,sizeof(buf)-1, "TH O %s\r", ptr); buf[sizeof(buf)-1] = 0; pop_to_bbs(port, can, buf, 1); tport[port].tcan[can].state = NNTP_MSG; tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; return 0; } static int nntp_cmd_authinfo(int port, int can, char *buffer) { char *ptr = buffer + 8; struct sockaddr_in *address; struct sockaddr_in sock_addr; char *callsign = tport[port].tcan[can].callsign.call; while (isspace(*ptr)) ++ptr; if (strncmpi(ptr, "USER", 4) == 0) { ptr += 4; while (isspace(*ptr)) ++ptr; strn_cpy(6, tport[port].tcan[can].callsign.call, ptr); pop_send(port, can, "381 PASS required\r\n"); } else if (strncmpi(ptr, "PASS", 4) == 0) { unsigned addr_len; ptr += 4; while (isspace(*ptr)) ++ptr; addr_len = sizeof (sock_addr); if ((getpeername(tport[port].tcan[can].sock, (struct sockaddr *)&sock_addr, &addr_len) == 0) && (sock_addr.sin_family == AF_INET)) address = &sock_addr; else address = NULL; // Check login switch (pop_check_call (port, can, callsign, address)) { case 1: // Check password if (pop_check_pass (port, can, ptr)){ taddr_t *mailfrom; pop_send(port, can, "281 Ok\r\n"); tport[port].tcan[can].nb_try = 0; tport[port].tcan[can].timeout = time (NULL) + 120L; tport[port].tcan[can].auth_ok = 2; // Set From callsign to be CALLSIGN (from local bbs) mailfrom = calloc(sizeof(taddr_t), 1); mailfrom->address = strdup(callsign); mailfrom->next = tport[port].tcan[can].mail_from; tport[port].tcan[can].mail_from = mailfrom; return 0; } break; default: break; } pop_send(port, can, "281 Ok\r\n");// According to Spec. always return 281 Ok } else { pop_send(port, can, "501 user NAME|pass Password\r\n"); } return 0; } static int twodig(char *ptr) { int val; val = (ptr[0] -'0') * 10; val += (ptr[1] -'0'); return val; } static int nntp_cmd_newgroups(int port, int can, char *buffer) { int val; struct tm t; time_t temps; char *ptr = buffer + 9; while (isspace(*ptr)) ++ptr; temps = time(NULL); if (strlen(ptr) >= 13) { /* Get time information */ t = *(localtime(&temps)); /* Get year */ val = twodig(ptr); ptr += 2; if (val < 90) val += 100; t.tm_year = val; /* Get month */ val = twodig(ptr); ptr += 2; t.tm_mon = val - 1; /* Get day */ val = twodig(ptr); ptr += 2; t.tm_mday = val; while (isspace(*ptr)) ++ptr; /* Get hour */ val = twodig(ptr); ptr += 2; t.tm_hour = val; /* Get min */ val = twodig(ptr); ptr += 2; t.tm_min = val; /* Get sec */ val = twodig(ptr); ptr += 2; t.tm_sec = val; /* Set time */ temps = mktime(&t); } pop_send(port, can, "231 New groups follow\r\n"); pop_send(port, can, "%s", check_dates(temps)); return 0; } static int nntp_cmd_newnews(int port, int can, char *buffer) { pop_send(port, can, "500 Unknown command\r\n"); return 0; } static int nntp_cmd_slave(int port, int can, char *buffer) { pop_send(port, can, "202 Slave status ignored\r\n"); return 0; } static int nntp_cmd_mode(int port, int can, char *buffer) { char *ptr = buffer + 4; while (isspace(*ptr)) ++ptr; if (strcmpi(ptr, "READER") == 0) pop_send(port, can, "201 Posting not allowed\r\n"); else pop_send(port, can, "500 Unknown command\r\n"); return 0; } static int nntp_rcv_dt(int port, int can, char *buffer, int len) { char *ptr = buffer; if (tport[port].tcan[can].sock == -1) return (FALSE); if (tport[port].tcan[can].state != NNTP_POSTMSG) return TRUE; /* Main message */ if (*ptr == '.') { if (len == 1) { /* End of the message */ add_to_msg(port, can, "/EX\r"); tport[port].tcan[can].state = NNTP_TRANS; if (nntp_message(port, can)) pop_send(port, can, "240 Article posted\r\n"); else pop_send(port, can, "441 Posting failed\r\n"); return 1; } if (ptr[1] == '.') ++ptr; } if (tport[port].tcan[can].head) { /* Read the headers */ if (len == 0) { char str[256]; taddr_t *extra; extra = tport[port].tcan[can].content; if (extra) { while (extra) { snprintf(str, sizeof(str)-1, "%s\r", extra->address); str[sizeof(str)-1] = 0; add_to_msg(port, can, str); extra = extra->next; } } /* End of headers */ tport[port].tcan[can].head = 0; add_to_msg(port, can, "\r"); } else if (tport[port].tcan[can].extra) { taddr_t *cur = tport[port].tcan[can].content; taddr_t *cont = malloc(sizeof(taddr_t)); cont->address = strdup(ptr); cont->next = NULL; if (cur) { /* Add the extra header to the end of list */ while (cur->next) cur = cur->next; cur->next = cont; } tport[port].tcan[can].extra = (ptr[strlen(ptr)-1] == ';'); } else if (strncmpi("content-type:", ptr, 13) == 0) { if (strstr(ptr, "multipart")) { taddr_t *cur = tport[port].tcan[can].content; taddr_t *cont = malloc(sizeof(taddr_t)); cont->address = strdup(ptr); cont->next = NULL; if (cur) { /* Add the extra header to the end of list */ while (cur->next) cur = cur->next; cur->next = cont; } else { tport[port].tcan[can].content = cont; } tport[port].tcan[can].extra = (ptr[strlen(ptr)-1] == ';'); } } else if (strncmpi("subject:", ptr, 8) == 0) { /* Add the title */ ptr += 8; while (isspace (*ptr)) ++ptr; strcat(ptr, "\r"); add_to_msg(port, can, ptr); } else if (strncmpi("newsgroups:", ptr, 11) == 0) { ptr += 11; while (isspace (*ptr)) ++ptr; do { char *start;int len; if (*ptr == ',')ptr++; start = ptr; for (len = 0;*ptr && (*ptr != ',') ;len++,ptr++); if (len) { taddr_t *cur = tport[port].tcan[can].rcpt_to; taddr_t *rcptto = malloc(sizeof(taddr_t)); rcptto->address = strndup(start, len); rcptto->next = NULL; if (cur) { /* Add the recipient to the end of list */ while (cur->next) cur = cur->next; cur->next = rcptto; } else { tport[port].tcan[can].rcpt_to = rcptto; } } }while (*ptr); } #ifdef HEADERTEST else { taddr_t *cur = tport[port].tcan[can].content; taddr_t *cont = malloc(sizeof(taddr_t)); cont->address = strdup(ptr); cont->next = NULL; if (cur) { /* Add the extra header to the end of list */ while (cur->next) cur = cur->next; cur->next = cont; } else { tport[port].tcan[can].content = cont; } tport[port].tcan[can].extra = (ptr[strlen(ptr)-1] == ';'); } #endif return 1; } strcat(ptr, "\r"); add_to_msg(port, can, ptr); return 1; } /* Base 64 routines */ /* * Table for encoding base64 static char to_64[64] = { 33,34,35,36, 37,38,39,40, 41,42,43,44, 45,46,47,48, 49,50,51,52, 53,54,55,56, 57,58,65,66, 67,68,69,70, 71,72,73,74, 75,76,77,78, 79,80,81,82, 83,84,85,86, 87,88,89,90, 48,49,50,51, 52,53,54,55, 56,57,43,47, }; */ static char to_64[64] = { 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99,100,101,102, 103,104,105,106, 107,108,109,110, 111,112,113,114, 115,116,117,118, 119,120,121,122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47, }; #define B64(ch) (to_64[(int)(uchar)((ch) & 0x3f)]) /* * Table for decoding base64 */ static char fm_64[256] = { 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255, 62, 255,255,255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255, 255,255,255,255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255, 255,255,255,255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, 255,255,255,255, }; #define C64(ch) (fm_64[(int)(uchar)(ch)]) static char *str_to_base64(char *str) { int ch1, ch2, ch3; static char buf[256]; char *ptr = buf; while (*str) { ch1 = *str++; *ptr++ = B64(ch1 >> 2); ch2 = *str++; *ptr++ = B64(ch1 << 4 | ch2 >> 4); if (ch2 == '\0') break; ch3 = *str++; *ptr++ = B64(ch2 << 2 | ch3 >> 6); *ptr++ = B64(ch3 & 0x7f); if (ch3 == '\0') break; } *ptr++ = '='; *ptr++ = '\0'; return buf; } static char *base64_to_str(char *str) { int ch1, ch2, ch3, ch4; char *ptr = str; char *buf = str; while (*str) { ch1 = *str++; if (C64(ch1) == 255) continue; do { if (*str) ch2 = *str++; else ch2 = 255; } while (ch2 != 255 && ch2 != '=' && C64(ch2) == 255); do { if (*str) ch3 = *str++; else ch3 = 255; } while (ch3 != 255 && ch3 != '=' && C64(ch3) == 255); do { if (*str) ch4 = *str++; else ch4 = 255; } while (ch4 != 255 && ch4 != '=' && C64(ch4) == 255); if (ch1 == '=' || ch2 == '=') break; ch1 = C64(ch1); ch2 = C64(ch2); *ptr++ = (((ch1 & 0xff) << 2) | ((ch2 & 0x30) >> 4 )); if (ch3 == '=') break; ch3 = C64(ch3); *ptr++ = (((ch2 & 0x0f) << 4) | ((ch3 & 0x3c) >> 2)); if (ch4 == '=') break; ch4 = C64(ch4); *ptr++ = (((ch3 & 0x03) << 6) | (ch4 & 0xff)); } *ptr = '\0'; return buf; } fbb-7.0.10/src/fwdovl6.c0000644000175000017500000003222513615603431011601 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 6 */ #include static int lit_champ (char *, int, int); static void lit_fich (char *, int); void entete_saisie (void) { pvoie->msgtete = NULL; ptmes->taille = 0L; pvoie->messdate = time (NULL); pvoie->mess_recu = 0; pvoie->entete = 1; pvoie->header = 0; pvoie->mess_num = -1; *pvoie->mess_bid = '\0'; strn_cpy (39, pvoie->mess_home, mypath); del_temp (voiecur); } int rcv_titre (void) { #define MAX_TITRE 60 int nb = MAX_TITRE; char *scan; entete_saisie (); /* Efface un eventuel fichier existant */ scan = ptmes->titre; while ((*indd) && (*indd != '\n') && (*indd != '\r')) { if ((nb) && (*indd != 0x1a)) { nb--; *scan++ = *indd; } ++indd; } if (*indd) ++indd; *scan = '\0'; if ((!FOR (pvoie->mode)) && (nb == MAX_TITRE)) { texte (T_MBL + 21); return (0); } return (1); } static int swap_get (char *buffer) { if (*swap_scan == '\032') return (0); while ((*buffer++ = *swap_scan++) != '\0'); return (1); } static void swapp_champ (bullist * pbul, char *nouveau, char sw_champ) { switch (sw_champ) { case '@': strn_cpy (40, pbul->bbsv, nouveau); break; case '>': strn_cpy (6, pbul->desti, nouveau); break; case '<': strn_cpy (6, pbul->exped, nouveau); break; } } int swapp_bbs (bullist * pbul) { char champ; char sw_champ; char ligne[81], ancien[80], nouveau[80]; char *optr = nouveau; int ret = 0; df ("swapp_bbs", 2); swap_scan = swap_file; while (swap_get (ligne)) { *ancien = *nouveau = '\0'; champ = sw_champ = '\0'; if (sscanf (ligne, "%c%s %c%s\n", &champ, ancien, &sw_champ, nouveau)) { optr = nouveau; if (sw_champ == '\0') sw_champ = champ; switch (sw_champ) { case '@': case '>': case '<': break; default: sprintf (ligne, "%c%s", sw_champ, nouveau); sw_champ = champ; optr = ligne; } switch (champ) { case '@': /* if (indcmp (pbul->bbsv, ancien)) */ if (hiecmp (pbul->bbsv, ancien)) { swapp_champ (pbul, optr, sw_champ); /* ret = 1; */ } break; case '>': if (indcmp (pbul->desti, ancien)) { swapp_champ (pbul, optr, sw_champ); /* ret = 1; */ } break; case '<': if (indcmp (pbul->exped, ancien)) { swapp_champ (pbul, optr, sw_champ); /* ret = 1; */ } break; } } if (ret) { break; } } /* if (indcmp (mycall, bbs_via (pbul->bbsv))) */ if (hiecmp (mypath, pbul->bbsv)) { *pbul->bbsv = '\0'; ret = 0; } ff (); return (ret); } void ini_champs (int voie) { int i; svoie[voie]->entmes.status = 'N'; svoie[voie]->entmes.type = ' '; svoie[voie]->entmes.taille = 0L; svoie[voie]->entmes.bin = 0; svoie[voie]->m_ack = 0; svoie[voie]->messdate = time (NULL); svoie[voie]->mess_num = -1; svoie[voie]->entmes.numero = 0L; svoie[voie]->entmes.theme = 0; *(svoie[voie]->mess_bid) = '\0'; *(svoie[voie]->entmes.desti) = '\0'; *(svoie[voie]->entmes.bbsv) = '\0'; *(svoie[voie]->entmes.bbsf) = '\0'; *(svoie[voie]->entmes.bid) = '\0'; *(svoie[voie]->appendf) = '\0'; for (i = 0; i < NBMASK; i++) { svoie[voie]->entmes.fbbs[i] = svoie[voie]->entmes.forw[i] = '\0'; } strn_cpy (6, svoie[voie]->entmes.exped, svoie[voie]->sta.indicatif.call); } int lit_com_fwd (void) { ini_champs (voiecur); return (scan_com_fwd ()); } int scan_com_fwd (void) { char exped[10]; int autotype = 0; sup_ln (indd); //strupr (indd); if (!is_room ()) { outln ("*** Disk full !", 15); return (0); } if (ISGRAPH (*indd)) { *indd = toupper (*indd); if ((*indd == 'T') || (*indd == 'B') || (*indd == 'P') || (FOR (pvoie->mode)) || (BBS (pvoie->finf.flags))) { ptmes->type = *indd; } else if ((*indd == 'E') || (isdigit (*indd))) ptmes->type = 'E'; ++indd; } if (!is_espace (indd)) { texte (T_ERR + 2); return (0); } incindd (); if (!lit_champ (ptmes->desti, 6, 1)) return (0); if (ptmes->type == ' ') { if ((find (ptmes->desti)) || (is_serv (ptmes->desti))) { ptmes->type = 'P'; } else { ptmes->type = 'B'; } autotype = 1; } if (*indd == ' ') incindd (); /* Transforme le 1er "AT" en "@" */ if (strlen (indd) > 3) { if ((indd[0] == 'A') && (indd[1] == 'T') && (isspace (indd[2]))) { indd[0] = '@'; indd[1] = ' '; } } while (*indd) { switch (*indd) { case '@': incindd (); if (!lit_champ (ptmes->bbsv, 31, 2)) return (0); if (*indd == ' ') incindd (); if ((ptmes->type != 'P') && (ptmes->type != 'T') && (!isdigit (ptmes->type))) { ptmes->type = 'B'; } break; case '<': incindd (); if (!lit_champ (exped, 6, 1)) return (0); if (*exped) { if ((strcmp (exped, pvoie->sta.indicatif.call) != 0) && (!forward_auth (voiecur))) { varx[0][0] = '<'; varx[0][1] = '\0'; texte (T_ERR + 9); return (0); } strcpy (ptmes->exped, exped); } if (*indd == ' ') incindd (); break; case '+': if (!droits (ACCESDOS)) { if (!(FOR (pvoie->mode))) { varx[0][0] = '+'; varx[0][1] = '\0'; texte (T_ERR + 9); } return (0); } incindd (); lit_fich (pvoie->appendf, 79); if (access (pvoie->appendf, 0) != 0) { texte (T_ERR + 11); return (FALSE); } if (*indd == ' ') incindd (); break; case '$': incindd (); if (*indd) { if (!lit_champ (ptmes->bid, 12, 0)) return (0); } else sprintf (ptmes->bid, " "); if (*indd == ' ') incindd (); break; default: if (*indd != '\r') { if (!(FOR (pvoie->mode))) { varx[0][0] = *indd; varx[0][1] = '\0'; texte (T_ERR + 9); } return (0); } ++indd; break; } } if (*ptmes->desti == '\0') { if (!(FOR (pvoie->mode))) texte (T_ERR + 6); return (0); } /* Prive sur routage de groupe ! */ if ((*ptmes->bbsv) && (ptmes->type != 'T') && (!msg_find (bbs_via (ptmes->bbsv))) && (find (ptmes->desti))) { if ((strcmp ("SYSOP", ptmes->desti) != 0) && (strcmp ("WP", ptmes->desti) != 0) && (!(FOR (pvoie->mode)))) { texte (T_MBL + 21); return (0); } } ptmes->status = 'N'; if (*ptmes->bbsv) { if ((autotype) && (ptmes->type == 'P') && (!find (ptmes->desti)) && (!find (bbs_via (ptmes->bbsv)))) ptmes->type = 'B'; if ((*ptmes->bbsv) && (!find (bbs_via (ptmes->bbsv))) && (((ptmes->type != 'P') && (ptmes->type != 'A')) || (strcmp (ptmes->desti, "SYSOP") == 0) || (strcmp ("WP", ptmes->desti) == 0))) { ptmes->status = '$'; } } swapp_bbs (ptmes); if ((*ptmes->bbsv == '\0') && (ptmes->type == 'P')) { pvoie->m_ack = 1; } if (!addr_check (ptmes->bbsv)) { return (0); } if (!reacheminement ()) return (0); if ((*ptmes->bbsv == '\0') && (ptmes->type == 'A')) { ptmes->type = 'P'; } if (!is_bid (ptmes->bid)) { return (0); } return (1); } static int rej_get (char *buffer) { if (*rej_scan == '\032') return (0); while ((*buffer++ = *rej_scan++) != '\0'); return (1); } static int tst_mes_ems (int mode, bullist * ptmes) { long taille; int retour = 0; unsigned record = 0; Rej_rec rej; while (read_rej (record, &rej)) { if (rej.mode == mode) { taille = (long) rej.size * 1000L; retour = ( ((rej.type == '*') || (rej.type == ptmes->type)) && (strmatch (ptmes->exped, rej.exped)) && (strmatch (bbs_via (ptmes->bbsv), rej.via)) && (strmatch (ptmes->desti, rej.desti)) && (strmatch (ptmes->bid, rej.bid)) && (ptmes->taille >= taille) ); if (retour) break; } ++record; } return (retour); } static int tst_mes (int mode, bullist * ptmes) { if (ptmes->type == 'A') return (0); if (EMS_REJ_OK ()) { return (tst_mes_ems (mode, ptmes)); } else { char chaine[82], smode[20], type[20], exped[20]; char via[50], desti[20], bid[20]; long taille; int retour = 0; rej_scan = rej_file; while (rej_get (chaine)) { sscanf (chaine, "%s %s %s %s %s %s %ld", smode, type, exped, via, desti, bid, &taille); if (toupper (*smode) != mode) continue; taille *= 1000; retour = ( ((type[0] == '*') || (type[0] == ptmes->type)) && (strmatch (ptmes->exped, exped)) && (strmatch (bbs_via (ptmes->bbsv), via)) && (strmatch (ptmes->desti, desti)) && (strmatch (ptmes->bid, bid)) && (ptmes->taille >= taille) ); if (retour) break; } return (retour); } } int rejet (bullist * ptmes) { int retour; retour = tst_mes ('R', ptmes); if ((svoie[voiecur]->fbb >= 2) || (svoie[voiecur]->mbl_ext)) return ((retour) ? 4 : 0); else return ((retour) ? 1 : 0); } int retenu (bullist * ptmes) { int retour; retour = tst_mes ('H', ptmes); if (svoie[voiecur]->fbb >= 2) return ((retour) ? 5 : 0); else return (0); } int hold (bullist * ptmes) { int retenu = 0; if ((!pvoie->header) || (pvoie->mode == 0)) { retenu = tst_mes ('L', ptmes); } if (!retenu) { retenu = tst_mes ('H', ptmes); } return (retenu); } /* * Mode = 0 : Tous caracteres entre 0x21 et 0xff * Mode = 1 : champ sans '@' ni '.' * Mode = 2 : champ d'adresse hierarchique sans '@' * */ static int lit_champ (char *champ, int nb, int mode) { int i; int error = 0; char *str = indd; char last = '\0'; while ((*indd) && (!isspace (*indd))) { if (!ISGRAPH (*indd)) { error = 1; break; } if (mode == 1) { if (((std_header & 1) == 0) && (*indd == '@')) { break; } if (*indd == '.') { error = 1; break; } } else if (mode == 2) { if (*indd == '@') { error = 1; break; } } if (--nb < 0) break; *champ++ = toupper(*indd); last = *indd++; } *champ = '\0'; if (nb < 0) error = 2; if ((mode == 2) && ((std_header & 2) == 0) && (last == '.')) error = 1; if (!error) return (1); if (FOR (pvoie->mode)) return (0); for (i = 0; i < 40; ++str) { if (isspace (*str)) break; varx[0][i++] = toupper (*str); } varx[0][i] = '\0'; switch (error) { case 1: /* Champ errone */ texte (T_ERR + 17); break; case 2: /* Champ trop long */ texte (T_ERR + 16); break; } return (0); } static void lit_fich (char *champ, int nb) { while ((nb--) && (ISGRAPH (*indd))) { *champ++ = *indd++; } *champ = '\0'; } void ch_bbs (int mode, char ifwd[NBBBS][7]) { int i, bbs, tempif, cptif = 0, nb_fwd = 0; char nombbs[80]; char combuf[80]; char *pcom; /* init_bbs() ; */ bbs = 0; for (i = 0; i < NBMASK * 8; i++) *ifwd[i] = '\0'; rewind_fwd (); while (fwd_get (combuf)) { pcom = combuf; switch (*pcom++) { case 'A': /* recuperer le nom de la BBS destinataire */ strcpy (nombbs, pcom); bbs = num_bbs (nombbs); strn_cpy (6, ifwd[bbs - 1], nombbs); nb_fwd++; break; case 'E': /* ENDIF */ if (!mode) --cptif; break; case 'I': /* IF */ if (mode) break; ++cptif; if (tst_fwd (pcom, bbs, time (NULL), 0, NULL, 1, -1) == FALSE) { tempif = cptif - 1; while (cptif != tempif) { if (fwd_get (combuf) == 0) { break; } pcom = combuf; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; case '@': if (cptif == (tempif + 1)) ++tempif; break; default: break; } } } break; case '@': /* ELSE */ if (mode) break; if (cptif == 0) break; tempif = cptif - 1; while (cptif != tempif) { if (fwd_get (combuf) == 0) { break; } pcom = combuf; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; default: break; } } break; default: break; } if (nb_fwd == NBMASK * 8) break; } } int test_linked (void) { strupr (sup_ln (indd)); if ((pvoie->aut_linked) && (strncmp (indd, "LINKED TO ", 10) == 0)) { strtok (indd, " "); libere_zones_allouees (voiecur); /* Vide les eventuelles listes */ maj_niv (0, 0, 0); con_voie (voiecur, indd); return (1); } return (0); } void clear_fwd (long numero) { recfwd *prec; int pos = 0; lfwd *ptr_fwd = tete_fwd; while (1) { if (pos == NBFWD) { ptr_fwd = ptr_fwd->suite; if (ptr_fwd == NULL) break; pos = 0; } prec = &ptr_fwd->fwd[pos]; if ((prec->type) && (prec->nomess == numero)) { prec->type = '\0'; break; } pos++; } } fbb-7.0.10/src/Makefile.am0000644000175000017500000000552113747456632012120 00000000000000# We need to install some of these binaries in custom locations tooldir = $(pkglibdir)/tool serverdir = $(pkglibdir)/server tool_PROGRAMS = clr_user epurmess epurwp maintinf server_PROGRAMS = reqdir # The rest of the binaries go in sbin sbin_PROGRAMS = ajoursat satdoc satupdat fbbgetconf xfbbd xfbbC ajoursat_SOURCES = ajoursat.c clr_user_SOURCES = clr_user.c fbb_conf.c satdoc_SOURCES = satdoc.c satupdat_SOURCES = satupdat.c reqdir_SOURCES = reqdir.c fbb_conf.c epurwp_SOURCES = epurwp.c fbb_conf.c epurmess_SOURCES = epurmess.c fbb_conf.c fbbgetconf_SOURCES = fbbgetconf.c fbb_conf.c maintinf_SOURCES = maintinf.c fbb_conf.c # Build a convenience library, since these are all used by a couple different # programs noinst_LIBRARIES = libxfbbd.a libxfbbd_a_SOURCES = arbre.c autobin.c balise.c bidexms.c conf.c\ console.c date.c devio.c dos_1.c dos_dir.c\ driver.c drv_aea.c drv_ded.c drv_hst.c drv_kam.c\ drv_mod.c drv_pop.c drv_sock.c drv_tcp.c edit.c\ ems.c error.c exec_pg.c fbb_conf.c fbb_orb.c\ fortify.c forward.c fwdovl1.c fwdovl2.c fwdovl3.c\ fwdovl4.c fwdovl5.c fwdovl6.c fwdovl7.c fwdutil.c\ gesfic.c ibm.c info.c init.c init_srv.c\ init_tnc.c initfwd.c initport.c k_tasks.c kernel.c\ lzhuf.c maint_fw.c mbl_edit.c mbl_expo.c mbl_impo.c\ mbl_kill.c mbl_lc.c mbl_list.c mbl_log.c mbl_menu.c\ mbl_opt.c mbl_prn.c mbl_read.c mbl_rev.c mbl_stat.c\ mbl_sys.c mbl_user.c mblutil.c md5c.c modem.c\ nomenc.c nouvfwd.c pac_crc.c pacsat.c qraloc.c\ redist.c rx25.c serv.c serveur.c statis.c themes.c\ tnc.c tncio.c trait.c trajec.c trajovl.c variable.c\ warning.c watchdog.c waveplay.c wp.c wp_mess.c\ wpserv.c xfwd.c xmodem.c yapp.c # We want to build fbb_conf.c on the fly to substitute in default paths nodist_libxfbbd_a_SOURCES = fbb_conf.c BUILT_SOURCES = fbb_conf.c CLEANFILES = fbb_conf.c sourcefiles = fbb_conf.c edit = sed \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@libdir[@]|$(libdir)|g' fbb_conf.c: Makefile @list='$(sourcefiles)'; for p in $$list; do \ $(edit) $(srcdir)/$$p.in >$$p; \ done # Need to include fbb_conf.c.in manually, as well as aff_stat.c EXTRA_DIST = fbb_conf.c.in aff_stat.c xfbbd_SOURCES = xfbbd.c xfbbd_CFLAGS = -D__ORB__ $(AM_CFLAGS) xfbbd_LDADD = libxfbbd.a $(AX25_LIB) if HAVE_NCURSES xfbbC_SOURCES = md5c.c terminal.c xfbbC.c xfbbC_LDADD = @CURSES_LIB@ else xfbbC_SOURCES = md5c.c xfbbC.c endif #AM_CPPFLAGS = -I$(top_srcdir)/include AM_CPPFLAGS = -I$(top_srcdir)/include -Wstrict-prototypes -funsigned-char -DPROTOTYPES # Need to build stuff in this folder first, before X11, as there are deps in here # Check and see if we are going to build the X binaries at all first if HAVE_X_LIBS EXTRADIRS = X11 endif SUBDIRS = . $(EXTRADIRS) fbb-7.0.10/src/lzhuf.c0000644000175000017500000010017713613360505011344 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /************************************************************** lzhuf.c written by Haruyasu Yoshizaki 11/20/1988 some minor changes 4/6/1989 comments translated by Haruhiko Okumura 4/7/1989 adapted by Jean-Paul ROUBELAT F6FBB 10/31/90 **************************************************************/ #include #include static FILE *infile, *outfile; static char *in_f, *ou_f; static unsigned int textsize, codesize, printcount; static char *head; static char bin_header[257]; static short headlen; static void write_huf_error (char *); static short take (void); static long numero; static ushort crc; static bullist *pbul; static short basic; static short init_huf = 0; static int crlf = 0; /********** LZSS compression **********/ #define N 2048 /* buffer size */ #define F 60 /* lookahead buffer size */ #define THRESHOLD 2 #define NIL N /* leaf of tree */ static unsigned char text_buf[N + F - 1]; static ushort chck; static short match_position, match_length; static short *lson, *rson, *dad; /* Declaration de fonctions */ static short crc_fgetc (FILE *); static ushort crc_fputc (ushort, FILE *); static void ins_route (int, char *); /**********************/ char *make_header (bullist * pbul, char *header) { long temps; struct tm *sdate; char tempo[200]; bullist *psauv; psauv = ptmes; ptmes = pbul; temps = ptmes->date; sdate = gmtime (&temps); if (std_header & 8) sprintf (tempo, "R:%02d%02d%02d/%02d%02dZ %%N@%%R%s", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min, txtfwd); else sprintf (tempo, "R:%02d%02d%02d/%02d%02dZ @:%%R #:%%N%s", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min, txtfwd); n_cpy (150, header, var_txt (tempo)); if (((std_header & 4) == 0) && (strlen (header) > 79)) { char *ptr; ptr = header + 79; while (*ptr != ' ') { --ptr; } *ptr = '\0'; } strcat (header, "\r"); ptmes = psauv; return (header); } void dde_huf (int voie, bullist * pbul, int mode) { desc_huf pthuf; long taille; FILE *fptr; char fic[128]; char temp[128]; make_header (pbul, pthuf.header); /* <--------- A mettre ds ENCODE */ pthuf.next = NULL; pthuf.voie = voie; pthuf.mode = mode; pthuf.bull = pbul; deb_io (); taille = 0L; if (pthuf.mode == ENCODE) { strcpy (fic, mess_name (MBINDIR, pthuf.bull->numero, temp)); if ((fptr = fopen (fic, "r")) != NULL) { if (fread (&taille, sizeof (long), 1, fptr) == 0) taille = 0L; fclose (fptr); } } fin_io (); if (taille == 0L) { taille = lzhuf (&pthuf); } svoie[voie]->ask = taille; } static ushort crc_fputc (ushort c, FILE * outfile) { crc = updcrc ((uchar)c, crc); chck += (c & 0xff); return (fputc (c, outfile)); } static short crc_fgetc (FILE * infile) { short retour = getc (infile); if (retour != -1) { crc = updcrc (retour, crc); } return (retour); } /* * Date en chaine de caracteres sous la forme 960225 (25fev 96) * Retour en secondes depuis le 1 Jan 1970 */ long date_to_time (char *indd) { static char Days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; long x; short i; short days; short jour, mois, annee; for (i = 0; i < 6; i++) if (!isdigit (indd[i])) return (0L); if (indd[0] < '8') annee = ((indd[0] - '0') * 10) + 20 + (indd[1] - '0'); else annee = ((indd[0] - '8') * 10) + (indd[1] - '0'); mois = ((indd[2] - '0') * 10) + (indd[3] - '0'); jour = ((indd[4] - '0') * 10) + (indd[5] - '0'); if ((annee < 0) || (jour < 1) || (jour > 31) || (mois < 1) || (mois > 12)) { /* La date est incoherente */ x = 0L; } else { x = 315532800L + _timezone; /* Convertit de 1980 a 1970 */ x += (long) (annee >> 2) * 126230400L; /* 4 annees */ x += (long) (annee & 3) * 31536000L; /* 1 annee */ if (annee & 3) x += 86400L; days = 0; i = mois - 1; while (i > 0) { i--; days += Days[i]; } days += jour - 1; if ((mois > 2) && ((annee & 3) == 0)) days++; /* bissextile */ x += ((long) days * 86400L); } return (x); } /* * Heure sous la forme 1031 (10h31mn) * Retour en secondes depuis 00h00 */ long hour_to_time (char *indd) { long x; short i; short hour, minute; for (i = 0; i < 4; i++) if (!isdigit (indd[i])) return (0L); hour = ((indd[0] - '0') * 10) + (indd[1] - '0'); minute = ((indd[2] - '0') * 10) + (indd[3] - '0'); x = (long) hour *3600L + (long) minute *60L; return (x); } char *bbs_via (char *s) { short nb = 0; static char bbs[7]; while (ISGRAPH (*s) && (*s != '.')) { if (nb == 6) break; bbs[nb++] = toupper (*s); ++s; } bbs[nb] = '\0'; return (bbs); } static void ins_route (int voie, char *route) { int i, alloue = 0; Hroute *pcurr, *pprec; if (svoie[voie]->r_tete == NULL) { svoie[voie]->r_tete = svoie[voie]->r_curr = (Route *) m_alloue (sizeof (Route)); alloue = 1; } if (svoie[voie]->r_pos == NBROUTE) { svoie[voie]->r_curr->suite = (Route *) m_alloue (sizeof (Route)); svoie[voie]->r_curr = svoie[voie]->r_curr->suite; alloue = 1; } if (alloue) { svoie[voie]->r_pos = 0; svoie[voie]->r_curr->suite = NULL; for (i = 0; i < NBROUTE; i++) *(svoie[voie]->r_curr->call[i]) = '\0'; } strn_cpy (6, svoie[voie]->r_curr->call[svoie[voie]->r_pos++], bbs_via (route)); if (h_ok) { pcurr = throute; pprec = NULL; if (pcurr) { while (pcurr) { pprec = pcurr; pcurr = pcurr->suiv; } pcurr = pprec->suiv = (Hroute *) m_alloue (sizeof (Hroute)); } else { pcurr = throute = (Hroute *) m_alloue (sizeof (Hroute)); } strn_cpy (40, pcurr->route, route); pcurr->suiv = NULL; } } void analyse_header (int voie, char *ptr) { int c; int champ; int nb; int bbs; long date; char rbbs[80]; char home[41]; char qth[31]; char zip[13]; ptr += 2; champ = 2; nb = 0; bbs = 0; *home = *zip = *qth = '\0'; date = 0L; svoie[voie]->mess_num = -1L; do { c = *ptr; switch (champ) { case 0: switch (c) { case '@': bbs = 1; champ = 3; nb = 0; break; case '#': champ = 6; nb = 0; break; case '$': champ = 7; nb = 0; break; case '[': champ = 4; nb = 0; break; case 'Z': if (*(ptr + 1) == ':') { ++ptr; champ = 5; nb = 0; } break; default: if ((bbs == 0) && (isdigit (c))) { nb = 0; rbbs[nb++] = c; champ = 6; } } case 1: if (isspace (c)) champ = 0; break; case 2: /* Lecture de la date - Mettre la date la plus ancienne */ if (nb <= 10) rbbs[nb] = c; if (nb == 10) { rbbs[11] = '\0'; rbbs[6] = '\0'; if ((date = date_to_time (rbbs)) != 0L) { date += hour_to_time (rbbs + 7); svoie[voie]->messdate = date; } champ = 1; } ++nb; break; case 3: /* Lecture du home BBS */ if ((nb == 0) && (c == ':')) break; if ((ISGRAPH (c)) && (nb < 40)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; ins_route (voie, rbbs); strn_cpy (40, home, rbbs); strn_cpy (40, svoie[voie]->mess_home, rbbs); svoie[voie]->header = 1; champ = 0; } break; case 4: /* Lecture du Qth */ if ((c != ']') && (nb < 30)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; n_cpy (30, qth, rbbs); champ = 0; } break; case 5: /* Lecture du Zip Code */ if ((ISGRAPH (c)) && (nb < 8)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; strn_cpy (8, zip, rbbs); champ = 0; } break; case 6: /* Lecture du home premier numero */ if ((nb == 0) && (c == ':')) break; if ((isdigit (c)) && (nb < 10)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; if (nb) svoie[voie]->mess_num = atol (rbbs); if ((bbs == 0) && (c == '@')) { bbs = 1; champ = 3; nb = 0; } else champ = 0; } break; case 7: /* Lecture du BID/MID */ if ((nb == 0) && (c == ':')) break; if ((ISGRAPH (c)) && (nb < 12)) { rbbs[nb++] = c; } else { rbbs[nb] = '\0'; if (nb) strn_cpy (12, svoie[voie]->mess_bid, rbbs); champ = 0; } break; } ++ptr; } while (ISPRINT (c)); header_wp (date, home, qth, zip); } void entete_mess_fwd (bullist * pbul, char *header) { char s[128]; bullist *sav_bul; deb_io (); sav_bul = ptmes; ptmes = pbul; *msg_header = '\0'; if ((ptmes->type == 'A') || (strcmp (ptmes->desti, "WP") == 0)) { if (*(ptmes->bbsf) == '\0') { strcpy (msg_header, header); strcat (msg_header, "\r"); } } else if (*(ptmes->bbsf)) { strcpy (msg_header, header); } else { strcpy (msg_header, header); sprintf (s, "\rFrom: %s@%s\rTo : %s@%s\r\r", ptmes->exped, mypath, ptmes->desti, ptmes->bbsv); strcat (msg_header, s); } ptmes = sav_bul; fin_io (); } static void write_huf_error (char *filename) { deb_io (); fclose (infile); fclose (outfile); unlink (ou_f); write_error (filename); fin_io (); } static void InitTree (void) /* initialize trees */ { int i; for (i = N + 1; i <= N + 256; i++) rson[i] = NIL; /* root */ for (i = 0; i < N; i++) dad[i] = NIL; /* node */ } static void InsertNode (short r) /* insert to tree */ { short i, p, cmp; unsigned char *key; ushort c; cmp = 1; key = &text_buf[r]; p = N + 1 + key[0]; rson[r] = lson[r] = NIL; match_length = 0; for (;;) { if (cmp >= 0) { if (rson[p] != NIL) p = rson[p]; else { rson[p] = r; dad[r] = p; return; } } else { if (lson[p] != NIL) p = lson[p]; else { lson[p] = r; dad[r] = p; return; } } for (i = 1; i < F; i++) if ((cmp = key[i] - text_buf[p + i]) != 0) break; if (i > THRESHOLD) { if (i > match_length) { match_position = ((r - p) & (N - 1)) - 1; if ((match_length = i) >= F) break; } else if (i == match_length) { if ((c = ((r - p) & (N - 1)) - 1) < match_position) { match_position = c; } } } } dad[r] = dad[p]; lson[r] = lson[p]; rson[r] = rson[p]; dad[lson[p]] = r; dad[rson[p]] = r; if (rson[dad[p]] == p) rson[dad[p]] = r; else lson[dad[p]] = r; dad[p] = NIL; /* remove p */ } static void DeleteNode (short p) /* remove from tree */ { short q; if (dad[p] == NIL) return; /* not registered */ if (rson[p] == NIL) q = lson[p]; else if (lson[p] == NIL) q = rson[p]; else { q = lson[p]; if (rson[q] != NIL) { do { q = rson[q]; } while (rson[q] != NIL); rson[dad[q]] = lson[q]; dad[lson[q]] = dad[q]; lson[q] = lson[p]; dad[lson[p]] = q; } rson[q] = rson[p]; dad[rson[p]] = q; } dad[q] = dad[p]; if (rson[dad[p]] == p) rson[dad[p]] = q; else lson[dad[p]] = q; dad[p] = NIL; } /* Huffman coding */ #define N_CHAR (256 - THRESHOLD + F) /* kinds of characters (character code = 0..N_CHAR-1) */ #define T (N_CHAR * 2 - 1) /* size of table */ #define R (T - 1) /* position of root */ #define MAX_FREQ 0x8000 /* updates tree when the */ /* root frequency comes to this value. */ /* table for encoding and decoding the upper 6 bits of position */ /* for encoding */ static uchar p_len[64] = { 0x03, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08 }; static uchar p_code[64] = { 0x00, 0x20, 0x30, 0x40, 0x50, 0x58, 0x60, 0x68, 0x70, 0x78, 0x80, 0x88, 0x90, 0x94, 0x98, 0x9C, 0xA0, 0xA4, 0xA8, 0xAC, 0xB0, 0xB4, 0xB8, 0xBC, 0xC0, 0xC2, 0xC4, 0xC6, 0xC8, 0xCA, 0xCC, 0xCE, 0xD0, 0xD2, 0xD4, 0xD6, 0xD8, 0xDA, 0xDC, 0xDE, 0xE0, 0xE2, 0xE4, 0xE6, 0xE8, 0xEA, 0xEC, 0xEE, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7, 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF }; /* for decoding */ static uchar d_code[256] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B, 0x0C, 0x0C, 0x0C, 0x0C, 0x0D, 0x0D, 0x0D, 0x0D, 0x0E, 0x0E, 0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, 0x10, 0x10, 0x10, 0x10, 0x11, 0x11, 0x11, 0x11, 0x12, 0x12, 0x12, 0x12, 0x13, 0x13, 0x13, 0x13, 0x14, 0x14, 0x14, 0x14, 0x15, 0x15, 0x15, 0x15, 0x16, 0x16, 0x16, 0x16, 0x17, 0x17, 0x17, 0x17, 0x18, 0x18, 0x19, 0x19, 0x1A, 0x1A, 0x1B, 0x1B, 0x1C, 0x1C, 0x1D, 0x1D, 0x1E, 0x1E, 0x1F, 0x1F, 0x20, 0x20, 0x21, 0x21, 0x22, 0x22, 0x23, 0x23, 0x24, 0x24, 0x25, 0x25, 0x26, 0x26, 0x27, 0x27, 0x28, 0x28, 0x29, 0x29, 0x2A, 0x2A, 0x2B, 0x2B, 0x2C, 0x2C, 0x2D, 0x2D, 0x2E, 0x2E, 0x2F, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F, }; static uchar d_len[256] = { 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, }; static ushort *freq; /* frequency table */ /* pointers to parent nodes, except for the elements [T..T + N_CHAR - 1] which are used to get the positions of leaves corresponding to the codes. */ static short *prnt; static short *fils; /* pointers to child nodes (fils[], fils[] + 1) */ static ushort getbuf; static uchar getlen; static short scan_header (char *chaine) { char *ptr = bin_header; while ((*ptr++ = *chaine) != '\0') { if (*chaine == '\r') *ptr++ = '\n'; ++chaine; } return (strlen (bin_header)); } static short take (void) { short c; if (headlen) { --headlen; c = ((short) *head++ & 0xff); } else { /* Gestion du LF -> CRLF */ if (crlf) { c = '\n'; crlf = 0; } else { do { /* Ignore les CR */ c = getc (infile); } while (c == '\r'); if (c == '\n') { crlf = c; c = '\r'; } } } return (c); } static short GetBit (void) /* get one bit */ { short i; while (getlen <= 8) { if ((i = crc_fgetc (infile)) < 0) i = 0; getbuf |= i << (8 - getlen); getlen += 8; } i = getbuf; getbuf <<= 1; getlen--; return (i < 0); } static short GetByte (void) /* get one byte */ { ushort i; while (getlen <= 8) { if ((i = crc_fgetc (infile)) == 0xffff) i = 0; getbuf |= i << (8 - getlen); getlen += 8; } i = getbuf; getbuf <<= 8; getlen -= 8; return i >> 8; } static ushort putbuf; static uchar putlen; static void Putcode (short l, ushort c) /* output c bits of code */ { putbuf |= c >> putlen; if ((putlen += l) >= 8) { if (crc_fputc (putbuf >> 8, outfile) == EOF) { write_huf_error (ou_f); } if ((putlen -= 8) >= 8) { if (crc_fputc (putbuf, outfile) == EOF) { write_huf_error (ou_f); } codesize += 2; putlen -= 8; putbuf = c << (l - putlen); } else { putbuf <<= 8; codesize++; } } } /* initialization of tree */ static void StartHuff (void) { short i, j; for (i = 0; i < N_CHAR; i++) { freq[i] = 1; fils[i] = i + T; prnt[i + T] = i; } i = 0; j = N_CHAR; while (j <= R) { freq[j] = freq[i] + freq[i + 1]; fils[j] = i; prnt[i] = prnt[i + 1] = j; i += 2; j++; } freq[T] = 0xffff; prnt[R] = 0; } /* reconstruction of tree */ static void reconst (void) { short i, j, k; ushort f, l; /* collect leaf nodes in the first half of the table */ /* and replace the freq by (freq + 1) / 2. */ j = 0; for (i = 0; i < T; i++) { if (fils[i] >= T) { freq[j] = (freq[i] + 1) / 2; fils[j] = fils[i]; j++; } } /* begin constructing tree by connecting sons */ for (i = 0, j = N_CHAR; j < T; i += 2, j++) { k = i + 1; f = freq[j] = freq[i] + freq[k]; for (k = j - 1; f < freq[k]; k--) ; k++; l = (j - k) * 2; memmove (&freq[k + 1], &freq[k], l); freq[k] = f; memmove (&fils[k + 1], &fils[k], l); fils[k] = i; } /* connect prnt */ for (i = 0; i < T; i++) { if ((k = fils[i]) >= T) { prnt[k] = i; } else { prnt[k] = prnt[k + 1] = i; } } } /* increment frequency of given code by one, and update tree */ static void update (short c) { short i, j, k, l; if (freq[R] == MAX_FREQ) { reconst (); } c = prnt[c + T]; do { k = ++freq[c]; /* if the order is disturbed, exchange nodes */ if (k > freq[l = c + 1]) { while (k > freq[++l]) ; l--; freq[c] = freq[l]; freq[l] = k; i = fils[c]; prnt[i] = l; if (i < T) prnt[i + 1] = l; j = fils[l]; fils[l] = i; prnt[j] = c; if (j < T) prnt[j + 1] = c; fils[c] = j; c = l; } } while ((c = prnt[c]) != 0); /* repeat up to root */ } static ushort code, len; static void EncodeChar (ushort c) { ushort i; short j, k; i = 0; j = 0; k = prnt[c + T]; /* travel from leaf to root */ do { i >>= 1; /* if node's address is odd-numbered, choose bigger brother node */ if (k & 1) i += 0x8000; j++; } while ((k = prnt[k]) != R); Putcode (j, i); code = i; len = j; update (c); } static void EncodePosition (ushort c) { ushort i; /* output upper 6 bits by table lookup */ i = c >> 6; Putcode (p_len[i], (ushort) p_code[i] << 8); /* output lower 6 bits verbatim */ Putcode (6, (c & 0x3f) << 10); } static void EncodeEnd (void) { if (putlen) { if (crc_fputc (putbuf >> 8, outfile) == EOF) { write_huf_error (ou_f); } codesize++; } } static short DecodeChar (void) { ushort c; c = fils[R]; /* travel from root to leaf, */ /* choosing the smaller child node (fils[]) if the read bit is 0, */ /* the bigger (fils[]+1} if 1 */ while (c < T) { c += GetBit (); c = fils[c]; } c -= T; update (c); return c; } static short DecodePosition (void) { ushort i, j, c; /* recover upper 6 bits from table */ i = GetByte (); c = (ushort) d_code[i] << 6; j = d_len[i]; /* read lower 6 bits verbatim */ j -= 2; while (j--) { i = (i << 1) + GetBit (); } return c | (i & 0x3f); } /* compression */ static void Encode (short voie) /* compression */ { char temp[128]; unsigned int filesize; short i, c, len, r, s, last_match_length; head = bin_header; fflush (infile); #if defined(__MSDOS__) || defined(__WINDOWS__) filesize = filelength (fileno (infile)) + (long) headlen; #else filesize = headlen; /* Read the file to compute the filesize under unix. Terminations = CRLF */ while ((c = getc (infile)) != EOF) { /* Ignore '\r' */ if (c == '\r') continue; /* LF -> CRLF */ if (c == '\n') ++filesize; ++filesize; } rewind (infile); #endif textsize = 0; /* rewind and re-read */ crc = 0; /* CRC and textsize are 0 : no need to swap them for motorola */ if (basic) { if (fwrite (&textsize, sizeof textsize, 1, outfile) < 1) write_huf_error (ou_f); /* output size of text */ } else { if (fwrite (&crc, sizeof (crc), 1, outfile) < 1) write_huf_error (ou_f); /* output size of text */ memcpy (temp, &filesize, sizeof (filesize)); if (moto) { for (i = sizeof (filesize) -1 ; i >= 0 ; i-- ) crc_fputc (temp[i], outfile); } else { for (i = 0; i < sizeof (filesize); i++) crc_fputc (temp[i], outfile); } } StartHuff (); InitTree (); s = 0; r = N - F; for (i = s; i < r; i++) text_buf[i] = ' '; for (len = 0; len < F && (c = take ()) != EOF; len++) text_buf[r + len] = c; textsize = len; for (i = 1; i <= F; i++) InsertNode (r - i); InsertNode (r); do { if (match_length > len) match_length = len; if (match_length <= THRESHOLD) { match_length = 1; EncodeChar (text_buf[r]); } else { EncodeChar (255 - THRESHOLD + match_length); EncodePosition (match_position); } last_match_length = match_length; for (i = 0; i < last_match_length && (c = take ()) != EOF; i++) { DeleteNode (s); text_buf[s] = c; if (s < F - 1) text_buf[s + N] = c; s = (s + 1) & (N - 1); r = (r + 1) & (N - 1); InsertNode (r); } if ((textsize += i) > printcount) { compress_display (1, (textsize * 100) / filesize, numero); printcount += 500; } while (i++ < last_match_length) { DeleteNode (s); s = (s + 1) & (N - 1); r = (r + 1) & (N - 1); if (--len) InsertNode (r); } } while (len > 0); EncodeEnd (); compress_display (1, 100, numero); /* Ecrit le crc du fichier original */ deb_io (); rewind (outfile); if (basic) { memcpy (temp, &textsize, sizeof (textsize)); if (moto) { for (i = sizeof (textsize) -1 ; i >= 0 ; i-- ) crc_fputc (temp[i], outfile); } else { for (i = 0; i < sizeof (textsize); i++) crc_fputc (temp[i], outfile); } } else { if (moto) crc = xendien (crc); if (fwrite (&crc, sizeof (crc), 1, outfile) < 1) write_huf_error (ou_f); /* output crc */ } if (filesize != textsize) { cprintf ("Phase error !\r\n"); } aff_header (voie); if (numero) sprintf (temp, "Compress #%ld In: %-6d- Out: %-6d- Compress: %d %%\r\n", numero, textsize, codesize, 100 - ((codesize * 100) / textsize)); else sprintf (temp, "Compress XFwd In: %-6d- Out: %-6d- Compress: %d %%\r\n", textsize, codesize, 100 - ((codesize * 100) / textsize)); winputs (voie, W_SNDT, temp); textsize = codesize + 4; fin_io (); } void check_bin (bullist * pbul, char *ptr) { #define NB_PATTERN 8 #define LG_PATTERN 6 static char pattern[NB_PATTERN][LG_PATTERN + 1] = { " go_7+", " go_te", "\000\000\000\000\000\000", "\000\000\000\000\000\000", "\000\000\000\000\000\000", "\000\000\000\000\000\000", "\000\000\000\000\000\000", "\000\000\000\000\000\000" }; short i; /* Checks for data message and validates bin flag */ for (i = 0; i < NB_PATTERN; i++) { if (!(*pattern[i])) break; if (strncmp (pattern[i], ptr, LG_PATTERN) == 0) { pbul->bin = 1; } } } static void test_ligne (int voie, char *ligne) { char deb[5]; strn_cpy (4, deb, ligne); if ((svoie[voie]->m_ack) && (strncmp (deb, "/ACK", 4) == 0)) { svoie[voie]->m_ack = 2; } else if ((svoie[voie]->entete) && (strncmp (deb, "R:", 2) == 0)) { analyse_header (voie, ligne); } else if (*ligne) { check_bin (pbul, ligne); svoie[voie]->entete = 0; } } static int Decode (int voie) /* recover */ { char temp[128]; char ligne[82]; short i, j, k, r, c; short pos = 0; ushort fcrc; unsigned long int count; deb_io (); fseek (infile, 0L, 2); codesize = ftell (infile) - sizeof (textsize); if (!basic) { fseek (infile, 20L, 0); textsize = -1; crc = 0; if ((svoie[voie]->fbb >= 2) && (fread (&fcrc, sizeof fcrc, 1, infile) < 1)) { if (!svoie[CONSOLE]->sta.connect) cprintf ("File empty (%d)!!\r\n", textsize); fin_io (); return (0); } if (moto) fcrc = xendien (fcrc); memset (temp, 0, sizeof (textsize)); if (moto) { for (i = sizeof (textsize) -1 ; i >= 0 ; i-- ) temp[i] = crc_fgetc (infile); } else { for (i = 0; i < sizeof (textsize); i++) temp[i] = crc_fgetc (infile); } memcpy (&textsize, temp, sizeof (textsize)); if ((textsize == 0) || (textsize == 0xffffffff)) { if (!svoie[CONSOLE]->sta.connect) cprintf ("File empty (%d)!!\r\n", textsize); fin_io (); return (0); } if (textsize > (100 * codesize)) { if (!svoie[CONSOLE]->sta.connect) cprintf ("xFBBd Decode basic:%d Cannot decompress to %d bytes!!\r\n", basic, textsize); cprintf ("codesize :%d textsize : %d sizeof %u\r\n", codesize, textsize, (unsigned int)sizeof(textsize)); fin_io (); return (0); } } else { rewind (infile); if ((fread (&textsize, sizeof textsize, 1, infile) < 1) || (textsize == 0)) { if (!svoie[CONSOLE]->sta.connect) cprintf ("File empty (%d)!!\r\n", textsize); fin_io (); return (0); } if (moto) textsize = xendienl (textsize); if (textsize > (100 * codesize)) { if (!svoie[CONSOLE]->sta.connect) cprintf ("xFBBd Decode basic:%d Cannot decompress to %d bytes!!\r\n", basic, textsize); cprintf ("codesize :%d textsize : %d sizeof %u\r\n", codesize, textsize, (unsigned int)sizeof(textsize)); fin_io (); return (0); } } fin_io (); StartHuff (); for (i = 0; i < N - F; i++) text_buf[i] = ' '; r = N - F; for (count = 0; count < textsize;) { c = DecodeChar (); if (c < 256) { if (!basic) { if ((c == '\r') || (c == '\n')) { ligne[pos] = '\0'; test_ligne (voie, ligne); pos = 0; } else if (pos < 80) { ligne[pos++] = c; } } if ((c == '\n') || (c == '\r')) { if ((crlf == 0) || (crlf == c)) { crlf = c; if (fputc ('\r', outfile) == EOF) { write_huf_error (ou_f); } if (fputc ('\n', outfile) == EOF) { write_huf_error (ou_f); } } } else { crlf = 0; if (fputc (c, outfile) == EOF) { write_huf_error (ou_f); } } text_buf[r++] = c; r &= (N - 1); count++; } else { i = (r - DecodePosition () - 1) & (N - 1); j = c - 255 + THRESHOLD; for (k = 0; k < j; k++) { c = text_buf[(i + k) & (N - 1)]; if (!basic) { if ((c == '\r') || (c == '\n')) { ligne[pos] = '\0'; test_ligne (voie, ligne); pos = 0; } else if (pos < 80) { ligne[pos++] = c; } } /* if (fputc (c, outfile) == EOF) { write_huf_error (ou_f); } */ if ((c == '\n') || (c == '\r')) { if ((crlf == 0) || (crlf == c)) { crlf = c; if (fputc ('\r', outfile) == EOF) { write_huf_error (ou_f); } if (fputc ('\n', outfile) == EOF) { write_huf_error (ou_f); } } } else { crlf = 0; if (fputc (c, outfile) == EOF) { write_huf_error (ou_f); } } text_buf[r++] = c; r &= (N - 1); count++; } } if (count > printcount) { compress_display (2, (count * 100) / textsize, numero); printcount += 500; } } compress_display (2, 100, numero); deb_io (); aff_header (voie); if (numero) sprintf (temp, "Decompress #%ld In: %-6d- Out: %-6d- Compress: %d %%\r\n", numero, codesize, textsize, 100 - ((codesize * 100) / textsize)); else sprintf (temp, "Decompress XFwd In: %-6d- Out: %-6d- Compress: %d %%\r\n", codesize, textsize, 100 - ((codesize * 100) / textsize)); winputs (voie, W_RCVT, temp); if ((!basic) && (svoie[voie]->fbb >= 2) && (crc != fcrc)) { if (!svoie[CONSOLE]->sta.connect) cprintf ("CRC Error : file %06x, computed %06x\r\n", fcrc, crc); fin_io (); return (0); } fin_io (); return (1); } void end_lzhuf (void) { if (init_huf) { m_libere (lson, sizeof (short) * (N + 1)); m_libere (rson, sizeof (short) * (N + 257)); m_libere (dad, sizeof (short) * (N + 1)); m_libere (prnt, sizeof (short) * (T + N_CHAR)); m_libere (fils, sizeof (short) * T); m_libere (freq, sizeof (ushort) * (T + 1)); init_huf = 0; } } static void alloue_lzhuf_buffers (void) { lson = (short *) m_alloue (sizeof (short) * (N + 1)); rson = (short *) m_alloue (sizeof (short) * (N + 257)); dad = (short *) m_alloue (sizeof (short) * (N + 1)); prnt = (short *) m_alloue (sizeof (short) * (T + N_CHAR)); fils = (short *) m_alloue (sizeof (short) * T); freq = (ushort *) m_alloue (sizeof (ushort) * (T + 1)); init_huf = 1; } static void init_huffman (void) { static int init = 0; if (!init) { alloue_lzhuf_buffers (); init = 1; } } long lzhuf (desc_huf * huf) { char bin_file[128]; char tmp_file[128]; char asc_file[128]; init_huffman (); basic = 0; crlf = 0; numero = huf->bull->numero; pbul = huf->bull; mess_name (MBINDIR, numero, bin_file); mess_name (MESSDIR, numero, asc_file); if (huf->mode == ENCODE) { temp_name (huf->voie, tmp_file); in_f = asc_file; ou_f = tmp_file; deb_io (); entete_mess_fwd (pbul, huf->header); headlen = scan_header (msg_header); fin_io (); } else if (huf->mode == DECODE) { strcpy (tmp_file, svoie[huf->voie]->sr_fic); in_f = tmp_file; ou_f = asc_file; } if ((outfile = fopen (ou_f, "wb")) == NULL) write_error (ou_f); if ((infile = fopen (in_f, "rb")) == NULL) { fprintf (outfile, "\r\nMessage file %s missing in %s\r\n", in_f, mycall); fclose (outfile); return (40L); } textsize = 0; /* text size counter */ codesize = 0; /* code size counter */ printcount = 0; /* counter for reporting progress every 1K bytes */ getbuf = getlen = putbuf = putlen = 0; if (huf->mode == ENCODE) { Encode (huf->voie); } else if (huf->mode == DECODE) { if (!Decode (huf->voie)) textsize = -1L; } fclose (infile); fclose (outfile); deb_io (); if (huf->mode == ENCODE) { rename_temp (huf->voie, bin_file); } tot_mem = 0; free_mem (); compress_display (0, 0, numero); fin_io (); return (textsize); } long basic_lzhuf (int mode, char *in_file, char *out_file) { chck = 0; basic = 1; crlf = 0; init_huffman (); in_f = in_file; ou_f = out_file; if ((infile = fopen (in_f, "rb")) == NULL) return 0L; if ((outfile = fopen (ou_f, "wb")) == NULL) write_error (ou_f); numero = 0; textsize = 0; /* text size counter */ codesize = 0; /* code size counter */ printcount = 0; /* counter for reporting progress every 1K bytes */ getbuf = getlen = putbuf = putlen = 0; if (mode == ENCODE) { Encode (voiecur); } else if (mode == DECODE) { if (!Decode (voiecur)) textsize = -1L; } fclose (infile); fclose (outfile); tot_mem = 0; free_mem (); compress_display (0, 0, 0); svoie[voiecur]->checksum = chck; return (textsize); } fbb-7.0.10/src/drv_hst.c0000644000175000017500000010574213615603431011670 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * PTC-II HostMode interface * * It has two ports + 1 pactor channel * * Pactor channel is renumbered to 31, other ports are limited to 30 channels */ #include #include /* Caractere de header */ #define HST_CHAR 170 #define PACTOR_ST 254 /* #define DEBUG_HST */ #define STATUS(p) (p_com[(int)p_port[p].ccom].pactor_st) static char pactor[5]; static int hst_end_host (int); static int hst_send_data (int); static int hst_send_dt (int, int, char *, int); static int hst_send_ui (int, char *, int, Beacon *); static int hst_sndcmd (int, int, char *, int); static int nb_waiting (int); static int recv_hst (int, int, int *, char *); static int hst_busy (int port, int *canal, int force); static void hst_get_ui (int, char *, ui_header *); static void hst_sonde (int, int); static int hst_compteur (int); static unsigned short *crctab; #define updcrc(cp, crc) (((crc >> 8) & 0xff) ^ crctab[((crc ^ (cp & 0xff)) & 0xff)]) static int DebugCh = 0; static void DebugCmd (int port) { int type = (p_port[port].last->cmd == COMMAND) ? 1 : 0; if (DebugCh) { type |= p_port[port].last->compteur; } } #ifdef DEBUG_HST static void dump_data (FILE * fptr, char *ptr, int nb) { int i; int j; for (i = 0; i < nb; i += 16) { fprintf (fptr, "%03d ", i); for (j = 0; j < 16; j++) { if ((i + j) < nb) fprintf (fptr, "%02x ", ptr[i + j] & 0xff); else fprintf (fptr, " "); } for (j = 0; j < 16; j++) { char c = ptr[i + j] & 0xff; if ((i + j) < nb) putc (isprint (c) ? c : '.', fptr); else putc (' ', fptr); } putc ('\n', fptr); } } static void bin_recv (char *ptr, int nb) { FILE *fptr = fopen ("/tmp/debug.hst", "a+b"); long temps = time (NULL); if (fptr == NULL) return; fprintf (fptr, "\nRX=%-3d %s", nb, asctime (localtime (&temps))); dump_data (fptr, ptr, nb); fclose (fptr); } static void bin_send (char *ptr, int nb) { FILE *fptr = fopen ("/tmp/debug.hst", "a+b"); long temps = time (NULL); if (fptr == NULL) return; fprintf (fptr, "\nTX=%-3d %s", nb, asctime (localtime (&temps))); dump_data (fptr, ptr, nb); fclose (fptr); } #endif static void initcrc (void) { unsigned int i, j; unsigned short accu, data; crctab = malloc (256 * sizeof (unsigned short)); for (i = 0; i < 256; i++) { accu = 0; data = i; for (j = 0; j < 8; j++) { if ((data ^ accu) & 1) accu = (accu >> 1) ^ 0x8408; else accu = accu >> 1; data >>= 1; } crctab[i] = accu; } } int hst_vide (int port, int echo) { int c, nb = 0; df ("vide", 2); if ((DEBUG) || (!p_port[port].pvalid)) { deb_io (); cprintf ("Erreur port %d!\n", port); fin_io (); ff (); return (0); } p_port[port].portind = 0; tempo = 20; deb_io (); while (tempo) { if ((c = rec_tnc (port)) >= 0) { if (echo) { #ifdef __FBBDOS__ putch (c); if (c == '\r') putch ('\n'); #endif } tempo = 20; ++nb; } #ifdef __WINDOWS__ else { BWinSleep (100); if (tempo > 0) --tempo; } #endif #ifdef __linux__ else { usleep (100000); if (tempo > 0) --tempo; } #endif } fin_io (); ff (); return (nb); } /* * Fonctions g‚n‚riques du driver */ int opn_hst (int port, int nb) { static int init = 0; long bt; int reset = 4; int nb_can; int i; int ok; char s[80]; /* Only one INIT on this tnc */ p_port[port].last = NULL; while (reset) { ok = 0; sprintf (s, "Init PORT %d COM%d-%d PTCII", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif if (init) { sleep_ (1); return (1); } init = 1; initcrc (); sprintf (s, "Init PORT %d COM%d-%d PTCII", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif /* sleep_(1); */ tncstr (port, "\r\033\rRESTART\r", 0); bt = btime () + 100; do { if (rec_tnc (port) < 0) { ok = 1; break; } } while (btime () < bt); hst_vide (port, 1); sprintf (s, "\r\033\rPTC %d\r", PACTOR_CH); tncstr (port, s, 0); sprintf (pactor, "(%d)", PACTOR_CH); bt = btime () + 20; do { if (rec_tnc (port) < 0) { ok = 1; break; } } while (btime () < bt); if (ok == 1) break; --reset; } sprintf (s, "Clear PORT %d COM%d-%d PTCII", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif tncstr (port, "\033JHOST4\r", 0); sprintf (s, "Prog PORT %d COM%d-%d PTCII", port, p_port[port].ccom, p_port[port].ccanal); hst_vide (port, 1); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #else cprintf ("%s\r\n", s); #endif /* Parametres par defaut */ /* sprintf (s, "#PTC %d\r", PACTOR_CH); hst_sndcmd (port, 0, (char *) s, 1); hst_sndcmd (port, 0, (char *) s, 1); */ /* All channels callsign */ /* Why send the same command twice? Dave van der Locht 31-01-2020 */ sprintf (s, "I %s-%d", mycall, myssid); hst_sndcmd (port, 0, (char *) s, 1); hst_sndcmd (port, 0, (char *) s, 1); /* Port pactor */ sprintf (s, "I %s", mycall); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); if (DRSI (port)) { nb_can = 0; for (i = 1; i < NBPORT; i++) { if (p_port[i].ccom == p_port[port].ccom) { nb_can += p_port[i].nb_voies; } } } else { nb_can = p_port[port].nb_voies; } sprintf (s, "Y %d", nb_can); hst_sndcmd (port, 0, (char *) s, 1); sprintf (s, "O %d", p_port[port].frame); hst_sndcmd (port, 0, (char *) s, 1); sprintf (s, "%%L 0"); hst_sndcmd (port, 0, (char *) s, 1); sprintf (s, "#PD 0"); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); sprintf (s, "#UML 0"); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); sprintf (s, "#BOX 0"); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); sprintf (s, "#REM 0"); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); sprintf (s, "#MA 0"); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); sprintf (s, "#CMSG 0"); hst_sndcmd (port, PACTOR_CH, (char *) s, 1); return (ok); } void debug_state (int port) { } static void FAR hst_iss (int port, void *userdata) { /* Automatic break_in */ hst_sndcmd (port, PACTOR_CH, "%I", 2); p_port[port].t_iss = NULL; } static int is_data (int port) { PortData *cmd = p_port[port].cmd; while (cmd) { if (cmd->cmd == DATA) { return (1); } cmd = cmd->next; } return (0); } static void test_timings (int port) { if (!ONLINE (port) || (p_port[port].ccanal != 0)) return; if (!ISS (port) && (is_data (port))) { if (!p_port[port].t_iss) { p_port[port].t_iss = add_timer (10, port, (void FAR *) hst_iss, NULL); } } else { del_timer (p_port[port].t_iss); p_port[port].t_iss = NULL; } } int rcv_hst (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { int lgbuf=0; int can = p_port[*port].cur_can & 0xff; int code; int valid; int next = 1; char *ptr; /* Header provisoire */ static ui_header loc_ui[NBPORT]; *cmd = INVCMD; if ((BUSY (*port)) && (hst_busy (*port, canal, FALSE))) { *cmd = COMMAND; sprintf (buffer, "(%d) FREQ-BUSY fm PACTOR", *canal); *len = strlen (buffer); return (1); } /* Test si c'est le port correspondant au MUX ... */ if ((operationnel) && (*port != p_com[(int)p_port[*port].ccom].mult_sel)) return (-1); if ((p_port[*port].polling == 0) && (p_port[*port].last == NULL)) { hst_sonde (*port, next); return (0); } valid = 0; deb_io (); code = recv_hst (*port, can, &lgbuf, buffer); fin_io (); switch (code) { case 0: *cmd = NOCMD; *len = 0; p_port[*port].polling = 0; if (p_port[*port].last_cmde == 'G') { p_port[*port].wait[can] = 0; } break; case 1: switch (p_port[*port].last_cmde) { case 'L': { /* Retour de statistiques */ stat_ch sta; int nbmes, nbtra, nbatt, nback, nbret, con; valid = 2; *cmd = STATS; *canal = can; *len = 0; sscanf (buffer, "%d%d%d%d%d%d", &nbmes, &nbtra, &nbatt, &nback, &nbret, &con); memset (&sta, 0, sizeof (sta)); sta.stat = con; sta.ret = nbret; p_port[*port].wait[can] = nbmes + nbtra; sta.ack = nbatt + nback + nb_waiting (*port); memcpy (buffer, &sta, sizeof (sta)); if (p_port[*port].wait[can]) next = 0; } break; case 'B': { valid = 2; *cmd = NBBUF; *len = 0; *((int *) buffer) = atoi (buffer); break; } case 'T': { valid = 2; *cmd = NBCHR; *len = 0; *canal = PACTOR_CH; *((long *) buffer) = atol (buffer); break; } default: valid = 2; *len = lgbuf; *cmd = ECHOCMD; break; } p_port[*port].polling = 0; break; case 2: valid = 2; *len = lgbuf; *cmd = ERRCMD; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 3: valid = 2; *cmd = COMMAND; *canal = can; *len = lgbuf; p_port[*port].polling = 0; if (strncmp (buffer, pactor, strlen (pactor)) == 0) { char *scan; scan = strchr (buffer, ':'); if (scan && (scan != buffer)) { --scan; *scan = '0'; } } ptr = strstr (buffer, " CONNECTED"); if (ptr && (p_port[*port].ccanal == 0)) { /* Connexion sur le pactor. Forcer le statut ! */ int com = p_port[*port].ccom; p_com[com].pactor_st = 0xa2; debug_state (*port); } if ((ptr) && (hst_busy (*port, canal, TRUE))) { memcpy (ptr, " RECONNECT", 10); } if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 4: hst_get_ui (*port, buffer, ui); valid = 1; *cmd = UNPROTO; *canal = can; *len = 0; p_port[*port].idem = 1; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 5: hst_get_ui (*port, buffer, ui); /* Sauvegarde l'UI */ loc_ui[*port] = *ui; valid = 0; next = 0; p_port[*port].polling = 0; break; case 6: /* Recupere l'UI du coup precedant */ *ui = loc_ui[*port]; sprintf (ui->txt, " (%d)", lgbuf); valid = 1; *cmd = UNPROTO; *canal = can; *len = lgbuf; p_port[*port].idem = 1; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; case 7: if (can == PACTOR_ST) { int com = p_port[*port].ccom; p_com[com].pactor_st = *buffer; debug_state (*port); test_timings (*port); p_port[*port].polling = 0; hst_sonde (*port, next); return (0); } valid = 1; *cmd = DATA; { int res = ONLINE (*port); if ((can != PACTOR_CH) || (res)) { *cmd = DATA; } else { *cmd = UNPROTO; memset (ui, 0, sizeof (ui_header)); ui->port = *port; strn_cpy (11, ui->from, "PACTOR"); ui->ui = 1; } } *canal = can; *len = lgbuf; p_port[*port].idem = 1; p_port[*port].polling = 0; if (p_port[*port].wait[can]) --p_port[*port].wait[can]; break; } /* Poll du TNC pour la prochaine fois */ if (code != -1) { if (p_port[*port].wait[can]) next = 0; hst_sonde (*port, next); } return (valid); } int cls_hst (int port) { int i; /* Vide la file des commandes en attente pour tous les ports du TNC */ for (i = 1; i < NBPORT; i++) { if ((HST (i)) && (p_port[port].ccom == p_port[i].ccom)) { while (p_port[i].cmd) { PortData *cmd = p_port[i].cmd; p_port[i].cur_can = cmd->canal; switch (cmd->cmd) { case COMMAND: p_port[i].last = cmd; p_port[i].last->compteur = 0xc0; hst_send_data (i); /* Attend la reponse 1 seconde */ sleep_ (1); /* Vide le buffer */ while (rec_tnc (port) != -1); /* La reponse a ete lue et ignoree ... */ break; default: break; } p_port[i].cmd = cmd->next; m_libere (cmd, sizeof (PortData)); p_port[i].last_cmde = '\0'; } } } /* Fin du mode host */ hst_end_host (port); return (1); } int sta_hst (int port, int canal, int cmd, void *ptr) { int val; /* Pactor port */ if (p_port[port].moport & 0x80) canal = PACTOR_CH; switch (cmd) { /* case TNCSTAT : return(lit_stat_hst(port, canal, (stat_ch *)ptr)); */ case TOR: canal = PACTOR_CH; val = (hst_sndcmd (port, canal, (char *) ptr, 0) != -1); return (val); case SNDCMD: return (hst_sndcmd (port, canal, (char *) ptr, 0) != -1); case ECHOCMD: return (hst_sndcmd (port, canal, (char *) ptr, 1) != -1); case PORTCMD: return (hst_sndcmd (port, 0, (char *) ptr, 1) != -1); case PACLEN: *((int *) ptr) = 250; return (1); } return (0); } int snd_hst (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ret = 0; df ("snd_hst", 8); if (p_port[port].synchro > 256) return (0); /* Pactor port */ if (p_port[port].moport & 0x80) canal = PACTOR_CH; switch (cmd) { case COMMAND: break; case DATA: ret = hst_send_dt (port, canal, buffer, len); break; case UNPROTO: ret = hst_send_ui (port, buffer, len, ptr); break; } ff (); return (ret); } /* Fonctions locales */ static int hst_end_host (int port) { PortData *cmd; static int done = 0; if (done) return (1); done = 1; cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->canal = 0; cmd->cmd = COMMAND; cmd->len = 2; strcpy (cmd->buf, "MN"); p_port[port].last = cmd; p_port[port].last->compteur = hst_compteur (port); hst_send_data (port); m_libere (p_port[port].last, sizeof (PortData)); cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->canal = 0; cmd->cmd = COMMAND; cmd->len = 6; strcpy (cmd->buf, "JHOST0"); p_port[port].last = cmd; p_port[port].last->compteur = hst_compteur (port); hst_send_data (port); m_libere (p_port[port].last, sizeof (PortData)); p_port[port].last = NULL; return (1); } /* * Fonctions locales */ static int hst_compteur (int port) { static int val = 2; int com = p_port[port].ccom; if (val == 2) { p_com[com].compteur = 0xc0; } else { p_com[com].compteur = (val) ? 0x80 : 0; } val = !val; return p_com[com].compteur; } static void warning (unsigned numero, char *texte) { } /* Retourne le port logique correspondant au lport physique d'un TNC static int global_port(int com, int lport) { int p; for (p = 1 ; p < NBPORT ; p++) { if ((p_port[p].ccom == com) && (p_port[p].ccanal == lport)) { return (p); } } return(1); } */ static int iss (int port) { return (ISS (port)); } static int online (int port) { return (ONLINE (port)); } static PortData *get_cmd (int port) { PortData *prc = NULL; PortData *cmd = p_port[port].cmd; /* On envoie les data ou le CHO uniquement si le PACTOR est en ISS */ if (p_port[port].ccanal == 0) { /* Canal PACTOR */ while (cmd) { if ((!online (port)) || (iss (port)) || ((cmd->cmd == COMMAND) && (strcmp (cmd->buf, "%O") != 0))) { if (prc) prc->next = cmd->next; else p_port[port].cmd = cmd->next; return (cmd); } prc = cmd; cmd = cmd->next; } return (NULL); } else if (cmd) { p_port[port].cmd = cmd->next; } return (cmd); } static void hst_sonde (int pp, int next) { static int cptr[NBPORT]; static int first = 1; static int debug_cmd = 50; PortData *cmd = NULL; if ((pp < 0) || (pp >= NBPORT)) return; if (first) { /* Initializes static variables */ int i; for (i = 0; i < NBPORT; i++) { cptr[i] = 0; } first = 0; } /* if (p_port[pp].cur_can == 0xff) p_port[pp].cur_can = 0xfe; */ if (p_port[pp].last) { return; } if (next == 0) { cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->canal = p_port[pp].cur_can; cmd->cmd = COMMAND; cmd->len = 1; strcpy (cmd->buf, "G"); p_port[pp].last = cmd; p_port[pp].last_cmde = 'G'; } else if ((cmd = get_cmd (pp)) != NULL) { /* Il y a une commande a envoyer */ if (cmd->cmd != COMMAND) cptr[pp] = 0; p_port[pp].last = cmd; if (strcmp (cmd->buf, "%T") == 0) p_port[pp].last_cmde = 'T'; else p_port[pp].last_cmde = '\0'; } else if (operationnel == 1) { if ((cptr[pp] == 0) && (p_port[pp].cur_can != PACTOR_ST)) { cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->canal = p_port[pp].cur_can; cmd->cmd = COMMAND; cmd->len = 2; strcpy (cmd->buf, "@B"); p_port[pp].last = cmd; p_port[pp].last_cmde = 'B'; cptr[pp] = 50; } else if (p_port[pp].cur_can == PACTOR_CH) { /* Status */ cmd = (PortData *) m_alloue (sizeof (PortData)); p_port[pp].cur_can = PACTOR_ST; cmd->canal = p_port[pp].cur_can; cmd->cmd = COMMAND; cmd->len = 1; strcpy (cmd->buf, "G"); p_port[pp].last = cmd; p_port[pp].last_cmde = 'G'; } else { cmd = (PortData *) m_alloue (sizeof (PortData)); /* Passe au canal suivant */ if ((p_port[pp].idem == 0) || (p_port[pp].cur_can == PACTOR_ST)) { int max; if (p_port[pp].moport & 0x80) max = 1; else { max = p_port[pp].tt_can; } ++(p_port[pp].cur_can); if (p_port[pp].cur_can > max) { int mux_ch; int i; int com; int first_mux; int last_mux; /* Passe eventuellement au PORT/MUX suivant */ mux_ch = p_port[pp].ccanal; com = p_port[pp].ccom; /* first_mux = (DRSI (pp)) ? 0 : 1; last_mux = (DRSI (pp)) ? 7 : 4; */ first_mux = 0; last_mux = 2; for (i = first_mux; i < last_mux; i++) { ++mux_ch; if (mux_ch > last_mux) mux_ch = first_mux; if (p_com[com].multi[mux_ch]) { pp = p_com[com].multi[mux_ch]; p_com[com].mult_sel = pp; break; } } p_port[pp].cur_can = 0; /* Fait la somme des canaux deja balayes (1 seul TNC !!) */ if (p_port[pp].ccanal == 0) { /* Inclut le monitoring */ p_port[pp].cur_can = 0; } else { p_port[pp].cur_can = 1; for (i = 1; i < pp; i++) { if ((HST (i)) && (!IS_PACTOR (i)) && (p_port[i].ccom == p_port[pp].ccom)) { p_port[pp].cur_can += p_port[i].nb_voies; } } } } if ((p_port[pp].cur_can == 1) && (p_port[pp].moport & 0x80)) p_port[pp].cur_can = PACTOR_CH; } else p_port[pp].idem = 0; cmd->canal = p_port[pp].cur_can; cmd->cmd = COMMAND; cmd->len = 1; strcpy (cmd->buf, "L"); p_port[pp].last = cmd; p_port[pp].last_cmde = 'L'; if (cptr[pp]) --cptr[pp]; } } DebugCh = 0; if (debug_cmd > 0) { DebugCh = 1; --debug_cmd; } p_port[pp].last->compteur = hst_compteur (pp); hst_send_data (pp); } static int hst_busy (int port, int *canal, int force) { if (p_port[port].ccanal != 0) return (0); *canal = PACTOR_CH; if (p_port[port].t_busy) { m_libere (p_port[port].t_busy->userdata, sizeof (PortData)); del_timer (p_port[port].t_busy); p_port[port].t_busy = NULL; return (1); } else if (force && (p_port[port].t_wait)) { /* Supprimer le timer wait */ m_libere (p_port[port].t_wait->userdata, sizeof (PortData)); del_timer (p_port[port].t_wait); p_port[port].t_wait = NULL; return (1); } return (0); } static void FAR hst_startscan (int port, PortData * command) { PortData *cmd = p_port[port].cmd; if (ISS (port)) { /* Still sending - postpone the command */ add_timer (1, port, (void FAR *) hst_startscan, command); return; } /* Insert the command in top of queue */ command->next = cmd; p_port[port].cmd = command; pactor_scan[port] = 1; } static void FAR hst_connect (int port, PortData * command) { PortData *cmd = p_port[port].cmd; p_port[port].t_busy = NULL; if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = command; } else /*cmd = */ p_port[port].cmd = command; aff_forward (); } static void FAR hst_wait (int port, PortData * command) { p_port[port].t_wait = NULL; if (p_port[port].t_busy) { m_libere (p_port[port].t_busy->userdata, sizeof (PortData)); del_timer (p_port[port].t_busy); } p_port[port].t_busy = add_timer (10, port, (void FAR *) hst_connect, command); aff_forward (); } static int hst_sndcmd (int port, int canal, char *buffer, int retour) { PortData *cmd = p_port[port].cmd; int nb; char cmde[80]; char scan[80]; char val[80]; char temp[80]; /* if (p_port[port].ccanal == 0) canal = PACTOR_CH; */ if (strlen (buffer) == 0) return (0); /* Demande de connexion du canal pactor : verifier d'abord le status */ if (*buffer == 'C') { if (canal == PACTOR_CH) { /* Armer le timer = 10 secondes */ cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->next = NULL; cmd->canal = canal; cmd->cmd = COMMAND; cmd->len = strlen (buffer); strcpy (cmd->buf, buffer); if (p_port[port].t_wait) { m_libere (p_port[port].t_wait->userdata, sizeof (PortData)); del_timer (p_port[port].t_wait); } p_port[port].t_wait = add_timer (7, port, (void FAR *) hst_wait, cmd); return (1); } else if (strchr (buffer, ':') == NULL) { /* Selectionner le bon port */ ++buffer; while (isspace (*buffer)) ++buffer; sprintf (temp, "C %d:%s", p_port[port].ccanal, buffer); buffer = temp; } } *scan = '\0'; *val = '\0'; nb = sscanf (buffer, "%s %s %s", cmde, scan, val); if (cmde[0] == '!') cmde[0] = '#'; if ((nb == 3) && (strcmpi (cmde, "#TRX") == 0) && (strncmpi (scan, "SCAN", strlen (scan)) == 0)) { if (isdigit (*val)) { if (atoi (val) > 0) { cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->next = NULL; cmd->canal = canal; cmd->cmd = COMMAND; cmd->len = strlen (buffer); strcpy (cmd->buf, buffer); cmd->buf[0] = '#'; /* LA7ECA Hack */ hst_startscan (port, cmd); return 1; } pactor_scan[port] = 0; } } if (strcmp (cmde, "%O") == 0) { /* Un seul change-over en queue ! Enleve le precedent ... */ PortData *pr = NULL; cmd = p_port[port].cmd; while (cmd) { if (strcmp (cmd->buf, "%O") == 0) { if (pr) { pr->next = cmd->next; } else { p_port[port].cmd = cmd->next; } /* Libere la structure */ m_libere (cmd, sizeof (PortData)); break; } pr = cmd; cmd = cmd->next; } } cmd = p_port[port].cmd; if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else { p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd = p_port[port].cmd; } strcpy (cmd->buf, buffer); if (cmd->buf[0] == '!') cmd->buf[0] = '#'; if ((nb == 2) && (strncmpi (cmde, "#MYPAC", 6) == 0)) { sprintf(cmd->buf, "I%s", scan); canal = PACTOR_CH; } cmd->next = NULL; cmd->canal = canal; cmd->cmd = COMMAND; cmd->len = strlen (cmd->buf); return 1; } static int hst_send_dt (int port, int canal, char *buffer, int len) { PortData *cmd = p_port[port].cmd; if (len <= 0) return (0); if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else cmd = p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->next = NULL; cmd->canal = canal; cmd->cmd = DATA; cmd->len = len > 256 ? 256 : len; memcpy (cmd->buf, buffer, cmd->len); return (1); } static int hst_send_ui (int port, char *buffer, int len, Beacon * beacon) { char commande[300]; char s[80]; int i; int ptport; int canal; PortData *cmd; if (len <= 0) return (0); if (p_port[port].ccanal == 0) { /* No beacon on pactor port ! */ return (1); } else { ptport = p_port[port].ccanal; canal = 0; } /* Selection du port */ sprintf (commande, "%%P%d", ptport); cmd = p_port[port].cmd; if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else cmd = p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->canal = canal; cmd->cmd = COMMAND; cmd->next = NULL; cmd->len = strlen (commande); strcpy (cmd->buf, commande); sprintf (commande, "C %d:%s-%d", ptport, beacon->desti.call, beacon->desti.num); for (i = 0; i < 8; i++) { if (*beacon->digi[i].call) { if (i == 0) { strcat (commande, " VIA"); } sprintf (s, " %s-%d", beacon->digi[i].call, beacon->digi[i].num); strcat (commande, s); } } cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; cmd->next = NULL; cmd->canal = canal; cmd->cmd = COMMAND; cmd->len = strlen (commande); strcpy (cmd->buf, commande); cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; cmd->next = NULL; cmd->canal = canal; cmd->cmd = UNPROTO; cmd->len = len > 256 ? 256 : len; memcpy (cmd->buf, buffer, cmd->len); return (1); } /* static int hst_send_data (int port, int canal, int type, char *buffer, int len) */ static int hst_send_data (int port) { int i; int c; int canal, type, len; char *buffer; char debug_buf[300]; char *pdb = debug_buf; int dlen = 0; unsigned short crc = 0xffff; if (p_port[port].last == NULL) return (0); DebugCmd (port); canal = p_port[port].last->canal; type = (p_port[port].last->cmd == COMMAND) ? 1 : 0; type |= p_port[port].last->compteur; len = p_port[port].last->len; buffer = p_port[port].last->buf; send_tnc (port, HST_CHAR); *pdb++ = HST_CHAR; ++dlen; send_tnc (port, HST_CHAR); *pdb++ = HST_CHAR; ++dlen; crc = updcrc (canal, crc); send_tnc (port, canal); *pdb++ = canal; ++dlen; crc = updcrc (type, crc); send_tnc (port, type); *pdb++ = type; ++dlen; c = len - 1; crc = updcrc (c, crc); send_tnc (port, c); *pdb++ = c; ++dlen; if (c == HST_CHAR) { send_tnc (port, 0); *pdb++ = 0; ++dlen; } for (i = 0; i < len; i++) { c = *buffer++; crc = updcrc (c, crc); send_tnc (port, c); *pdb++ = c; ++dlen; if (c == HST_CHAR) { send_tnc (port, 0); *pdb++ = 0; ++dlen; } } crc = ~crc; /* Send crc */ c = crc & 0xff; send_tnc (port, c); *pdb++ = c; ++dlen; if (c == HST_CHAR) { send_tnc (port, 0); *pdb++ = 0; ++dlen; } c = crc >> 8; send_tnc (port, c); *pdb++ = c; ++dlen; if (c == HST_CHAR) { send_tnc (port, 0); *pdb++ = 0; ++dlen; } #ifdef DEBUG_HST /* if (p_port[port].last->cmd == COMMAND) */ bin_send (debug_buf, dlen); #endif p_port[port].polling = 1; p_com[(int)p_port[port].ccom].delai = 0; return (1); } static void resync_port (int port) { long nt = btime (); static int first = 1; static long delai[NBPORT]; if ((port < 0) || (port >= NBPORT)) return; if (first) { /* Initializes static variables */ int i; for (i = 0; i < NBPORT; i++) { delai[i] = 0L; } first = 0; } if ((p_port[port].synchro < 256) && (delai[port] < nt)) { ++p_port[port].synchro; /* Retry du dernier paquet */ hst_send_data (port); delai[port] = nt + 20L; #if defined(__WINDOWS__) || defined(__linux__) DisplayResync (port, p_port[port].synchro); #else { char s[40]; sprintf (s, "Port %d Resync %-4d", port, p_port[port].synchro); aff_chaine (W_DEFL, 1, 1, s); } #endif } if (p_port[port].synchro == 256) { char txt[80]; sprintf (txt, "Port %d was not resynchronized. Stopped. Error =", port); warning (4, txt); ++p_port[port].synchro; } } static int crc_check (char *ptr, int len) { int i; unsigned short crc = 0xffff; for (i = 0; i < len; i++) { crc = updcrc (*ptr, crc); ++ptr; } return (crc == 0xf0b8); } static int recv_hst (int port, int canal, int *lgbuf, char *buffer) { int crc_ok; int r_canal, code = 0, nb, lg; int i, pos, c, hst; int last = -1; char buf[300]; char *debbuf = buffer; /* Implementation polling */ int valid = 0; char *ptr = p_port[port].portbuf; int index = p_port[port].portind; while ((c = rec_tnc (port)) >= 0) { if (index == 300) { /* Erreur : Vider le buffer et resynchroniser ? */ vide (port, 0); index = 0; break; } /* Ajoute les caracteres dans le buffer */ ptr[index++] = c; } p_port[port].portind = index; /* Tester si la trame est complete */ if (index >= 6) { /* La trame doit faire au moins 6 octets : header + canal et code + crc16 */ /* Verifier que les deux premiers octets sont HST_CHAR */ if ((ptr[0] != HST_CHAR) || (ptr[1] != HST_CHAR)) { /* Le paquet n'est pas bon. Jeter le 1er octet */ for (i = 1; i < index; i++) { ptr[i - 1] = ptr[i]; } --p_port[port].portind; return (-1); /* Modifie de 0 a -1 le 05/04/98 */ } /* Sauter le header - supprimer les 0x00 apres les HST_CHAR et recopie dans buf */ for (i = 2, pos = 0, hst = 0; i < index; i++) { if (hst) { if (ptr[i] == 0) hst = 0; else { p_port[port].portind = 0; /* Demande la repetition du paquet */ hst_send_data (port); return (-1); } } else buf[pos++] = ptr[i]; if (ptr[i] == HST_CHAR) { hst = 1; } } /* Verifie que les caracteres HST_CHAR sont bien suivis de leur 0 */ pos -= hst; /* Nouvelle longueur du paquet */ ptr = buf; index = pos; crc_ok = crc_check (ptr, index); /* On tente le decodage ... */ index -= 2; /* enlever le crc */ r_canal = *ptr++; code = *ptr++; index -= 2; *lgbuf = 0; if (canal == 0xff) canal = r_canal; lg = 0; switch (code) { case 0: if (pos >= 4) { if (!crc_ok) { /* La trame est erronnee */ /* Jette la trame recue */ p_port[port].portind = 0; /* Demande la repetition du paquet */ hst_send_data (port); return (-1); } #ifdef DEBUG_HST if (r_canal != PACTOR_ST) { char buf_debug[300]; buf_debug[0] = 0xaa; buf_debug[1] = 0xaa; memcpy (buf_debug + 2, buf, pos); bin_recv (buf_debug, pos + 2); } #endif *buffer = '\0'; valid = 1; } break; case 1: case 2: case 3: case 4: case 5: while (index) { last = *ptr++; *buffer++ = last; ++lg; --index; } /* Le caractere doit etre un NULL pour finir le paquet */ if (last == '\0') { if (!crc_ok) { /* La trame est erronnee */ /* Jette la trame recue */ p_port[port].portind = 0; /* Demande la repetition du paquet */ hst_send_data (port); return (-1); } #ifdef DEBUG_HST if (r_canal != PACTOR_ST) { char buf_debug[300]; buf_debug[0] = 0xaa; buf_debug[1] = 0xaa; memcpy (buf_debug + 2, buf, pos); bin_recv (buf_debug, pos + 2); } #endif valid = 1; *buffer = '\n'; *++buffer = '\0'; } break; case 6: case 7: nb = lg = 1 + (0xff & *ptr++); --index; if (nb == index) { if (!crc_ok) { /* La trame est erronnee */ /* Jette la trame recue */ p_port[port].portind = 0; /* Demande la repetition du paquet */ hst_send_data (port); return (-1); } /* Tous les caracteres sont recus */ #ifdef DEBUG_HST if (r_canal != PACTOR_ST) { char buf_debug[300]; buf_debug[0] = 0xaa; buf_debug[1] = 0xaa; memcpy (buf_debug + 2, buf, pos); bin_recv (buf_debug, pos + 2); } #endif while (nb--) { *buffer++ = *ptr++; } valid = 1; } break; default: if ((!svoie[CONSOLE]->sta.connect) && (p_port[port].synchro == 0)) { char txt[80]; if (!crc_ok) { /* La trame est erronnee */ /* Jette la trame recue */ p_port[port].portind = 0; /* Demande la repetition du paquet */ hst_send_data (port); return (-1); } sprintf (txt, "Erreur code trame = %d. Erreur =", code); warning (2, txt); } if (p_port[port].synchro == 0) { vide (port, 0); p_port[port].portind = 0; } else if ((r_canal == '^') && (code == 'A')) { /* TNC reinitialise en mode normal ??? */ valid = 1; #ifdef __WINDOWS__ if (operationnel) { fbb_quit (0); *lgbuf = 0; return (-1); } #endif } break; } *lgbuf = lg; } if (valid) { /* La trame a ete acceptee... On libere la donnee */ m_libere (p_port[port].last, sizeof (PortData)); p_port[port].last = NULL; if ((DebugCh) || (code == 2)) { int len = *lgbuf; char buf[300]; strcpy (buf, debbuf); len = *lgbuf; if (code == 1) { --len; buf[len] = '\0'; } } /* Une trame complete a ete recue */ if (p_port[port].synchro) { #if defined(__WINDOWS__) || defined(__linux__) char txt[80]; sprintf (txt, "Ending resynchronization on port %d - Error =", port); warning (5, txt); DisplayResync (port, 0); #else ++com_error; aff_date (); #endif } p_port[port].portind = 0; p_port[port].synchro = 0; p_com[(int)p_port[port].ccom].delai = 0; } else { code = -1; /* Rien n'a ete recu... Tester le temps (2 secondes d'attente) */ if (p_com[(int)p_port[port].ccom].delai > 10) { /* Lancer la procedure de resynchronisation */ if (p_port[port].synchro == 0) { char txt[80]; sprintf (txt, "Starting resynchronization on port %d - Error =", port); warning (3, txt); /* vide (port, 0); */ } p_port[port].portind = 0; resync_port (port); } } return (code); } static void hst_get_ui (int port, char *buffer, ui_header * ui) { char *ptr; char *scan; memset (ui, 0, sizeof (ui_header)); ui->port = port; scan = buffer; if ((isdigit (scan[0])) && (scan[1] == ':')) { /* port HST */ ui->port = hst_port (port, scan[0] - '0'); scan += 2; if (*scan == ' ') { /* bug TFPCX ... */ ++scan; } } ptr = strtok (scan, " "); /* fm */ if (ptr == NULL) return; ptr = strtok (NULL, " "); /* exped */ if (ptr == NULL) return; n_cpy (11, ui->from, ptr); ptr = strtok (NULL, " "); /* to */ if (ptr == NULL) return; ptr = strtok (NULL, " "); /* desti */ if (ptr == NULL) return; n_cpy (11, ui->to, ptr); ptr = strtok (NULL, " "); /* via ou ctl */ if (ptr == NULL) return; if (strcmp (ptr, "via") == 0) { for (;;) { if (*ui->via) strcat (ui->via, " "); ptr = strtok (NULL, " "); /* digis */ if (ptr == NULL) return; if (strcmp (ptr, "ctl") == 0) break; strncat (ui->via, ptr, 12); } } ptr = strtok (NULL, " "); /* controle */ if (ptr == NULL) return; strn_cpy (11, ui->ctl, ptr); ui->ui = (strncmp (ptr, "UI", 2) == 0); ptr = strtok (NULL, " "); /* pid */ if (ptr == NULL) return; ptr = strtok (NULL, " "); /* pid */ if (ptr == NULL) return; sscanf (ptr, "%x", &ui->pid); } static int nb_waiting (int port) { /* Donne le nombre de trames DATA en attente d'envoi vers le TNC */ int nb = 0; PortData *cmd = p_port[port].cmd; while (cmd) { if (cmd->cmd == DATA) ++nb; cmd = cmd->next; } return (nb); } fbb-7.0.10/src/ibm.c0000644000175000017500000001602413615603431010760 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #include #include #include #include #undef stat void deb_io (void) { static long temps = 0L; long nt = btime (); if (nt > temps) { } } void fin_io (void) { } void randomize (void) { srandom (time (NULL)); } int random_nb (int num) { #ifdef __linux__ return (random () % num); #endif #if defined(__FBBDOS__) || defined(__WINDOWS__) return (random (num)); #endif } #undef filelength long filelength (int fd) { struct stat st; int val; val = fstat (fd, &st); if (val == -1) return (-1L); return (st.st_size); } int getdisk (void) { /* Only C: */ return 2; } char *getcurdir (int drive, char *str) { char buffer[PATH_MAX + 1]; char* cwd; cwd = getcwd (buffer, PATH_MAX + 1); if( cwd != NULL ) strcpy (str, slash2back (buffer)); else perror ("getcwd() error"); return str; } int is_cdir (int chr) { if ((chr == '/') || (chr == ':') || (chr == '\\')) return (FALSE); return (isprint (chr)); } int fnsplit (char *name, char *drive, char *rep, char *base, char *ext) { int nb; int mask = 0; char *ptr = NULL; char *scan; if (drive) *drive = '\0'; scan = strrchr (name, '/'); if (rep) { ptr = rep; if (scan) { int sav = *ptr; *ptr = '\0'; strcpy (rep, name); *ptr = sav; } else { *rep = '\0'; } } if (base) { /* BaseName */ ptr = base; if (scan) ++scan; else scan = name; for (nb = 0; nb < FBB_NAMELENGTH; nb++, scan++) { if (!is_cdir (*scan)) break; *ptr++ = *scan; } *ptr = '\0'; } if (ext) { /* Extension */ ptr = ext; /* if ((scan = strrchr (name, '.')) != NULL) { *ptr++ = *scan++; for (nb = 0; nb < 3; nb++, scan++) { if (!is_cdir (*scan)) break; *ptr++ = (islower (*scan)) ? toupper (*scan) : *scan; } }*/ *ptr = '\0'; } return (mask); } int getftime (int fd, struct ftime *ft) { struct stat st; struct tm *tm; int val; val = fstat (fd, &st); if (val == -1) return (-1); tm = gmtime (&st.st_mtime); ft->ft_tsec = tm->tm_sec / 2; ft->ft_min = tm->tm_min; ft->ft_hour = tm->tm_hour; ft->ft_day = tm->tm_mday; ft->ft_month = tm->tm_mon; ft->ft_year = tm->tm_year %100; return (0); } void format_ffblk (struct ffblk *blk, struct dirent *dir) { int ret; int year; struct stat st; struct tm *tm; char base[FBB_NAMELENGTH+1]; /* AGAIN : array dimension was too small, */ char ext[4]; /* causing stack smashing with long names in DOS menu */ char filename[FBB_BASELENGTH+1]; blk->ff_attrib = 0; if (strcmp (blk->ff_base, "/") == 0) sprintf (filename, "/%s", dir->d_name); else sprintf (filename, "%s/%s", blk->ff_base, dir->d_name); ret = lstat (filename, &st); if (S_ISLNK (st.st_mode)) { /* printf ("link\n"); */ blk->ff_attrib |= FA_LINK; ret = stat (filename, &st); if (S_ISDIR (st.st_mode)) { blk->ff_attrib |= FA_DIREC; } } if (S_ISDIR (st.st_mode)) { blk->ff_attrib |= FA_DIREC; } if ((st.st_mode & S_IWUSR) == 0) blk->ff_attrib |= FA_RDONLY; blk->ff_fsize = st.st_size; tm = gmtime (&st.st_mtime); blk->ff_ftime = (tm->tm_sec / 2) + (tm->tm_min << 5) + (tm->tm_hour << 11); year = tm->tm_year %100; blk->ff_fdate = (tm->tm_mday) + ((tm->tm_mon + 1) << 5) + (year << 9); fnsplit (dir->d_name, NULL, NULL, base, ext); strcpy (blk->ff_name, base); if (*ext) { strcat (blk->ff_name, ext); } } #undef findfirst int findfirst (char *rech, struct ffblk *blk, int mask) { struct dirent *dirent; char *path; /* Deletes X: from MSDOS path */ if ((strlen (rech) > 2) && (rech[1] == ':')) rech += 2; path = back2slash (rech); if (is_dir (path)) { strcpy (blk->ff_mask, "*"); } else { char *ptr = strrchr (path, '/'); if (ptr) { *ptr++ = '\0'; strcpy (blk->ff_mask, ptr); if (*path == '\0') strcpy (path, "/"); } else { strcpy (blk->ff_mask, path); strcpy (path, "."); } } strcpy (blk->ff_base, path); blk->ff_dir = opendir (path); if (blk->ff_dir) { while ((dirent = readdir (blk->ff_dir)) != NULL) { if (*dirent->d_name == '.') continue; if (!strmatch (dirent->d_name, blk->ff_mask)) continue; format_ffblk (blk, dirent); return (0); } closedir (blk->ff_dir); blk->ff_dir = NULL; } return (-1); } #undef findnext int findnext (struct ffblk *blk) { struct dirent *dirent; while ((dirent = readdir (blk->ff_dir)) != NULL) { if (*dirent->d_name == '.') continue; if (!strmatch (dirent->d_name, blk->ff_mask)) continue; format_ffblk (blk, dirent); return (0); } closedir (blk->ff_dir); blk->ff_dir = NULL; return (-1); } unsigned long free_disk (int disk) { struct statfs dfree; unsigned long avail; char *curdisk; char pwd[256]; /* Chercher le disque physique correspondant */ if (disk == 0) { curdisk = getcwd (pwd, sizeof (pwd)); } else { curdisk = PATH[disk - 1]; } if (statfs (curdisk, &dfree) == 0) avail = (unsigned long) dfree.f_bavail * (unsigned long) (dfree.f_bsize / 1024); else avail = 0L; return (avail); } /**************************************************** * Look for an existing filename case independant * matching with the given path/filename * * path is case dependant and MUST match a directory ****************************************************/ char *long_filename(char *path, char *filename) { char fname[256]; char lpath[256]; char *ptr; char *scan; struct dirent *dirent; DIR *dir; strcpy(fname, back2slash(filename)); ptr = fname; if ((*ptr == '/') || (path == NULL)) { strcpy(lpath, "/"); ++ptr; } else { strcpy(lpath, back2slash(path)); long_filename(NULL, lpath); } do { scan = strchr(ptr, '/'); if (scan) *scan = '\0'; dir = opendir (lpath); if (dir) { while ((dirent = readdir (dir)) != NULL) { if (!strcmpi (dirent->d_name, ptr)) { strcpy(ptr, dirent->d_name); if (strcmp(lpath, "/") != 0) strcat(lpath, "/"); strcat(lpath, dirent->d_name); break; } } closedir(dir); if (scan) { *scan = '/'; ptr = scan+1; } } else break; } while (scan); strcpy(filename, slash2back(fname)); return filename; } fbb-7.0.10/src/terminal.c0000644000175000017500000002045113615603431012023 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /********************************************** * * * xfbbC : Client for xfbbd BBS daemon version * * * **********************************************/ #include #include #include #include #include #include #include #include #include #define uchar char #define MAX_PACKETLEN 512 #define MAX_BUFLEN 2*MAX_PACKETLEN typedef struct { WINDOW *ptr; int max_y; int max_x; char string[MAX_BUFLEN]; int bytes; int curs_pos; } t_win; t_win win_in; t_win win_out; struct wint_s { WINDOW* ptr; int fline; int lline; struct wint_s* next; }; typedef struct wint_s wint; wint wintab; #define TALKMODE 001 /* two windows (outgoing and incoming) with menu */ #define SLAVEMODE 002 /* Menu mode */ #define RAWMODE 004 /* mode used by earlier versions */ int mode = TALKMODE; WINDOW* winopen(wint *wtab, int nlines, int ncols, int begin_y, int begin_x, int border) { while (wtab->next != NULL) wtab = wtab->next; wtab->next = (wint *)malloc(sizeof(wint)); wtab = wtab->next; wtab->next = NULL; wtab->ptr = newwin(nlines, ncols, begin_y, begin_x); if (wtab->ptr == NULL) return NULL; wtab->fline = begin_y; wtab->lline = begin_y + nlines; if (border) wborder(wtab->ptr, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE, ACS_ULCORNER, ACS_URCORNER, ACS_LLCORNER, ACS_LRCORNER); return wtab->ptr; } int start_talk_mode(wint * wintab, t_win * win_in, t_win * win_out) { int cnt; WINDOW *win; win_out->max_y = 4; /* TXLINES */ win_out->max_x = COLS; win_in->max_y = (LINES - 4) - win_out->max_y; win_in->max_x = COLS; win_out->ptr = winopen(wintab, win_out->max_y + 1, win_out->max_x, (win_in->max_y + 3), 0, FALSE); win_in->ptr = winopen(wintab, win_in->max_y + 1, win_in->max_x, 1, 0, FALSE); win = winopen(wintab, 1, win_out->max_x, win_in->max_y + 2, 0, FALSE); for (cnt = 0; cnt < COLS; cnt++) waddch(win, '-'); wrefresh(win); scrollok(win_in->ptr, TRUE); scrollok(win_out->ptr, TRUE); wclear(win_out->ptr); wrefresh(win_out->ptr); wclear(win_in->ptr); wrefresh(win_in->ptr); win_out->bytes = 0; win_out->curs_pos = 0; win_in->bytes = 0; win_out->curs_pos = 0; return 0; } static int start_screen(char *call) { int cnt; if (initscr() == NULL) return -1; attron(A_REVERSE); move(0, 0); addstr(call); for (cnt = strlen(call); cnt <= 80; cnt++) addch(' '); attroff(A_REVERSE); noecho(); raw(); refresh(); return 0; } static void writeincom(int mode, t_win *win_in, char *buf, int bytes) { int cnt; if (mode & RAWMODE) { if ((write(STDOUT_FILENO, buf, bytes)) != bytes) fprintf (stderr, "Error writing to STDOUT file %d\n", STDOUT_FILENO); return; } for (cnt = 0; cnt < bytes; cnt++) { switch (buf[cnt]) { case 201: case 218: waddch(win_in->ptr, ACS_ULCORNER); break; case 187: case 191: waddch(win_in->ptr, ACS_URCORNER); break; case 200: case 192: waddch(win_in->ptr, ACS_LLCORNER); break; case 188: case 217: waddch(win_in->ptr, ACS_LRCORNER); break; case 204: case 195: waddch(win_in->ptr, ACS_LTEE); break; case 185: case 180: waddch(win_in->ptr, ACS_RTEE); break; case 203: case 194: waddch(win_in->ptr, ACS_TTEE); break; case 202: case 193: waddch(win_in->ptr, ACS_BTEE); break; case 205: case 196: waddch(win_in->ptr, ACS_HLINE); break; case 186: case 179: waddch(win_in->ptr, ACS_VLINE); break; case 129: waddch(win_in->ptr, 252); /*u umlaut */ break; case 132: waddch(win_in->ptr, 228); /*a umlaut */ break; case 142: waddch(win_in->ptr, 196); /*A umlaut */ break; case 148: waddch(win_in->ptr, 246); /*o umlaut */ break; case 153: waddch(win_in->ptr, 214); /*O umlaut */ break; case 154: waddch(win_in->ptr, 220); /*U umlaut */ break; case 225: waddch(win_in->ptr, 223); /*sz */ break; default: { if (buf[cnt] > 127) waddch(win_in->ptr, '.'); else waddch(win_in->ptr, buf[cnt]); } } } wrefresh(win_in->ptr); return; } int readoutg(t_win *win_out, wint *wintab, char *buf) { int out_cnt; int c; int ypos = 0, xpos = 0; c = getch(); if (c == ERR) return 0; switch (c) { case KEY_BACKSPACE: case 127: { getyx(win_out->ptr, ypos, xpos); if (win_out->bytes > 0) { if (win_out->curs_pos < win_out->bytes) { mvwaddnstr(win_out->ptr, ypos, --xpos, &win_out->string[win_out->curs_pos], win_out->bytes - win_out->curs_pos); waddch(win_out->ptr, ' '); memmove(&win_out->string[win_out->curs_pos - 1], &win_out->string[win_out->curs_pos], win_out->bytes - win_out->curs_pos); } else mvwaddch(win_out->ptr, ypos, --xpos, ' '); wmove(win_out->ptr, ypos, xpos); win_out->bytes--; win_out->curs_pos--; } } break; case KEY_LEFT: if (win_out->curs_pos > 0) { win_out->curs_pos--; getyx(win_out->ptr, ypos, xpos); wmove(win_out->ptr, ypos, xpos - 1); } break; case KEY_RIGHT: if (win_out->curs_pos < win_out->bytes) { win_out->curs_pos++; getyx(win_out->ptr, ypos, xpos); wmove(win_out->ptr, ypos, xpos + 1); } break; case KEY_ENTER: case (int) '\n': case (int) '\r': { if (win_out->curs_pos < win_out->bytes) { getyx(win_out->ptr, ypos, xpos); wmove(win_out->ptr, ypos, xpos + win_out->bytes - win_out->curs_pos); } waddch(win_out->ptr, '\n'); win_out->string[win_out->bytes++] = (char) '\n'; wrefresh(win_out->ptr); strncpy(buf, win_out->string, win_out->bytes); wrefresh(win_out->ptr); out_cnt = win_out->bytes; win_out->bytes = 0; win_out->curs_pos = 0; return out_cnt; } break; default: { waddch(win_out->ptr, (char) c); if (win_out->curs_pos < win_out->bytes) { getyx(win_out->ptr, ypos, xpos); waddnstr(win_out->ptr, &win_out->string[win_out->curs_pos], win_out->bytes - win_out->curs_pos); memmove(&win_out->string[win_out->curs_pos + 1], &win_out->string[win_out->curs_pos], win_out->bytes - win_out->curs_pos); win_out->string[win_out->curs_pos] = (char) c; wmove(win_out->ptr, ypos, xpos); } else win_out->string[win_out->bytes] = (char) c; win_out->bytes++; win_out->curs_pos++; } } wrefresh(win_out->ptr); return 0; } void init_terminal(int termmode, char *call) { if (termmode) { mode = TALKMODE; start_screen(call); start_talk_mode(&wintab, &win_in, &win_out); } else { mode = RAWMODE; } } void end_terminal(void) { endwin(); } int read_terminal(char *buf, int len) { int bytes; if ((mode & RAWMODE) == RAWMODE) bytes = read(STDIN_FILENO, buf, len); else { bytes = readoutg(&win_out, &wintab, buf); if (bytes == -1) { wclear(win_in.ptr); wrefresh(win_in.ptr); wclear(win_out.ptr); wrefresh(win_out.ptr); bytes = 0; } writeincom(mode, &win_in, buf, bytes); } return bytes; } void write_terminal(char *buf, int bytes) { writeincom(mode, &win_in, buf, bytes); } fbb-7.0.10/src/date.c0000644000175000017500000000223713613360505011127 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* #include */ #include #include char *date (void) { return (__DATE__); } char *version (void) { static char buffer[20]; sprintf (buffer, "%s", VERSION); return (buffer); } fbb-7.0.10/src/initport.c0000644000175000017500000006152613613360505012070 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include static int lang_len (char *); static void errport (int, char *); static void err_fic (char *, int, char *); static void init_forward (Forward * pfwd) { int i; int j; pfwd->reverse = 0; pfwd->fwdpos = 0; pfwd->lastpos = 0; pfwd->fwdlig = 0; pfwd->cptif = 0; pfwd->forward = 0; pfwd->no_con = 0; pfwd->no_bbs = 0; pfwd->fin_fwd = 0; for (i = 0; i < 8; i++) { *pfwd->con_lig[i] = '\0'; } for (i = 0; i < 4; i++) { for (j = 0; j < 3; j++) { *pfwd->mesnode[i][j] = '\0'; } } *pfwd->txt_con = '\0'; *pfwd->fwdbbs = '\0'; pfwd->suite = NULL; } void end_ports (void) { int i; Forward *pfwd; if (p_port == NULL) return; for (i = 0; i < NBPORT; i++) { while (p_port[i].listfwd) { pfwd = p_port[i].listfwd; p_port[i].listfwd = pfwd->suite; m_libere (pfwd, sizeof (Forward)); } } m_libere (p_port, sizeof (defport) * NBPORT); p_port = NULL; } void initport (void) { FILE *fptr; Forward *pprec, *pfwd; char *ptr; char ligne[256], sfreq[81], mode[81]; char portname[81]; int voie; #ifdef __linux__ int linux_canal = 1; #endif int drsi_canal = 1; int bpq_canal = 1; int agw_canal = 1; int hst_canal = 1; int lig; int j; unsigned int p1, p2, p3, p4, p5, p6, p7, p8, p9; long lp4; int mx; int nbvalid = 0, i = 0; int nb, nbl, tnc = 0, nbport; int local_mode, nbtnc, fvoie; /* flag de lecture d'affectation des voies */ unsigned al; char *portfile; lig = 0; al = sizeof (defcom) * NBPORT; p_com = (defcom *) m_alloue (al); memset (p_com, 0, sizeof (defcom) * NBPORT); #ifdef __FBBDOS__ portfile = "port_d.sys"; #endif #ifdef __WINDOWS__ portfile = "port_w.sys"; #endif #ifdef __linux__ portfile = "port_l.sys"; #endif if ((fptr = fopen (c_disque (portfile), "r")) == NULL) { if ((fptr = fopen (c_disque ("port.sys"), "r")) == NULL) { #ifdef ENGLISH errport (lig, "File PORT.SYS not found"); #else errport (lig, "Fichier PORT.SYS inexistant"); #endif return; } } #ifdef __linux__ #ifdef ENGLISH cprintf ("Ports set-up \n"); #else cprintf ("Initialisation des ports\n"); #endif #else #ifdef ENGLISH cprintf ("Ports set-up \r\n"); #else cprintf ("Initialisation des ports\r\n"); #endif #endif al = sizeof (defport) * NBPORT; p_port = (defport *) m_alloue (al); for (i = 0; i < NBPORT; i++) { p_port[i].mem = 32000; p_port[i].pvalid = p_port[i].nb_voies = 0; p_port[i].transmit = 0; p_port[i].cur_can = 0; p_port[i].portind = 0; p_port[i].synchro = 0; p_port[i].frame = 0; for (j = 0; j < NBHEARD; j++) p_port[i].heard[j].last = 0L; } p_port[0].pvalid = 1; /* Port console valide */ p_port[0].typort = TYP_DED; p_port[0].moport = 0; p_port[0].frame = 4; /******************* A PARAMETRER *******************/ p_port[0].min_fwd = 0; p_port[0].per_fwd = 15; strcpy (p_port[0].freq, "CONSOLE"); p_port[0].listfwd = (Forward *) m_alloue (sizeof (Forward)); init_forward (p_port[0].listfwd); svoie[0]->sta.mem = 500; svoie[0]->affport.port = 0xfe; svoie[0]->affport.canal = -2; /* voie pour import/export */ init_voie (NBVOIES); svoie[NBVOIES]->sta.mem = 500; svoie[NBVOIES]->affport.port = 0; svoie[NBVOIES]->affport.canal = 1; ++NBVOIES; fvoie = 1; nbl = 0; while (fgets (ligne, 250, fptr)) { ++lig; ptr = ligne; while (*ptr && (*ptr == ' ')) ++ptr; if (*ptr == '#') continue; if (!isdigit (*ptr)) { #ifdef ENGLISH errport (lig, "Syntax error "); #else errport (lig, "Erreur de syntaxe"); #endif return; } switch (fvoie) { case 1: nb = sscanf (ptr, "%d %d", &nbport, &nbtnc); if (nb != 2) { #ifdef ENGLISH errport (lig, "Wrong number of parameters "); #else errport (lig, "Nombre de paramŠtres incorrect"); #endif return; } if ((nbport <= 0) || (nbport > (NBPORT - 1))) { #ifdef ENGLISH errport (lig, "Port number error "); #else errport (lig, "Nombre de ports erron‚"); #endif return; } if (nbtnc < nbport) { #ifdef ENGLISH errport (lig, "TNC number error "); #else errport (lig, "Nombre de TNCs erron‚"); #endif return; } fvoie = 2; break; case 2: nb = sscanf (ptr, "%d %d %s %ld", &p1, &p3, portname, &lp4); if (nb != 4) { #ifdef ENGLISH errport (lig, "Wrong number of parameters "); #else errport (lig, "Nombre de paramŠtres incorrect"); #endif return; } if ((p1 <= 0) || (p1 > NBCOM)) { #ifdef ENGLISH errport (lig, "COM Nb error "); #else errport (lig, "Nø COM erron‚"); #endif return; } p2 = 0; sscanf (portname, "%x", &p2); n_cpy (19, p_com[p1].name, portname); p_com[p1].delai = 0; p_com[p1].cbase = p2; p_com[p1].pactor_st = 247; #ifdef __linux__ if (p3 != P_LINUX) { #ifdef ENGLISH errport (lig, "Wrong interface number "); #else errport (lig, "Num‚ro d'interface erron‚"); #endif return; } #endif #ifdef __FBBDOS__ if (p3 > P_TFPC) { #ifdef ENGLISH errport (lig, "Wrong interface number "); #else errport (lig, "Num‚ro d'interface erron‚"); #endif return; } #endif #ifdef __WINDOWS__ if (p3 > P_TFWIN) { #ifdef ENGLISH errport (lig, "Wrong interface number "); #else errport (lig, "Num‚ro d'interface erron‚"); #endif return; } #endif p_com[p1].combios = p3; p_com[p1].port = (int) lp4; #ifdef __WINDOWS__ if (p3 == P_WINDOWS) { p_com[p1].baud = lp4; } else { #endif #if defined(__linux__) || defined(__FBBDOS__) if (p3) { #endif switch (lp4) { case 300L: p_com[p1].baud = 0x43; p_com[p1].options = 0; break; case 600L: p_com[p1].baud = 0x63; p_com[p1].options = 0; break; case 1200L: p_com[p1].baud = 0x83; p_com[p1].options = 0; break; case 2400L: p_com[p1].baud = 0xA3; p_com[p1].options = 0; break; case 4800L: p_com[p1].baud = 0xC3; p_com[p1].options = 0; break; case 0L: case 9600L: p_com[p1].baud = 0xE3; p_com[p1].options = 0; break; case 14400L: p_com[p1].baud = 0x23; p_com[p1].options = 0x20; break; case 19200L: p_com[p1].baud = 0x43; p_com[p1].options = 0x20; break; case 28800L: p_com[p1].baud = 0x63; p_com[p1].options = 0x20; break; case 38400L: p_com[p1].baud = 0x83; p_com[p1].options = 0x20; break; case 57600L: p_com[p1].baud = 0xA3; p_com[p1].options = 0x20; break; case 115200L: p_com[p1].baud = 0xC3; p_com[p1].options = 0x20; break; case 330400L: p_com[p1].baud = 0xE3; p_com[p1].options = 0x20; break; default: #ifdef __linux__ break; #else #ifdef ENGLISH errport (lig, "Wrong baud rate "); #else errport (lig, "Baud rate incorrect"); #endif return; #endif } } #ifdef __FBBDOS__ else { p_com[p1].options = 0x0; switch (lp4) { case 300L: p_com[p1].baud = 384; break; case 600L: p_com[p1].baud = 192; break; case 1200L: p_com[p1].baud = 96; break; case 2400L: p_com[p1].baud = 48; break; case 4800L: p_com[p1].baud = 24; break; case 9600L: p_com[p1].baud = 12; break; case 14400L: p_com[p1].baud = 9; break; case 19200L: p_com[p1].baud = 6; break; case 28800L: p_com[p1].baud = 4; break; case 38400L: p_com[p1].baud = 3; break; case 57600L: p_com[p1].baud = 2; break; case 115200L: p_com[p1].baud = 1; break; case 330400L: p_com[p1].baud = 0; break; default: #ifdef ENGLISH errport (lig, "Wrong baud rate "); #else errport (lig, "Baud rate incorrect"); #endif return; } } #endif /* __FBBDOS__ */ if (++nbl == nbport) { fvoie = 3; nbl = 0; tnc = 0; voie = 1; } break; case 3: p5 = 0; nb = sscanf (ptr, "%d %d %d %s %d %d %d %d %d/%d %s %s", &p1, &p2, &p4, portname, &p6, &p7, &p9, &mx, &p3, &p8, mode, sfreq); if (nb != 12) { #ifdef ENGLISH errport (lig, "Wrong number of parameters "); #else errport (lig, "Nombre de paramŠtres incorrect"); #endif return; } if (p1 > NBPORT) { #ifdef ENGLISH errport (lig, "Wrong port number "); #else errport (lig, "Num‚ro port erron‚"); #endif return; } if (p2 > MAXVOIES) { #ifdef ENGLISH errport (lig, "Number of channels"); #else errport (lig, "Nombre de voies "); #endif return; } if (p2 > 0) { sscanf (portname, "%d", &p5); if (p5 > 99) p5 = 0; n_cpy (19, p_port[p1].name, portname); if ((p4 < 1) || (p4 > NBCOM)) { #ifdef ENGLISH errport (lig, "COM Nb error "); #else errport (lig, "Nø COM erron‚"); #endif return; } #ifndef __linux__ if (p5 > 7) { #ifdef ENGLISH errport (lig, "Channel must be from 0 to 7"); #else errport (lig, "Le canal doit etre de 0 … 7"); #endif return; } #endif if ((p6 != 0) && ((p6 < 30) || (p6 > 250))) { #ifdef ENGLISH errport (lig, "Paclen must be from 30 to 250 "); #else errport (lig, "Le paquet doit etre de 30 … 250"); #endif return; } if ((p7 < 1) || (p7 > 7)) { #ifdef ENGLISH errport (lig, "Maxframe must be from 1 to 7 "); #else errport (lig, "Le nombre de trames doit etre de 1 … 7"); #endif return; } if (p9 > p2) { #ifdef ENGLISH errport (lig, "Too many forward channels"); #else errport (lig, "Trop de voies forward "); #endif return; } if (mx <= 0) { #ifdef ENGLISH errport (lig, "Forwarding block size"); #else errport (lig, "Taille bloc forward "); #endif return; } if (strlen (sfreq) > 9) { #ifdef ENGLISH errport (lig, "9 characters maximum for the frequency"); #else errport (lig, "9 caracteres maximum pour la frequence"); #endif return; } if (p3 > 59) { #ifdef ENGLISH errport (lig, "Forward minute"); #else errport (lig, "Minute forward"); #endif return; } if ((p8 < 1) || (p8 > 60)) { #ifdef ENGLISH errport (lig, "Forward period "); #else errport (lig, "P‚riode forward"); #endif return; } } /* Gestion du multiplexeur sur le COM (DED) */ p_com[p4].multi[p5] = p1; if (p1 == 0) { if (p3 > 59) { #ifdef ENGLISH errport (lig, "Forward minute"); #else errport (lig, "Minute forward"); #endif return; } if ((p8 < 1) || (p8 > 60)) { #ifdef ENGLISH errport (lig, "Forward period "); #else errport (lig, "P‚riode forward"); #endif return; } p_port[p1].min_fwd = p3; p_port[p1].per_fwd = p8; break; } if (p_port[p1].pvalid) { errport (lig, "TNC number already declared"); } p_port[p1].ccom = p4; p_port[p1].ccanal = p5; p_port[p1].maxbloc = mx; ptr = mode; p_port[p1].typort = TYP_DED; p_port[p1].moport = 0; while (*ptr) { switch (toupper (*ptr)) { case 'G': p_port[p1].moport |= 1; break; case 'B': p_port[p1].moport |= 2; break; case 'Y': p_port[p1].moport |= 4; break; case 'M': p_port[p1].moport |= 8; p_port[p1].typort = TYP_MOD; /* MODEM */ break; case 'W': p_port[p1].moport |= 0x10; break; case 'L': p_port[p1].moport |= 0x20; break; case 'R': p_port[p1].moport |= 0x40; break; #ifdef __linux__ case 'S': p_port[p1].typort = TYP_POP; /* POP SOCKET */ p_port[p1].ccanal = 0; p5 = 0; break; case 'X': p_port[p1].typort = TYP_SCK; /* AX25 SOCKET */ p_port[p1].ccanal = 0; p5 = 0; break; #endif case 'H': p_port[p1].typort = TYP_HST; /* PTC-HOST */ break; case 'D': p_port[p1].typort = TYP_DED; /* DED */ if ((p_com[p4].combios == P_COMBIOS) && ((p5 < 1) || (p5 > 4))) { #ifdef ENGLISH errport (lig, "Mux channel must be from 1 to 4"); #else errport (lig, "Le canal MUX doit etre de 1 a 4"); #endif return; } break; case 'P': p_port[p1].typort = TYP_PK; /* PK232 */ if (p2 > 9) p2 = 9; break; case 'K': p_port[p1].typort = TYP_KAM; /* KAM */ break; case 'Q': p_port[p1].typort = TYP_BPQ; /* BPQ4 */ p_port[p1].ccanal = p5 + 1; break; #if defined(__WINDOWS__) || defined(__linux__) case 'T': p_port[p1].typort = TYP_TCP; /* TCP-IP */ break; case 'E': p_port[p1].typort = TYP_ETH; /* ETHER-LINK */ break; #endif #if defined(__WINDOWS__) case 'A': p_port[p1].typort = TYP_AGW; /* TCP-AGW */ break; #endif #if defined(__WINDOWS__) || defined(__FBBDOS__) case 'F': p_port[p1].typort = TYP_FLX; /* FLEXNET */ break; #endif case 'U': break; default: #ifdef ENGLISH errport (lig, "Wrong port mode "); #else errport (lig, "Mode du port erron‚"); #endif return; } ++ptr; } p_port[p1].pk_t = p6; if ((p_port[p1].typort == TYP_HST) && (p_port[p1].ccanal == 0)) { /* Pactor port */ p_port[p1].moport |= 0x80; } if (p6) p_port[p1].beacon_paclen = p6; else p_port[p1].beacon_paclen = 128; switch (p_com[p4].combios) { case 3: p_port[p1].typort = TYP_MOD; p_port[p1].moport |= 8; p_port[p1].pk_t = 128; break; case 4: p_port[p1].typort = TYP_DED; break; default: break; } p_port[p1].pvalid = p_port[p1].nb_voies = p2; p_port[p1].frame = p7; p_port[p1].listfwd = pprec = NULL; p_port[p1].min_fwd = p3; p_port[p1].per_fwd = p8; p_port[p1].pr_voie = NBVOIES; while (p9--) { pfwd = (Forward *) m_alloue (sizeof (Forward)); if (p_port[p1].listfwd) { pprec->suite = pfwd; pprec = pfwd; } else { p_port[p1].listfwd = pprec = pfwd; } init_forward (pprec); } strn_cpy (9, p_port[p1].freq, sfreq); if (p2) { int tot; #if defined(__WINDOWS__) || defined(__linux__) { char buf[80]; sprintf (buf, "%d %d ch", p1, p2); InitText (buf); } #endif #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("Port %d ok : %d channel(s) \r\n", p1, p2); #else cprintf ("Port %d valide : %d voie(s)\r\n", p1, p2); #endif #endif nbvalid += p2; tot = 0; for (i = 1; i <= p2; i++) { init_voie (NBVOIES); svoie[NBVOIES]->affport.port = p1; #ifdef __linux__ if (S_LINUX (p1)) { tot = linux_canal++; svoie[NBVOIES]->affport.canal = tot; } else #endif if (DRSI (p1)) { tot = drsi_canal++; svoie[NBVOIES]->affport.canal = tot; } else if (BPQ (p1)) { tot = bpq_canal++; svoie[NBVOIES]->affport.canal = tot; } else if (AGW (p1)) { tot = agw_canal++; svoie[NBVOIES]->affport.canal = tot; } else if (HST (p1)) { if (p_port[p1].ccanal == 0) { tot = 1; svoie[NBVOIES]->affport.canal = PACTOR_CH; } else { /* Include the pactor channel */ tot = hst_canal++; svoie[NBVOIES]->affport.canal = tot; if (tot == PACTOR_CH) { #ifdef ENGLISH errport (lig, "Too many channels ! "); #else errport (lig, "Nombre de voies trop important"); #endif } } } else { tot = i; svoie[NBVOIES]->affport.canal = tot; } if (++NBVOIES == MAXVOIES) { #ifdef ENGLISH errport (lig, "Too many channels ! "); #else errport (lig, "Nombre de voies trop important"); #endif return; } } p_port[p1].tt_can = tot; } if (++tnc == nbtnc) { fvoie = 4; nbl = 0; } break; case 4: nb = sscanf (ptr, "%d %d %s %s", &p1, &p2, sfreq, mode); if (nb != 4) { #ifdef ENGLISH errport (lig, "Wrong parameter number "); #else errport (lig, "Nombre de paramŠtres incorrect"); #endif return; } if (p2 > p_port[p1].nb_voies) { #ifdef ENGLISH errport (lig, "Not enough channels on this port"); #else errport (lig, "Pas assez de voies sur ce port "); #endif return; } ptr = mode; local_mode = 0; while (*ptr) { switch (toupper (*ptr)) { case 'G': local_mode |= 1; break; case 'B': local_mode |= 2; break; case 'Y': local_mode |= 4; break; case 'U': break; default: #ifdef ENGLISH errport (lig, "Wrong port mode "); #else errport (lig, "Mode du port erron‚"); #endif return; } ++ptr; } i = NBVOIES; while (p2) { if (--i == 0) break; if (no_port (i) == p1) { svoie[i]->sta.callsign.num = extind (sfreq, svoie[i]->sta.callsign.call); svoie[i]->localmode = local_mode; #ifdef ENGLISH cprintf ("Channel %d on %s \r\n", i, sfreq); #else cprintf ("Voie %d affectee a %s\r\n", i, sfreq); #endif --p2; } } break; case 5: break; } } for (voie = 0; voie < NBVOIES; voie++) { svoie[voie]->paclen = p_port[no_port (voie)].pk_t; } #ifdef __linux__ #ifdef ENGLISH cprintf ("%d channels ok \n", nbvalid); #else cprintf ("%d voies valides\n", nbvalid); #endif #else #ifdef ENGLISH cprintf ("%d channels ok \r\n", nbvalid); #else cprintf ("%d voies valides\r\n", nbvalid); #endif #endif MWARNING = NBVOIES; init_voie (MWARNING); ferme (fptr, 6); attend_caractere (1); } static void errport (int lig, char *texte) { #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("Error file PORT.SYS line %d : \r\n< %s >\r\n\a", lig, texte); #else cprintf ("Erreur fichier PORT.SYS ligne %d : \r\n< %s >\r\n\a", lig, texte); #endif attend_caractere (10); #endif #if defined(__WINDOWS__) || defined(__linux__) char msg[80]; #ifdef ENGLISH sprintf (msg, "Error file PORT.SYS line %d : \n< %s >", lig, texte); #else sprintf (msg, "Erreur fichier PORT.SYS ligne %d : \n< %s >", lig, texte); #endif WinMessage (5, msg); #endif fbb_error (ERR_SYNTAX, c_disque ("PORT.SYS"), lig); } static void err_fic (char *nomfic, int ligne, char *texte) { #ifdef __FBBDOS__ cprintf ("\r\n%s (%d) : %s\r\n\a", nomfic, ligne, texte); attend_caractere (10); #endif #if defined(__WINDOWS__) || defined(__linux__) char msg[80]; sprintf (msg, "%s (%d) :\n%s", nomfic, ligne, texte); WinMessage (0, msg); #endif fbb_error (ERR_SYNTAX, nomfic, ligne); } static unsigned int tail_lang = 0; void end_textes (void) { int cpt; if (langue == NULL) return; m_libere (nomlang, LG_LANG * maxlang); for (cpt = 0; cpt < NBLANG; cpt++) { m_libere (langue[cpt]->plang[0], tail_lang); m_libere (langue[cpt], sizeof (tlang)); } m_libere (langue, NBLANG * sizeof (tlang *)); langue = NULL; vlang = -1; } void initexte (void) { int cpt, nb, niv, nbc, ligne; unsigned int taille = 0; FILE *fptr; char s[81], nomfic[81]; #ifdef __FBBDOS__ fen *fen_ptr; #endif ligne = niv = 0; strcpy (nomfic, "LANGUE.SYS"); if ((fptr = fopen (c_disque (nomfic), "rt")) == NULL) { #ifdef ENGLISH err_fic (nomfic, ligne, "File LANGUE.SYS not found "); #else err_fic (nomfic, ligne, "Erreur ouverture LANGUE.SYS"); #endif return; } #ifdef __linux__ #ifdef ENGLISH cprintf ("Texts set-up \n"); #else cprintf ("Initialisation des textes\n"); #endif #else #ifdef ENGLISH cprintf ("Texts set-up \r\n"); #else cprintf ("Initialisation des textes\r\n"); #endif #endif nbc = cpt = 0; #ifdef ENGLISH strcpy (s, " Texts set-up "); #else strcpy (s, "Initialisation des textes"); #endif #ifdef __FBBDOS__ fen_ptr = open_win (10, 6, 60, 16, INIT, s); #endif while (fgets (s, 80, fptr)) { ++ligne; if (*s == '#') continue; switch (niv) { case 0: if (isdigit (*s)) { nb = sscanf (s, "%d %d %d", &nbc, &NBLANG, &deflang); if (nb != 3) { deflang = 0; NBLANG = 3; } if (deflang > nbc) deflang = 0; else deflang--; /* if (NBLANG < 2) NBLANG = 2 ; */ if (NBLANG > nbc) NBLANG = nbc; if (nbc < 1) #ifdef ENGLISH err_fic (nomfic, ligne, "Error languages number "); #else err_fic (nomfic, ligne, "Erreur nombre de langues"); #endif } else #ifdef ENGLISH err_fic (nomfic, ligne, "Error : No languages number"); #else err_fic (nomfic, ligne, "Manque nombre de langues "); #endif ++niv; nomlang = (char *) m_alloue (LG_LANG * nbc); #ifdef __linux__ #ifdef ENGLISH cprintf ("%d language buffers allocated\n", NBLANG); #else cprintf ("%d buffers langue allou‚s \n", NBLANG); #endif #else #ifdef ENGLISH cprintf ("%d language buffers allocated\r\n", NBLANG); #else cprintf ("%d buffers langue allou‚s \r\n", NBLANG); #endif #endif break; case 1: if (!ISPRINT (*nomfic)) break; strn_cpy (LG_LANG - 1, nomlang + cpt * LG_LANG, sup_ln (s)); #ifdef __WINDOWS__ InitText (nomlang + cpt * LG_LANG); #endif #ifdef __FBBDOS__ cprintf ("\r\n%8s ", nomlang + cpt * LG_LANG); #endif #ifdef __linux__ printf ("Init lang %9s\n", nomlang + (cpt * LG_LANG)); #endif nb = lang_len (nomlang + (cpt * LG_LANG)); if (taille < nb) taille = nb; if (++cpt == nbc) ++niv; break; } if (niv == 2) break; } fclose (fptr); maxlang = cpt; tail_lang = taille; /* Alloue les NBLANG buffers de pointeurs et de textes */ langue = (tlang * *)m_alloue (NBLANG * sizeof (tlang *)); for (cpt = 0; cpt < NBLANG; cpt++) { langue[cpt] = (tlang *) m_alloue (sizeof (tlang)); langue[cpt]->plang[0] = (char *) m_alloue (taille); langue[cpt]->numlang = -1; } swap_langue (0, deflang); #ifdef __FBBDOS__ close_win (fen_ptr); #endif } static int lang_len (char *nom_lang) { char nomfic[81]; char texte[81]; char chaine[300]; int nb, taille; FILE *fpl; sprintf (nomfic, "LANG\\%s.TXT", nom_lang); if ((fpl = fopen (c_disque (nomfic), "rb")) == NULL) { #ifdef ENGLISH sprintf (chaine, "File %s not found", nomfic); #else sprintf (chaine, "Erreur fichier %s", nomfic); #endif err_fic (nomfic, 0, chaine); } taille = (size_t) 0; nb = 0; while (fgets (chaine, 257, fpl)) { if ((*chaine == '#') || (*chaine == '\0') || (*chaine == '\032')) continue; taille += (unsigned int) strlen (chaine); if (++nb > NBTEXT) break; #ifdef __FBBDOS__ if ((nb % 10) == 0) putch ('.'); #endif } if (nb != NBTEXT) { #ifdef ENGLISH sprintf (texte, "Wrong line number : need %d - found %d ", NBTEXT, nb); #else sprintf (texte, "Nombre de lignes incorrect : attendu %d - trouve %d", NBTEXT, nb); #endif err_fic (nomfic, nb, texte); } fclose (fpl); return (taille + 256); } void swap_langue (int num_buf, int num_lang) { char nomfic[81]; char chaine[300]; char *txt_ptr; int nb; FILE *fpl; #ifdef __FBBDOS__ fen *fen_ptr; #endif if (langue[num_buf]->numlang == num_lang) return; txt_ptr = langue[num_buf]->plang[0]; sprintf (nomfic, "LANG\\%s.TXT", nomlang + num_lang * LG_LANG); if ((fpl = fopen (c_disque (nomfic), "rb")) == NULL) { #ifdef ENGLISH sprintf (chaine, "File %s not found", nomfic); #else sprintf (chaine, "Erreur fichier %s", nomfic); #endif err_fic (nomfic, 0, chaine); } deb_io (); #ifdef __FBBDOS__ #ifdef ENGLISH fen_ptr = open_win (55, 4, 75, 6, INIT, " Text "); #else fen_ptr = open_win (55, 4, 75, 6, INIT, "Textes"); #endif #endif nb = 0; while (fgets (chaine, 257, fpl)) { sup_ln (chaine); if ((*chaine == '#') || (*chaine == '\0')) continue; #ifdef __FBBDOS__ if ((nb % 50) == 0) putch ('.'); #endif strcpy (txt_ptr, chaine); langue[num_buf]->plang[nb] = txt_ptr; txt_ptr += strlen (chaine) + 1; ++nb; if (nb > NBTEXT) break; } fclose (fpl); langue[num_buf]->numlang = num_lang; #ifdef __FBBDOS__ close_win (fen_ptr); #endif fin_io (); } void read_heard (void) { int i; FILE *fptr; if ((fptr = fopen (d_disque ("HEARD.BIN"), "rb")) != NULL) { for (i = 0; i < NBPORT; i++) { fread (p_port[i].heard, sizeof (Heard), NBHEARD, fptr); } fclose (fptr); } } void write_heard (void) { int i; FILE *fptr; if (p_port == NULL) return; if ((fptr = fopen (d_disque ("HEARD.BIN"), "wb")) != NULL) { for (i = 0; i < NBPORT; i++) { fwrite (p_port[i].heard, sizeof (Heard), NBHEARD, fptr); } fclose (fptr); } } fbb-7.0.10/src/mbl_impo.c0000644000175000017500000004163413613360505012014 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include static long skip_header (FILE * fptr) { char ligne[256]; long record = 0L; record = ftell (fptr); while (fgets (ligne, 256, fptr)) { strupr (ligne); if ((ligne[0] != '\n') && (strncmp (ligne, "R:", 2) != 0) && (strncmp (ligne, "TO:", 3) != 0) && (strncmp (ligne, "TO :", 5) != 0) && (strncmp (ligne, "FROM:", 5) != 0)) break; record = ftell (fptr); } return (record); } int mess_fic (void) { int fd_orig, fd_dest; FILE *fptr; char *ptr; int verbose = 0; int header = 0; int append = 0; int access; bullist *pbul; long numess; long nb_oct = 1L; char fichier[256]; ptr = indd; if (toupper (*indd) == 'V') { verbose = 1; ++indd; } else if (toupper (*indd) == 'H') { header = 1; ++indd; } if (toupper (*indd) == 'A') { append = 1; ++indd; } if (ISGRAPH (*indd)) return (1); if (read_only ()) { retour_mbl (); return (0); } fbb_log (voiecur, 'M', strupr (ptr)); strcpy (pvoie->dos_path, "\\"); pvoie->temp1 = N_MBL; incindd (); if (((isdigit (*indd)) && ((numess = lit_chiffre (1)) != 0L)) || ((numess = ptmes->numero) > 0L)) { if (((pbul = ch_record (NULL, numess, ' ')) != NULL) && (droit_ok (pbul, 1))) { while (isdigit (*indd)) ++indd; incindd (); strupr (sup_ln (indd)); if (*indd) { if ((!tst_point (indd)) || (!aut_ecr (ch_slash (indd), 1))) { retour_mbl (); return (0); } strcpy (fichier, tot_path (ch_slash (indd), pvoie->dos_path)); if ((fptr = ouvre_mess (O_TEXT, numess, '\0')) != NULL) { fd_orig = fileno (fptr); if (!verbose) lseek (fd_orig, skip_header (fptr), 0); } else { retour_mbl (); return (0); } access = O_WRONLY | O_CREAT | O_TEXT; if (append) access |= O_APPEND; else access |= O_TRUNC; if ((fd_dest = open (fichier, access, S_IREAD | S_IWRITE)) == EOF) { strn_cpy (40, pvoie->appendf, indd); texte (T_ERR + 30); fclose (fptr); retour_mbl (); return (0); } if (*ptmes->bbsv) sprintf (varx[0], "@%-6s ", ptmes->bbsv); else *varx[0] = '\0'; if (header || verbose) { ptr = expand (langue[vlang]->plang[T_MBL + 35 - 1]); nb_oct += (long) write (fd_dest, ptr, strlen (ptr)); ptr = expand (langue[vlang]->plang[T_MBL + 38 - 1]); nb_oct += (long) write (fd_dest, ptr, strlen (ptr)); nb_oct += 2L; } else if (append) lseek (fd_dest, 0, SEEK_END); nb_oct += copy_fic (fd_orig, fd_dest, NULL); fclose (fptr); close (fd_dest); wr_dir (fichier, pvoie->sta.indicatif.call); w_label (fichier, ptmes->titre); ltoa (nb_oct, varx[0], 10); texte (T_DOS + 7); } else texte (T_ERR + 20); } else texte (T_ERR + 10); } else texte (T_ERR + 3); retour_mbl (); return (0); } int routage (long no) { int c, ok; int route = 0, n = 0; long curr, rec = 0L; FILE *fptr; char ligne[256]; char *scan, *ptr; strn_cpy (40, ptmes->bbsv, mycall); mess_name (MESSDIR, no, ligne); if ((fptr = fopen (ligne, "rb")) != NULL) { /* Binaire obligatoire */ curr = 0L; while (fgets (ligne, 255, fptr)) { if (strncmp ("R:", ligne, 2) == 0) { scan = ligne; while (*scan) { if (*scan == '@') { rec = curr; break; } ++scan; ++curr; } } else break; curr = ftell (fptr); } if (rec) { route = 1; fseek (fptr, rec, 0); ptr = ptmes->bbsv; ok = 0; while ((c = fgetc (fptr)) != EOF) { if ((!ok) && (isalnum (c))) ok = 1; if (ok) { if (ISGRAPH (c)) { *ptr++ = toupper (c); if (++n == 40) break; } else break; } } *ptr = '\0'; } fclose (fptr); } return (route); } static void lit_fich (char *champ, int nb) { while ((nb--) && (ISGRAPH (*indd))) { *champ++ = toupper (*indd); indd++; } *champ = '\0'; } void send_reply (void) { long numess; bullist *pbul; char temp[80]; incindd (); if (((isdigit (*indd) || (*indd == '#')) && ((numess = lit_chiffre (1)) != 0L)) || ((numess = ptmes->numero) > 0L)) { if ((pbul = ch_record (NULL, numess, '\0')) != NULL) { ini_champs (voiecur); strn_cpy (6, ptmes->desti, pbul->exped); strn_cpy (6, ptmes->exped, pvoie->sta.indicatif.call); routage (numess); swapp_bbs (ptmes); ptmes->type = 'P'; ptmes->status = 'N'; reacheminement (); teste_espace (); sup_ln (indd); if ((*indd == '+') && (droits (ACCESDOS))) { incindd (); lit_fich (pvoie->appendf, 79); if (access (pvoie->appendf, 0) != 0) { texte (T_ERR + 11); retour_mbl (); return; } incindd (); } if (*indd) { n_cpy (60, ptmes->titre, indd); } else { /* strn_cpy (3, temp, pbul->titre); */ if (strncmpi (pbul->titre, "RE:", 3) == 0) strcpy (ptmes->titre, pbul->titre); else if (strncmpi (pbul->titre, "CP SYSOP: ", 10) == 0) strcpy (ptmes->titre, 10 + pbul->titre); else { n_cpy (55, temp, pbul->titre); sprintf (ptmes->titre, "Re: %s", temp); } } texte (T_MBL + 50); entete_saisie (); maj_niv (15, 0, 2); texte (T_MBL + 6); if ((sed) && (EditorOff) && (voiecur == CONSOLE)) { aff_etat ('E'); /* send_buf (voiecur); */ reply = 1; pvoie->enrcur = numess; #ifdef __WINDOWS__ maj_niv (N_MBL, 3, 0); if (win_edit () == 5) end_win_edit (); #endif #ifdef __linux__ if (daemon_mode) editor_request = 1; else { maj_niv (N_MBL, 3, 0); if (xfbb_edit () == 5) end_xfbb_edit (); } #endif #ifdef __FBBDOS__ maj_niv (N_MBL, 3, 0); if (mini_edit () == 5) end_mini_edit (); #endif } return; } else texte (T_ERR + 10); } else texte (T_ERR + 3); retour_mbl (); } void send_copy (void) { bullist *pbul; int retour = 1; incindd (); if (((isdigit (*indd)) && ((ptmes->numero = lit_chiffre (1)) != 0L)) || ((*indd == '#') && (ptmes->numero > 0L))) { if (((pbul = ch_record (NULL, ptmes->numero, ' ')) != NULL) && (droit_ok (pbul, 1))) { if (copy_mess (ptmes->numero, indd, '\0')) retour = 0; } else texte (T_ERR + 10); } else { texte (T_ERR + 3); } if (retour) retour_mbl (); } /* Ecrit les headers reduits dans data */ static long reduit_message (long numero, char *filename, char *last_header) { int file; FILE *fptr; int c, first = 1; int nb = 0; int call = 0; char ligne[90]; char header[90]; char *ptr = ligne; int flag = FALSE; long record = 0L; int access = O_WRONLY | O_CREAT | O_TEXT | O_TRUNC; short int postexte = 0; char *hdr = header; *hdr = '\0'; *last_header = '\0'; if ((fptr = ouvre_mess (O_TEXT, numero, '\0')) == NULL) { return (0); } if ((file = open (filename, access, S_IREAD | S_IWRITE)) == EOF) { fclose (fptr); return (0); } while ((c = fgetc (fptr)) != EOF) { if ((flag) && (c == '\n')) { record = ftell (fptr); postexte = 0; call = 0; flag = FALSE; *hdr = '\0'; strcpy (last_header, header); hdr = header; } else { switch (call) { case 0: break; case 1: if (isalnum (c)) { *ptr++ = c; nb++; call = 2; } break; case 2: if (isalnum (c)) { *ptr++ = c; nb++; } else { *ptr++ = '!'; nb++; call = 0; if (nb >= 65) { *ptr++ = '\n'; ++nb; write (file, ligne, nb); nb = 0; ptr = ligne; first = 2; } } break; } if (postexte == 0) { if (c != 'R') /*return(record) */ break; else flag = TRUE; } if ((postexte == 1) && (flag) && (c != ':')) /*return(record) */ { flag = FALSE; break; } ++postexte; if (postexte < 80) *hdr++ = c; } if ((flag) && (c == '@')) { if (first) { if (first == 1) write (file, "Path: !", 7); else write (file, " !", 7); first = 0; } call = 1; } } if (nb) { *ptr++ = '\n'; ++nb; write (file, ligne, nb); } fseek (fptr, record, 0); fflush (fptr); copy_fic (fileno (fptr), file, NULL); fclose (fptr); close (file); return (1); } int copy_mess (long numero, char *chaine, char car_fin) { int i; int test; char temp[256]; char last_header[128]; bullist *pbul; int retour = 1; if ((pbul = ch_record (NULL, numero, '\0')) != NULL) { ptmes->status = 'N'; ptmes->type = 'P'; ptmes->taille = 0L; ptmes->theme = 0; ptmes->numero = 0L; pvoie->messdate = time (NULL); pvoie->mess_num = -1L; *(pvoie->mess_bid) = '\0'; *(ptmes->desti) = '\0'; *(ptmes->bbsv) = '\0'; *(ptmes->bbsf) = '\0'; *(ptmes->bid) = '\0'; strcpy (pvoie->appendf, copy_name (voiecur, temp)); strn_cpy (6, ptmes->exped, pbul->exped); for (i = 0; i < NBMASK; i++) ptmes->forw[i] = ptmes->fbbs[i] = '\0'; if (strcmp(pvoie->sta.indicatif.call, "SYSOP") == 0) { /* SYSOP private message keeps the original sender */ strn_cpy (6, ptmes->exped, pbul->exped); /* Copy the bbsf field to avoid the from/to lines... */ strn_cpy (6, ptmes->bbsf, pbul->bbsf); } else { /* Not a sysop message */ strn_cpy (6, ptmes->exped, pvoie->sta.indicatif.call); } n_cpy (48, temp, pbul->titre); sprintf (ptmes->titre, "CP %s: %s", pvoie->sta.indicatif.call, temp); indd = chaine; if (*indd == '#') *indd = 'P'; if (scan_com_fwd ()) { if (deja_recu (ptmes, 1, &test) == 1) { texte (T_MBL + 45); retour = 0; } else { struct tm *sdate; reduit_message (numero, pvoie->appendf, last_header); sdate = gmtime (&pvoie->messdate); sprintf (temp, "%s\r\rOriginal to %s@%s\r\r%c", last_header, pbul->desti, pbul->bbsv, car_fin); get_mess_fwd ('C', temp, strlen (temp), 2); if (car_fin == '\0') { maj_niv (15, 0, 2); texte (T_MBL + 6); } } } else retour = 0; } else { texte (T_ERR + 10); retour = 0; } return (retour); } void import_message (char *nom_fich) { int i; int fd; int type, retour; int test; int recu; int sav_mode; FILE *fptr; char s[80]; char ligne[81]; char temp[256]; char lock_name[256]; retour = 1; aff_etat ('I'); while (hupdate ()); aff_header (voiecur); sav_mode = pvoie->mode; pvoie->lignes = -1; pvoie->finf.lang = langue[0]->numlang; strcpy (lock_name, lfile (nom_fich)); for (i = 0; i < 2; i++) { /* Checks for the lock file and creates it */ fd = open (lock_name, O_EXCL | O_CREAT, S_IREAD | S_IWRITE); if (fd == -1) { #ifdef __WIN32__ long tt; WIN32_FIND_DATA ff; SYSTEMTIME t; FILETIME ft; if (errno != EEXIST) { sprintf (temp, "*** error : Cannot create lock file %s\r", lock_name); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); retour = 2; break; } if (FindFirstFile ((char *) lock_name, &ff) != (HANDLE) - 1) { FileTimeToSystemTime (&ff.ftLastWriteTime, &t); sprintf (temp, "*** File %02d:%02d:%02d\r", t.wHour, t.wMinute, t.wSecond); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); GetSystemTime (&t); SystemTimeToFileTime (&t, &ft); sprintf (temp, "*** System %02d:%02d:%02d\r", t.wHour, t.wMinute, t.wSecond); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); /* Add one hour to File time (approximative) */ ff.ftLastWriteTime.dwHighDateTime += 9; if (CompareFileTime (&ft, &ff.ftLastWriteTime) > 0L) { /* If more than 1 hour, delete the lock file if possible */ unlink (lock_name); sprintf (temp, "*** file %s was locked since more than 1 hour, lock deleted !!\r", nom_fich); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); } else { sprintf (temp, "*** file %s locked !!\r", nom_fich); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); retour = 2; break; } } #else /* Checks the date of the lock file */ struct stat statbuf; long t = time (NULL); if (errno != EEXIST) { sprintf (temp, "*** error : Cannot create lock file %s\r", lock_name); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); retour = 2; break; } if ((stat (lock_name, &statbuf) == 0) && ((t - statbuf.st_ctime) > 3600L)) { /* If more than 1 hour, delete the lock file if possible */ if (unlink (lock_name) != 0) { sprintf (temp, "*** error : Cannot unlink lock file %s, %s\r", lock_name, strerror (errno)); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); } sprintf (temp, "*** file %s was locked from more than 1 hour, lock deleted !!\r", nom_fich); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); } else { sprintf (temp, "*** file %s locked !!\r", nom_fich); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); retour = 2; break; } #endif } else break; } if (fd != -1) { close (fd); if ((fptr = fopen (nom_fich, "rt")) != NULL) { long pos = svoie[mail_ch]->enrcur; fseek (fptr, pos, 0); while (1) { type = 2; libere_route (voiecur); if (fgets (ligne, 80, fptr) == NULL) break; lf_to_cr (ligne); if (*ligne == '#') { pvoie->mode = 0; continue; } if ((*ligne == '\r') || (toupper (*ligne) != 'S') || ((ligne[1] != ' ') && (ligne[2] != ' '))) continue; if (aff_inexport) aff_bas (voiecur, W_RCVT, ligne, strlen (ligne)); indd = ligne + 1; if (lit_com_fwd () == 0) { outln ("NO", 2); type = 3; } recu = deja_recu (&(svoie[voiecur]->entmes), 1, &test); if ((recu == 1) || (recu == 4)) { sprintf (s, "N - Bid %s", svoie[voiecur]->entmes.bid); outln (s, strlen (s)); type = 3; } if (type == 2) { /* reacheminement() ; */ outln ("OK", 2); } aff_etat ('E'); send_buf (voiecur); if (fgets (ligne, 80, fptr) == NULL) break; lf_to_cr (ligne); if (type == 2 && aff_inexport) aff_bas (voiecur, W_RCVT, ligne, strlen (ligne)); indd = sup_ln (ligne); rcv_titre (); while (1) { if (fgets (ligne, 80, fptr) == NULL) break; lf_to_cr (ligne); if (type == 2 && aff_inexport) aff_bas (voiecur, W_RCVT, ligne, strlen (ligne)); /* Closes the mail.in in case of calling a server */ if ((strchr (ligne, 'Z' - '@') != NULL) || (strncmpi (ligne, "/EX", 3) == 0)) { svoie[mail_ch]->enrcur = ftell (fptr); #ifdef __WIN32__ /* One more than true position in WIN32 ... Why ??? */ if (svoie[mail_ch]->enrcur > 0L) --svoie[mail_ch]->enrcur; #endif ferme (fptr, 7); fptr = NULL; if (unlink (lock_name) != 0) { sprintf (temp, "*** error : Cannot unlink lock file %s, %s\r", lock_name, strerror (errno)); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); } } if (get_mess_fwd ('I', ligne, strlen (ligne), type)) { retour = 0; break; } free_mem (); } break; } if (fptr) { svoie[mail_ch]->enrcur = ftell (fptr); #ifdef __WIN32__ /* One more than true position in WIN32 ... Why ??? */ if (svoie[mail_ch]->enrcur > 0L) --svoie[mail_ch]->enrcur; #endif ferme (fptr, 7); if (unlink (lock_name) != 0) { sprintf (temp, "*** error : Cannot unlink lock file %s, %s\r", lock_name, strerror (errno)); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); } } } else { char buf[80]; sprintf (buf, "*** Cannot import %s\r", nom_fich); /* outln (buf, strlen(buf)); */ aff_bas (voiecur, W_RCVT, buf, strlen (buf)); if (unlink (lock_name) != 0) { sprintf (temp, "*** error : Cannot unlink lock file %s, %s\r", lock_name, strerror (errno)); aff_bas (voiecur, W_RCVT, temp, strlen (temp)); } } } /* Remet le mode par defaut */ pvoie->mode = sav_mode; if (retour) { if (aff_inexport) aff_bas (voiecur, W_RCVT, "*** done\r", 9); if ((retour == 1) && (strcmp (io_fich, MAILIN) == 0)) unlink (MAILIN); inexport = 0; deconnexion (voiecur, 1); #if defined(__WINDOWS__) || defined(__linux__) window_disconnect (voiecur); #endif init_etat (); } else { outln ("Import>", 7); aff_etat ('E'); send_buf (voiecur); } aff_etat ('A'); status (voiecur); } fbb-7.0.10/src/fwdovl5.c0000644000175000017500000003314713613360505011604 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 5 */ #include #define MPAR MESSDIR typedef struct { long val; int num; char bbs[7]; char bid[13]; long taille; } Rec_enc; #define MAX_ENCOURS 20 typedef struct type_encours { Rec_enc enc[MAX_ENCOURS]; struct type_encours *next; } Encours; static Encours *tete_encours = NULL; static long part_num; static char *r_bloc (int numero) { Broute *pcur = tbroute; df ("r_bloc", 1); #ifndef __WINDOWS__ if (EMS_HRT_OK ()) { ff (); return (sel_bloc (HROUTE, numero)); } #endif while (numero--) { pcur = pcur->suiv; if (pcur == NULL) { ff (); return (NULL); } } ff (); return (pcur->b_route); } static int r_bloc_size (void) { return (EMS_HRT_OK ()? EMS_BLOC : MAX_BROUTE); } static char *new_bloc_route (void) { char *ptr; Broute *pcur = tbroute; df ("new_bloc_route", 0); #ifndef __WINDOWS__ if (EMS_HRT_OK ()) { ptr = new_bloc (HROUTE); } else { #endif if (pcur) { while (pcur->suiv) pcur = pcur->suiv; pcur->suiv = (Broute *) m_alloue (sizeof (Broute)); pcur = pcur->suiv; } else { pcur = tbroute = (Broute *) m_alloue (sizeof (Broute)); } pcur->suiv = NULL; ptr = pcur->b_route; #ifndef __WINDOWS__ } #endif ff (); return (ptr); } void cree_routes (void) { int pos; int len; int nb_routes = 0; FILE *fptr; char *mptr; char status; char ligne[80]; char hroute[80]; int numero = 0; int max_broute = r_bloc_size (); if (!h_ok) return; df ("cree_routes", 0); new_bloc_route (); if ((fptr = fopen (d_disque ("HROUTE.SYS"), "rt")) != NULL) { #ifdef ENGLISH cprintf ("H-ROUTES set-up... \r\n"); #else cprintf ("Initialisation des H-ROUTES\r\n"); #endif mptr = r_bloc (numero); if (mptr) { memset (mptr, 0, r_bloc_size ()); pos = 0; while (fgets (ligne, 80, fptr)) { status = '#'; strupr (ligne); sscanf (ligne, "%c %s", &status, hroute); if (status == '#') continue; len = strlen (hroute) + 2; if ((pos + len) >= max_broute) { new_bloc_route (); mptr = r_bloc (++numero); if (mptr == NULL) break; memset (mptr, 0, r_bloc_size ()); pos = 0; } *mptr++ = status; strcpy (mptr, hroute); mptr += (len - 1); pos += len; if ((nb_routes % 100) == 0) cprintf ("\r%d routes", nb_routes); ++nb_routes; } } ferme (fptr, 76); cprintf ("\r%d routes\r\n", nb_routes); } ff (); } static void kill_file_route (char *route) { FILE *fptr; char ligne[80]; char hroute[80]; long pos = 0L; char type; df ("kill_file_route", 2); if ((fptr = fopen (d_disque ("HROUTE.SYS"), "r+t")) != NULL) { while (fgets (ligne, 80, fptr)) { sscanf (ligne, "%c %s", &type, hroute); if ((type == 'V') && (strcmp (hroute, route) == 0)) { fseek (fptr, pos, 0); fputc ('#', fptr); break; } pos = ftell (fptr); } ferme (fptr, 75); } ff (); } static void new_file_route (char *route) { FILE *fptr; char ligne[80]; df ("new_file_route", 2); if ((fptr = fappend (d_disque ("HROUTE.SYS"), "b")) != NULL) { sprintf (ligne, "V %s\r\n", route); fputs (ligne, fptr); ferme (fptr, 74); } ff (); } static void new_route (char *route) { char *scan; char *mptr = NULL; int len; unsigned pos = 0; int numero = 0; int max_broute = r_bloc_size (); /* char temp[80]; */ df ("new_route", 2); len = strlen (route) + 2; while ((scan = r_bloc (numero)) != NULL) { pos = 0; for (;;) { mptr = scan; if (*scan == '\0') break; while (*scan) { ++scan; ++pos; } ++scan; ++pos; if (pos >= max_broute) break; } ++numero; } if ((pos + len) >= max_broute) { new_bloc_route (); mptr = r_bloc (numero); memset (mptr, 0, r_bloc_size ()); } *mptr++ = 'V'; strcpy (mptr, route); new_file_route (route); ff (); } int cherche_route (bullist * pbull) { char *ptr; int trouve = 0; char *scan; char *mptr = NULL; char stat; unsigned pos; int numero = 0; int max_broute = r_bloc_size (); df ("cherche_route", 2); if ((*pbull->bbsv == '\0') || (strchr (pbull->bbsv, '.'))) { ff (); return (0); } if (route_wp_hier (pbull)) { var_cpy (0, "WP"); ff (); return (1); } if (!h_ok) { ff (); return (0); } var_cpy (0, "H"); while ((scan = r_bloc (numero)) != NULL) { pos = 0; for (;;) { stat = *scan++; ++pos; mptr = scan; if (stat == '\0') break; ptr = pbull->bbsv; for (;;) { if ((!isalnum (*scan)) && (*ptr == '\0')) trouve = 1; if (*scan != *ptr) break; ++scan; ++ptr; ++pos; } if (trouve) break; while (*scan) { ++scan; ++pos; } ++scan; ++pos; if (pos >= max_broute) break; } if (trouve) break; ++numero; } if (trouve) { strn_cpy (40, pbull->bbsv, mptr); } ff (); return (trouve); } char *extend_bbs (char *bbs) { static char ext_bbs[41]; bullist bull; df ("extend_bbs", 2); strn_cpy (40, bull.bbsv, bbs); strn_cpy (6, bull.desti, bbs); if (cherche_route (&bull)) { strn_cpy (40, ext_bbs, bull.bbsv); return (ext_bbs); } ff (); return (bbs); } static void add_route (char *route) { char *ptr; int trouve = 0; char stat = '\0'; char *scan; char *mptr = NULL; char *bbsv; unsigned pos; int numero = 0; int max_broute = r_bloc_size (); df ("add_route", 2); bbsv = bbs_via (strupr (route)); while ((scan = r_bloc (numero)) != NULL) { pos = 0; for (;;) { stat = *scan++; ++pos; mptr = scan; if (stat == '\0') break; ptr = bbsv; for (;;) { if ((!isalnum (*scan)) && (*ptr == '\0')) trouve = 1; if (*scan != *ptr) break; ++scan; ++ptr; ++pos; } if (trouve) break; while (*scan) { ++scan; ++pos; } ++scan; ++pos; if (pos >= max_broute) break; } if (trouve) break; ++numero; } if (trouve) { if ((stat != 'P') && (strcmp (route, mptr) != 0)) { kill_file_route (mptr); while (*mptr) *mptr++ = '@'; new_route (route); } } else { new_route (route); } ff (); } int hupdate (void) { Hroute *pcurr; df ("hupdate", 0); if (throute) { aff_etat ('W'); pcurr = throute; if (strchr (throute->route, '.')) add_route (throute->route); throute = throute->suiv; m_libere (pcurr, sizeof (Hroute)); aff_etat ('A'); } ff (); return (throute != NULL); } /* Teste si la route existe dans les headers */ int is_route (char *route) { Route *r_ptr = pvoie->r_tete; char *ptr; int nb; df ("is_route", 2); while (r_ptr) { for (nb = 0; nb < NBROUTE; nb++) { ptr = r_ptr->call[nb]; if (*ptr == '\0') break; if (strcmp (route, ptr) == 0) { ff (); return (1); } } r_ptr = r_ptr->suite; } ff (); return (0); } void old_part (char *bbs, char *bid) { int pos; Encours *eptr = tete_encours; df ("old_part", 4); *pvoie->sr_fic = '\0'; /* Cherche l'entree */ while (eptr) { for (pos = 0; pos < MAX_ENCOURS; pos++) { if (*eptr->enc[pos].bbs == '\0') continue; if ((strcmp (eptr->enc[pos].bbs, bbs) == 0) && (strcmp (eptr->enc[pos].bid, bid) == 0)) { sprintf (pvoie->sr_fic, "%s%08ld.TMP", MPAR, eptr->enc[pos].val); break; } } eptr = eptr->next; } if (*pvoie->sr_fic == '\0') { fbb_error (ERR_CREATE, bid, 0); } ff (); } void mod_part (char *bbs, long size, char *bid) { int pos; char file[80]; Encours *eptr = tete_encours; df ("mod_part", 6); /* Cherche l'entree */ while (eptr) { for (pos = 0; pos < MAX_ENCOURS; pos++) { if (*eptr->enc[pos].bbs == '\0') continue; if ((strcmp (eptr->enc[pos].bbs, bbs) == 0) && (strcmp (eptr->enc[pos].bid, bid) == 0)) { if (size == 0L) { *eptr->enc[pos].bbs = 0; sprintf (file, "%s%08ld.TMP", MPAR, eptr->enc[pos].val); unlink (file); } else { eptr->enc[pos].taille = size; } break; } } eptr = eptr->next; } ff (); } static void add_part (long part_val, char *bbs, long size, char *bid) { int fin = 0; int pos = 0; Encours *eptr = tete_encours; df ("add_part", 8); if (!eptr) { tete_encours = eptr = (Encours *) m_alloue (sizeof (Encours)); } /* Cherche une entree libre */ while (eptr) { for (pos = 0; pos < MAX_ENCOURS; pos++) { if (*eptr->enc[pos].bbs == 0) { fin = 1; break; } } if (fin) break; if (!eptr->next) { eptr->next = (Encours *) m_alloue (sizeof (Encours)); } eptr = eptr->next; } strn_cpy (13, eptr->enc[pos].bid, bid); strn_cpy (6, eptr->enc[pos].bbs, bbs); eptr->enc[pos].val = part_val; eptr->enc[pos].taille = size; ff (); } int part_file (char *bbs, char *bid) { int fd; df ("part_file", 4); part_num = (part_num + 1L) & 0x3ffffffL; sprintf (pvoie->sr_fic, "%s%08ld.TMP", MPAR, part_num); add_part (part_num, bbs, 0L, bid); fd = open (pvoie->sr_fic, O_WRONLY | O_CREAT | O_BINARY, S_IREAD | S_IWRITE); if (fd == -1) { write_error (pvoie->sr_fic); ff (); return (0); } if (write (fd, bbs, 7) != 7) { write_error (pvoie->sr_fic); ff (); return (0); } if (write (fd, bid, 13) != 13) { write_error (pvoie->sr_fic); ff (); return (0); } close (fd); ff (); return (1); } void del_part (int voie, char *bid) { int pos; char file[80]; Encours *eptr = tete_encours; df ("del_part", 2); while (eptr) { for (pos = 0; pos < MAX_ENCOURS; pos++) { if (*eptr->enc[pos].bbs == 0) continue; if (strcmp (eptr->enc[pos].bid, bid) == 0) { int v; *eptr->enc[pos].bbs = 0; sprintf (file, "%s%08ld.TMP", MPAR, eptr->enc[pos].val); for (v = 1; v < NBVOIES; v++) { if (v == voie) continue; if ((svoie[v]->sta.connect) && (strcmp (file, svoie[v]->sr_fic) == 0)) break; } if (v == NBVOIES) unlink (file); /* else { char buffer[80]; sprintf(buffer, "del_part ch %d : %s found on %d", voie, file, v); write_error(buffer); } */ } } eptr = eptr->next; } ff (); } void end_parts (void) { Encours *eptr; while (tete_encours) { eptr = tete_encours; tete_encours = tete_encours->next; m_libere (eptr, sizeof (Encours)); } } void init_part (void) { int fd; int test; char path[80]; char file[80]; char bid[14]; char call[7]; bullist bul; struct ffblk dirblk; df ("init_part", 0); part_num = time (NULL); memset (&bul, 0, sizeof (bullist)); sprintf (path, "%s*.TMP", MPAR); if (findfirst (path, &dirblk, FA_DIREC)) { ff (); return; } do { if ((dirblk.ff_attrib & FA_DIREC) == 0) { sprintf (file, "%s%s", MPAR, dirblk.ff_name); if ((fd = open (file, O_RDONLY)) > 0) { if ((read (fd, call, 7) == 7) && (read (fd, bid, 13) == 13)) { strcpy (bul.bid, bid); if ((dirblk.ff_fsize == 20) || (deja_recu (&bul, 1, &test))) { unlink (file); } else { struct tm *tm; time_t temps = time (NULL); int jour; int delai; jour = dirblk.ff_fdate & 0x1f; tm = gmtime (&temps); delai = tm->tm_mday - jour; if (jour < 0) jour += 31; if (jour > 15) unlink (file); else add_part (atol (dirblk.ff_name), call, dirblk.ff_fsize - 20, bid); } } close (fd); } } } while (findnext (&dirblk) == 0); ff (); } /* Teste si les messages sont en partie recus pour la BBS concernee */ void part_recu (bullist * fb_mess, int nb, int *t_res) { Encours *eptr; int i, pos; df ("part_recu", 5); for (i = 0; i < nb; i++) { eptr = tete_encours; while (eptr) { for (pos = 0; pos < MAX_ENCOURS; pos++) { if (*eptr->enc[pos].bbs == '\0') continue; if ((strcmp (pvoie->sta.indicatif.call, eptr->enc[pos].bbs) == 0) && (strcmp (fb_mess[i].bid, eptr->enc[pos].bid) == 0)) { if ((t_res[i] == 1) || (t_res[i] == 4)) /* NO ou REJ */ { del_part (voiecur, fb_mess[i].bid); } else if (eptr->enc[pos].taille) { if (t_res[i] != 2) /* OK ou HELD */ { t_res[i] = 3; fb_mess[i].taille = eptr->enc[pos].taille; } } else { del_part (voiecur, fb_mess[i].bid); } } } eptr = eptr->next; } } ff (); } void print_part (void) { int pos; int ok = 0; char stemp[80]; Encours *eptr = tete_encours; df ("print_part", 0); /* Cherche l'entree */ while (eptr) { for (pos = 0; pos < MAX_ENCOURS; pos++) { if (*eptr->enc[pos].bbs == '\0') continue; sprintf (stemp, "BBS %-6s - BID %-12s (%ld bytes received)", eptr->enc[pos].bbs, eptr->enc[pos].bid, eptr->enc[pos].taille); printf ("BBS %-6s - BID %-12s (%ld bytes received)\n", eptr->enc[pos].bbs, eptr->enc[pos].bid, eptr->enc[pos].taille); outln (stemp, strlen (stemp)); ok = 1; } eptr = eptr->next; } if (!ok) outln ("None", 4); ff (); } fbb-7.0.10/src/forward.c0000644000175000017500000003321713613360505011660 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARD.C */ #include static int rcv_fwd (void); static void snd_fwd (void); static void snd_rev_fwd (void); static char *check_call (char *ptr) { char *scan = ptr; while (*scan > ' ') ++scan; if (*scan == '\0') scan = ptr; else { while ((*scan) && (isspace (*scan))) ++scan; if (isgraph(*scan) && !isalnum(*scan)) /* Pactor - ! ou % */ ++scan; if ((isdigit (*scan)) && (!isalnum (*(scan + 1)))) { ++scan; while ((*scan) && (!isalnum (*scan))) ++scan; } } return (scan); } static int connect_ok (char *ptr) { int i; int j; char *str; Forward *pfwd = pvoie->curfwd; static char *test[3] = {"Connected", "Failure", "Busy"}; if (pfwd->no_con == 1) return (1); for (j = 0; j < 5; j++) { for (i = 0; i < 3; i++) { if (j == 4) str = test[i]; else { str = pfwd->mesnode[j][i]; } if ((*str) && (strstr (ptr, str))) { return (i + 1); } } } return (0); } static int snd_mess_fwd_rli (void) { /* * Retour = 0 : pas de suite * = 1 : il y a une suite * = -1 : Plus de message */ if (mess_suiv (voiecur)) { libere_tread (voiecur); pvoie->enrcur = 0L; pvoie->t_read = (rd_list *) m_alloue (sizeof (rd_list)); pvoie->t_read->suite = NULL; pvoie->t_read->nmess = ptmes->numero; pvoie->t_read->pmess = ptmes; return (snd_mess (voiecur, 2)); } return (-1); } static void snd_fwd (void) { char *ptr = indd; char *scan, *st; char s[256]; int i, nobbs; long temps; Forward *pfwd = pvoie->curfwd; nobbs = pvoie->bbsfwd; switch (pvoie->niv3) { case 0: if (pfwd->no_con < 8) { switch (connect_ok (ptr)) { case 0: break; case 1: scan = check_call (pfwd->con_lig[pfwd->no_con - 1]); pvoie->sta.indicatif.num = extind (scan, pvoie->sta.indicatif.call); if (*pfwd->con_lig[pfwd->no_con]) { outln (pfwd->con_lig[pfwd->no_con], strlen (pfwd->con_lig[pfwd->no_con])); pfwd->no_con++; } else { ptr = s; pfwd->no_con = 8; strcpy (pvoie->dos_path, "\\"); connexion (voiecur); /* positionne ncur */ nouveau (voiecur); if (pvoie->ctnc) { program_fwd (1, 1, &(pvoie->ctnc), voiecur); } if (*pfwd->con_lig[1]) { *ptr++ = ' '; *ptr++ = '{'; i = 0; while (1) { scan = pfwd->con_lig[i] + 2; while (ISGRAPH (*scan)) *ptr++ = *scan++; if ((++i == 7) || (*pfwd->con_lig[i + 1] == '\0')) { *ptr++ = '}'; *ptr++ = '\0'; break; } else *ptr++ = ','; } } *ptr = '\0'; status (voiecur); connect_log (voiecur, s); #ifdef __FBBDOS__ trait (0, ""); #endif if (*pfwd->txt_con) out (pfwd->txt_con, strlen (pfwd->txt_con)); } libere_tread (voiecur); break; case 2: /* Failure */ pvoie->mode |= F_FOR; pvoie->deconnect = 6; break; case 3: /* Busy */ set_link (nobbs, 1); pvoie->nb_choix = 1; pvoie->mode |= F_FOR; pvoie->deconnect = 6; break; } break; } if (att_prompt ()) { set_link (nobbs, 1); pvoie->nb_choix = 1; pvoie->maj_ok = 1; st = idnt_fwd (); if (pvoie->prot_fwd & FWD_FBB) { outs (st, strlen (st)); pvoie->temp1 = -1; pvoie->temp2 = TRUE; maj_niv (pvoie->niv1, 5, 0); new_fwd (); } else if (pvoie->prot_fwd & FWD_XPRO) { outs (st, strlen (st)); maj_niv (N_XFWD, 0, 9); xfwd (); } else if (FOR (pvoie->mode)) { outs (st, strlen (st)); if (pvoie->clock == 2) maj_niv (pvoie->niv1, pvoie->niv2, 4); else maj_niv (pvoie->niv1, pvoie->niv2, 5); } else { switch (snd_mess_fwd_rli ()) { case 0: ch_niv3 (2); /* Pas de suite */ break; case 1: ch_niv3 (1); /* Ya une suite */ break; case -1: pvoie->deconnect = 6; /* Plus de message */ break; } } } break; case 1: if (snd_mess (voiecur, 2) == 0) ch_niv3 (2); break; case 2: if (att_prompt ()) { /* Supression du message eventuel */ sprintf (s, "F %ld V:%s [%ld]", ptmes->numero, pvoie->sta.indicatif.call, ptmes->taille); fbb_log (voiecur, 'M', s); if (fin_envoi_fwd (voiecur)) ++stat_fwd; switch (snd_mess_fwd_rli ()) { case 0: break; case 1: ch_niv3 (1); case -1: pvoie->deconnect = 6; break; } } break; case 4: if (att_prompt ()) { strcpy (s, "C "); strcat (s, date_mbl (temps = time (NULL))); strcat (s, " "); strcat (s, heure_mbl (temps)); outsln (s, strlen (s)); maj_niv (pvoie->niv1, pvoie->niv2, 5); } break; case 5: if (att_prompt ()) { /* Supression du message eventuel */ if (fin_envoi_fwd (voiecur)) { ++stat_fwd; sprintf (s, "F %ld V:%s [%ld]", ptmes->numero, pvoie->sta.indicatif.call, ptmes->taille); fbb_log (voiecur, 'M', s); } if (mess_suiv (voiecur)) { entete_envoi_fwd (voiecur); maj_niv (pvoie->niv1, pvoie->niv2, 6); } else { if (pvoie->rev_mode) { texte (T_MBL + 42); maj_niv (pvoie->niv1, 3, 0); } else pvoie->deconnect = 6; } } break; case 6: switch (toupper (*indd)) { case 'O': pvoie->t_read = (rd_list *) m_alloue (sizeof (rd_list)); pvoie->t_read->suite = NULL; pvoie->t_read->nmess = ptmes->numero; pvoie->t_read->pmess = ptmes; pvoie->enrcur = 0L; if (snd_mess (voiecur, 1) == 0) ch_niv3 (5); else ch_niv3 (7); break; case 'N': ch_niv3 (5); sprintf (s, "N B:%s V:%s", ptmes->bid, pvoie->sta.indicatif.call); fbb_log (voiecur, 'M', s); break; case 'R': ch_niv3 (5); sprintf (s, "R B:%s V:%s", ptmes->bid, pvoie->sta.indicatif.call); fbb_log (voiecur, 'M', s); break; case 'L': ch_niv3 (8); pvoie->mess_egal[(int)pvoie->nb_egal] = ptmes->numero; ++pvoie->nb_egal; sprintf (s, "L B:%s V:%s", ptmes->bid, pvoie->sta.indicatif.call); fbb_log (voiecur, 'M', s); break; default: err_new_fwd (0, 9); /* pvoie->deconnect = 3; */ pvoie->deconnect = 6; break; } break; case 7: if (snd_mess (voiecur, 1) == 0) ch_niv3 (5); break; case 8: if (att_prompt ()) { /* message retarde */ if (mess_suiv (voiecur)) { entete_envoi_fwd (voiecur); maj_niv (pvoie->niv1, pvoie->niv2, 6); } else { if (pvoie->rev_mode) { texte (T_MBL + 42); maj_niv (pvoie->niv1, 3, 0); } else pvoie->deconnect = 6; } } break; } } /* * REVERSE - FORWARDING */ static void snd_rev_fwd (void) { int test; int res; switch (pvoie->niv3) { case 0: if (toupper (*indd) == 'S') { if (toupper (indd[1]) == 'X') { /* Forward xfwd */ maj_niv (N_XFWD, 1, 0); xfwd (); return; } ++indd; if (lit_com_fwd () == 0) { texte (T_MBL + 44); texte (T_MBL + 42); return; } res = deja_recu (ptmes, 1, &test); mark_reverse_bid (ptmes, 1, &test); switch (res) { case 0: texte (T_MBL + 46); maj_niv (pvoie->niv1, pvoie->niv2, 1); break; case 4: if (pvoie->mbl_ext) { outln ("REJECT", 6); texte (T_MBL + 42); return; } case 2: if (pvoie->mbl_ext) { outln ("LATER", 5); texte (T_MBL + 42); return; } case 1: texte (T_MBL + 45); texte (T_MBL + 42); /* supprimer de la liste des propositions */ return; } } else /* if (att_prompt()) */ pvoie->deconnect = 6; break; case 1: if (*indd) { rcv_titre (); maj_niv (pvoie->niv1, pvoie->niv2, 2); if (*indd) get_mess_fwd ('<', indd, nb_trait, 1); } break; case 2: get_mess_fwd ('<', data, nb_trait, 1); break; default: fbb_error (ERR_NIVEAU, "SND-REV-FWD", pvoie->niv3); break; } } void rcv_rev_fwd (void) { char s[256]; switch (pvoie->niv3) { case 0: appel_rev_fwd (TRUE); if (mess_suiv (voiecur)) { libere_tread (voiecur); entete_envoi_fwd (voiecur); ch_niv3 (1); } else { texte (T_MBL + 47); retour_menu (N_MBL); deconnexion (voiecur, 1); } break; case 1: switch (toupper (*indd)) { case 'O': pvoie->t_read = (rd_list *) m_alloue (sizeof (rd_list)); pvoie->t_read->suite = NULL; pvoie->t_read->nmess = ptmes->numero; pvoie->t_read->pmess = ptmes; pvoie->enrcur = 0L; if (snd_mess (voiecur, 1) == 0) ch_niv3 (2); else ch_niv3 (3); break; case 'N': ch_niv3 (2); sprintf (s, "N B:%s V:%s", ptmes->bid, pvoie->sta.indicatif.call); fbb_log (voiecur, 'M', s); break; case 'L': ch_niv3 (4); pvoie->mess_egal[(int)pvoie->nb_egal] = ptmes->numero; ++pvoie->nb_egal; sprintf (s, "L B:%s V:%s", ptmes->bid, pvoie->sta.indicatif.call); fbb_log (voiecur, 'M', s); break; case 'R': ch_niv3 (2); sprintf (s, "R B:%s V:%s", ptmes->bid, pvoie->sta.indicatif.call); fbb_log (voiecur, 'M', s); break; default: err_new_fwd (0, 9); pvoie->deconnect = 6; /* retour_menu(N_MBL) ; */ break; } break; case 2: if (att_prompt ()) { /* Le message a ete envoye */ fin_envoi_fwd (voiecur); sprintf (s, "> %ld V:%s [%ld]", ptmes->numero, pvoie->sta.indicatif.call, ptmes->taille); fbb_log (voiecur, 'M', s); ++stat_fwd; if (mess_suiv (voiecur)) { entete_envoi_fwd (voiecur); ch_niv3 (1); } else { texte (T_MBL + 47); retour_menu (N_MBL); deconnexion (voiecur, 1); } } break; case 3: if (snd_mess (voiecur, 1) == 0) ch_niv3 (2); break; case 4: if (att_prompt ()) { /* Le message a ete retarde */ if (mess_suiv (voiecur)) { entete_envoi_fwd (voiecur); ch_niv3 (1); } else { texte (T_MBL + 47); retour_menu (N_MBL); deconnexion (voiecur, 1); } } break; } } static int sysop_mess (void) { return ((*ptmes->bbsv == '\0') && ((strcmp (ptmes->desti, "SYSOP") == 0) || (strcmp (ptmes->desti, admin) == 0))); } static int rcv_fwd (void) { int test; int len; int res; char *ptr; char clog = (pvoie->mode & F_FOR) ? 'W' : 'S'; switch (pvoie->niv3) { case 0: if (FOR (pvoie->mode)) { if (lit_com_fwd () == 0) { libere (voiecur); texte (T_MBL + 44); retour_menu (N_MBL); return (0); } res = deja_recu (ptmes, 1, &test); mark_reverse_bid (ptmes, 1, &test); switch (res) { case 0: texte (T_MBL + 46); maj_niv (pvoie->niv1, pvoie->niv2, 3); break; case 4: if (pvoie->mbl_ext) { outln ("REJECT", 6); libere (voiecur); retour_menu (N_MBL); return (0); } case 2: if (pvoie->mbl_ext) { outln ("LATER", 5); libere (voiecur); retour_menu (N_MBL); return (0); } case 1: texte (T_MBL + 45); libere (voiecur); retour_menu (N_MBL); /* supprimer de la liste des propositions */ return (0); } } else { len = 0; ptr = indd; while (ISGRAPH (*ptr)) { ++len; ++ptr; } if (len > 1) return (1); if (lit_com_fwd () == 0) { retour_mbl (); return (0); } if (sysop_mess ()) { if (pvoie->read_only) strcpy (ptmes->desti, admin); } else if (read_only ()) { outln ("Message to SYSOP only !", 23); retour_mbl (); return (0); } if (deja_recu (ptmes, 1, &test) == 1) { texte (T_MBL + 21); retour_mbl (); return (0); } maj_niv (15, 0, 1); texte (T_MBL + 5); } break; case 1: if (!rcv_titre ()) { retour_mbl (); } else { maj_niv (15, 0, 2); texte (T_MBL + 6); if ((sed) && (EditorOff) && (voiecur == CONSOLE)) { aff_etat ('E'); #ifdef __linux__ if (daemon_mode) editor_request = 1; #endif reply = 3; send_buf (voiecur); pvoie->enrcur = 0L; #ifdef __WINDOWS__ maj_niv (N_MBL, 3, 0); if (win_edit () == 5) end_win_edit (); #endif #ifdef __linux__ if (!daemon_mode) { maj_niv (N_MBL, 3, 0); if (xfbb_edit () == 5) end_xfbb_edit (); } #endif #ifdef __FBBDOS__ maj_niv (N_MBL, 3, 0); if (mini_edit () == 5) end_mini_edit (); #endif } } break; case 2: get_mess_fwd (clog, indd, nb_trait, 0); break; case 3: if (!rcv_titre ()) { retour_mbl (); } else { maj_niv (pvoie->niv1, pvoie->niv2, 4); if (*indd) { get_mess_fwd (clog, indd, nb_trait, 0); } } break; case 4: get_mess_fwd (clog, indd, nb_trait, 0); break; default: fbb_error (ERR_NIVEAU, "RCV-FWD", pvoie->niv3); break; } return (0); } int fwd (void) { int error = 0; df ("fwd", 0); switch (pvoie->niv2) { case 0: error = rcv_fwd (); break; case 1: rcv_rev_fwd (); break; case 2: snd_fwd (); break; case 3: snd_rev_fwd (); break; case 5: new_fwd (); break; default: fbb_error (ERR_NIVEAU, "FWD", pvoie->niv2); break; } ff (); return (error); } fbb-7.0.10/src/xfwd.c0000644000175000017500000004020013613360505011152 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module XForwarding */ static void wrbuf (void); static int import_xfwd (char *nom_fich); static int chk_xfwd (XInfo * xinfo); static int merge_xfwd (XInfo * xinfo); #if defined(__WINDOWS__) || defined(__linux__) char *xfwd_str (int voie, char *s) { #define XMODLEN 44 static char stdesc[10][11] = { "RcvSXnb ", "SndBIDList", "WaitSS ", "RcvData ", " ", "SndSXnb ", "WaitSYnb ", "RcvBIDList", "SendData ", "WaitPrompt" }; char taille[40]; int niv = svoie[voie]->niv3; *s = '\0'; if ((niv >= 0) && (niv < 10)) { if (svoie[voie]->tailm) sprintf (taille, "/%ld", svoie[voie]->tailm); else *taille = '\0'; sprintf (s, "XFwd:%s %ld%s", stdesc[niv], svoie[voie]->enrcur, taille); } return (s); } #endif /* niv2 = 0 -> Appelle pour forwarder */ /* Niv2 = 1 -> Connexion du distant */ void xfwd (void) { int i; int res; int nb; char s[80]; char asc_file[128]; char tmp_file[128]; mess_noeud *lptr; /* Les BS ne sont pas autorises en binaire ... */ set_bs (voiecur, FALSE); switch (pvoie->niv3) { case 0: /* Recoit la commande SX */ if (pvoie->Xfwd == NULL) pvoie->Xfwd = (XInfo *) m_alloue (sizeof (XInfo)); memset (pvoie->Xfwd, 0, sizeof (XInfo)); sscanf (indd, "%s %d", s, &pvoie->Xfwd->nb_bid); if (stricmp (s, "SX") != 0) { if (toupper (*s) == 'S') { /* Forward standard */ maj_niv (N_FORW, 3, 0); fwd (); return; } else { pvoie->deconnect = 6; return; } } set_bs (voiecur, TRUE); pvoie->Xfwd->r_bid = 0; ch_niv3 (1); break; case 1: /* Lit la liste des BIDs */ n_cpy (12, pvoie->Xfwd->bid[pvoie->Xfwd->r_bid], sup_ln (indd)); /* Marque le flag d'acceptation pour le BID donne */ strcpy (ptmes->bid, pvoie->Xfwd->bid[pvoie->Xfwd->r_bid]); res = deja_recu (ptmes, 1, &i); if ((res == 1) || (res == 4)) pvoie->Xfwd->ok_bid[pvoie->Xfwd->r_bid] = 1; else pvoie->Xfwd->ok_bid[pvoie->Xfwd->r_bid] = 0; if (++pvoie->Xfwd->r_bid == pvoie->Xfwd->nb_bid) { /* Les Bid ont ete recus ... On envoie la reponse */ nb = 0; for (i = 0; i < pvoie->Xfwd->nb_bid; i++) if (!pvoie->Xfwd->ok_bid[i]) ++nb; sprintf (s, "SY %d", nb); outsln (s, strlen (s)); if (nb) { for (i = 0; i < pvoie->Xfwd->nb_bid; i++) if (!pvoie->Xfwd->ok_bid[i]) outsln (pvoie->Xfwd->bid[i], strlen (pvoie->Xfwd->bid[i])); pvoie->Xfwd->r_bid = 0; ch_niv3 (2); } else { if (pvoie->niv2 == 0) { texte (T_MBL + 42); ch_niv3 (0); } else retour_mbl (); } } break; case 2: /* Recoit le SS Size */ if ((*indd++ == 'S') && (*indd++ == 'S')) { incindd (); set_binary (voiecur, N_BIN); pvoie->tailm = 0L; pvoie->enrcur = 0L; pvoie->checksum = 0; pvoie->size_trans = 0L; pvoie->time_trans = time (NULL); pvoie->Xfwd->chck = 0; nb = sscanf (indd, "%ld %u", &pvoie->tailm, &pvoie->Xfwd->chck); pvoie->Xfwd->ok_chck = (std_header & 2048) ? 0 : (nb == 2); /* Supprime un eventuel fichier temporaire */ temp_name (voiecur, tmp_file); unlink (tmp_file); ch_niv3 (3); } break; case 3: /* Recoit le fichier des messages binaires */ wrbuf (); if (pvoie->enrcur == pvoie->tailm) { status (voiecur); if (std_header & 2048) pvoie->Xfwd->ok_chck = 0; if (pvoie->Xfwd->ok_chck && (pvoie->Xfwd->chck != pvoie->checksum)) { /* Checksum error... File is not accepted... Disconnect */ libere (voiecur); err_new_fwd (1, 1); temp_name (voiecur, tmp_file); unlink (tmp_file); return; } /* Le fichier est recu ... Decompression des messages */ write_mess_temp (O_BINARY, voiecur); set_binary (voiecur, 0); basic_lzhuf (DECODE, temp_name (voiecur, tmp_file), xfwd_name (voiecur, asc_file)); import_xfwd (asc_file); unlink (tmp_file); unlink (asc_file); pvoie->tailm = pvoie->enrcur = 0L; if (pvoie->niv2 == 0) { texte (T_MBL + 42); ch_niv3 (0); } else retour_mbl (); /* Import des messages */ } break; case 5: /* Envoie la commande SX */ if (pvoie->Xfwd == NULL) pvoie->Xfwd = (XInfo *) m_alloue (sizeof (XInfo)); memset (pvoie->Xfwd, 0, sizeof (XInfo)); if (pvoie->niv2 == 1) appel_rev_fwd (TRUE); /* Cree la liste des messages */ nb = chk_xfwd (pvoie->Xfwd); pvoie->Xfwd->r_bid = 0; if (nb) { sprintf (s, "SX %d", nb); outsln (s, strlen (s)); for (i = 0; i < nb; i++) { sprintf (s, "%s", pvoie->Xfwd->bid[i]); outsln (s, strlen (s)); } ch_niv3 (6); } else { if (pvoie->niv2 == 0) { /* Passe en reverse */ if (pvoie->rev_mode) { texte (T_MBL + 42); ch_niv3 (0); } else pvoie->deconnect = 6; } else { texte (T_MBL + 47); pvoie->deconnect = 6; } } break; case 6: /* Recoit le SY */ pvoie->Xfwd->ls_bid = 0; sscanf (indd, "%s %d", s, &pvoie->Xfwd->ls_bid); if (stricmp (s, "SY") != 0) pvoie->deconnect = 6; if (pvoie->Xfwd->ls_bid) ch_niv3 (7); else ch_niv3 (9); break; case 7: /* Recoit la liste des BIDs */ sup_ln (indd); for (i = 0; i < pvoie->Xfwd->nb_bid; i++) { if ((!pvoie->Xfwd->ok_bid[i]) && (strcmp (pvoie->Xfwd->bid[i], indd) == 0)) { pvoie->Xfwd->ok_bid[i] = 1; break; } } if (++pvoie->Xfwd->r_bid == pvoie->Xfwd->ls_bid) { long lg; /* Cree le Merge et envoie le fichier compresse */ merge_xfwd (pvoie->Xfwd); pvoie->checksum = 0; lg = basic_lzhuf (ENCODE, xfwd_name (voiecur, asc_file), temp_name (voiecur, pvoie->sr_fic)); unlink (asc_file); if (std_header & 2048) sprintf (s, "SS %ld", lg); else sprintf (s, "SS %ld %u", lg, pvoie->checksum); outsln (s, strlen (s)); /* Force l'envoi du paquet ... */ send_buf (voiecur); pvoie->tailm = pvoie->enrcur = 0L; pvoie->size_trans = 0L; pvoie->xferok = 1; pvoie->type_yapp = 4; pvoie->tailm = file_size (pvoie->sr_fic); set_binary (voiecur, 1); ch_niv3 (8); xfwd (); } break; case 8: /* Envoie le fichier compresse */ if (senddata (1) == 1) { aff_etat ('E'); send_buf (voiecur); unlink (pvoie->sr_fic); set_binary (voiecur, 0); ch_niv3 (9); } break; case 9: /* Si reception SID ... Attendre le prompt suivant... */ if (*indd == '[') { /* SID recu... Attend le prompt ! */ ch_niv3 (10); break; } /* Attend le prompt */ if (att_prompt ()) { pvoie->tailm = pvoie->enrcur = 0L; /* Marquer les fichiers forwardes */ if (pvoie->Xfwd) { for (nb = 0; nb < MAX_X; nb++) { /* Uniquement les messages envoyes */ if (pvoie->Xfwd->ok_bid == 0) continue; /* Recuperer les infos du message */ if ((lptr = findmess (pvoie->Xfwd->numero[nb])) == NULL) continue; ouvre_dir (); read_dir (lptr->noenr, ptmes); ferme_dir (); sprintf (s, "F %ld V:%s [%ld]", ptmes->numero, pvoie->sta.indicatif.call, ptmes->taille); fbb_log (voiecur, 'M', s); mark_fwd (voiecur, 0); } } ch_niv3 (5); xfwd (); } break; case 10: /* Si reception SID ... Attendre le prompt suivant... */ if (att_prompt ()) ch_niv3 (9); break; default: /* Erreur */ break; } } static void wrbuf (void) { int ncars; int nbcar = nb_trait; obuf *msgtemp; char *ptcur; char *ptr; pvoie->enrcur += (long) nbcar; pvoie->size_trans += (long) nbcar; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue (sizeof (obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; ptr = data; while (nbcar--) { ++pvoie->memoc; pvoie->checksum += *ptr; *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue (sizeof (obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } msgtemp->nb_car = ncars; if (pvoie->memoc > MAXMEM) { write_mess_temp (O_BINARY, voiecur); } } static void rd_champ (char *ligne, char *champ, int len) { /* Saute le mot-cle */ while ((*ligne) && (!isspace (*ligne))) ++ligne; /* Saute les espaces */ while ((*ligne) && (isspace (*ligne))) ++ligne; /* Copie la valeur */ while (len--) { if (*ligne) *champ++ = *ligne++; else break; } *champ = '\0'; } static int read_xfwd_header (FILE * fptr) { int champs = 0; char *ptr; char ligne[81]; ini_champs (voiecur); for (;;) { if (fgets (ligne, 80, fptr) == 0) return (-1); sup_ln (ligne); if ((*ligne == '\0') || (*ligne == ' ')) { /* Fin du bloc */ break; } else if (strnicmp ("FROM:", ligne, 5) == 0) { champs |= 1; if ((ptr = strchr (ligne, '@')) != NULL) { int i; *ptr++ = '\0'; for (i = 0; i < 6; i++) { if (!isalnum (*ptr)) break; ptmes->bbsf[i] = toupper (*ptr); ptr++; } ptmes->bbsf[i] = '\0'; } rd_champ (ligne, ptmes->exped, 6); } else if (strnicmp ("TO:", ligne, 3) == 0) { champs |= 2; if ((ptr = strchr (ligne, '@')) != NULL) { *ptr++ = '\0'; n_cpy (40, ptmes->bbsv, ptr); } rd_champ (ligne, ptmes->desti, 6); } else if (strnicmp ("SUBJECT:", ligne, 8) == 0) { /* champs |= 4; Sujet non obligatoire */ rd_champ (ligne, ptmes->titre, 50); } else if (strnicmp ("X-MSGTYPE:", ligne, 10) == 0) { /* champs |= 8; Type non obligatoire */ rd_champ (ligne, &ptmes->type, 1); } else if (strnicmp ("X-BID:", ligne, 6) == 0) { /* champs |= 0x10; BID non obligatoire... */ rd_champ (ligne, ptmes->bid, 12); } } if (ptmes->type == ' ') { if ((find (ptmes->desti)) || (is_serv (ptmes->desti))) { ptmes->type = 'P'; } else { ptmes->type = 'B'; } } ptmes->status = 'N'; if (*ptmes->bbsv) { if ((ptmes->type == 'P') && (!find (ptmes->desti)) && (!find (bbs_via (ptmes->bbsv)))) ptmes->type = 'B'; if ((*ptmes->bbsv) && (!find (bbs_via (ptmes->bbsv)))) ptmes->status = '$'; } swapp_bbs (ptmes); if ((*ptmes->bbsv == '\0') && (ptmes->type == 'P')) { pvoie->m_ack = 1; } if (!addr_check (ptmes->bbsv)) { return (-2); } reacheminement (); if ((*ptmes->bbsv == '\0') && (ptmes->type == 'A')) { ptmes->type = 'P'; } entete_saisie (); return (champs); } static int import_xfwd (char *nom_fich) { int retour; int test; int recu; int msg = 1; int res; FILE *fptr; char ligne[256]; char bbsf[10]; char bbsv[50]; retour = 1; aff_etat ('I'); if ((fptr = fopen (nom_fich, "rt")) != NULL) { while (1) { /* Lire header + taches swap, etc... */ res = read_xfwd_header (fptr); if (res == -1) { /* Fin de fichier */ break; } else if (res == 0) { /* Ligne vide avant les propositions */ continue; } *bbsf = '\0'; if (*ptmes->bbsv) sprintf (bbsv, "@%s", ptmes->bbsv); else *bbsv = '\0'; sprintf (ligne, "XFWD T:%c Fm:%s%s To:%s%s Id:%s\r", (ptmes->type) ? ptmes->type : '?', ptmes->exped, bbsf, ptmes->desti, bbsv, (*ptmes->bid) ? ptmes->bid : "None"); aff_bas (voiecur, W_RCVT, ligne, strlen (ligne)); if (res != 0x3) { sprintf (ligne, "Error header = %d\r", res); aff_bas (voiecur, W_SNDT, ligne, strlen (ligne)); /* Fin de fichier ou Erreur : Le message n'est pas importe... */ retour = 0; msg = 0; } else { /* Test reject */ recu = deja_recu (ptmes, 1, &test); if ((recu == 1) || (recu == 4)) { sprintf (ligne, "Message rejected\r"); aff_bas (voiecur, W_SNDT, ligne, strlen (ligne)); msg = 0; } } while (1) { if (fgets (ligne, 80, fptr) == 0) { /* Error ... Fichier non fini */ break; } lf_to_cr (ligne); if (get_mess_fwd ('X', ligne, strlen (ligne), (msg) ? 2 : 3)) { /* Message enregistre */ msg = 1; break; } } } if (fptr) ferme (fptr, 7); } return (retour); } static int wr_xfwd_mess (FILE * fptr, bullist * pbul) { char last_char; char *ptr; FILE *fptm; char header[256]; char bbsf[10]; char bbsv[50]; fprintf (fptr, "From: %s\n", pbul->exped); if (*pbul->bbsv) fprintf (fptr, "To: %s@%s\n", pbul->desti, pbul->bbsv); else fprintf (fptr, "To: %s\n", pbul->desti); fprintf (fptr, "Subject: %s\n", pbul->titre); fprintf (fptr, "X-msgtype: %c\n", pbul->type); fprintf (fptr, "X-BID: %s\n\n", pbul->bid); *bbsf = '\0'; if (*ptmes->bbsv) sprintf (bbsv, "@%s", pbul->bbsv); else *bbsv = '\0'; sprintf (header, "XFWD #:%ld T:%c Fm:%s%s To:%s%s Id:%s\r", pbul->numero, pbul->type, pbul->exped, bbsf, pbul->desti, bbsv, pbul->bid); aff_bas (voiecur, W_SNDT, header, strlen (header)); /* Header */ make_header (pbul, header); entete_mess_fwd (pbul, header); /* Msg_header contient le header complet avec des \r */ ptr = msg_header; while (*ptr) { if (*ptr == '\r') *ptr = '\n'; ++ptr; } fputs (msg_header, fptr); fflush (fptr); /* Ajouter le texte du message */ mess_name (MESSDIR, pbul->numero, pvoie->sr_fic); if ((fptm = ouvre_mess (O_TEXT, pbul->numero, '\0')) == NULL) return (0); fflush (fptr); fflush (fptm); copy_fic (fileno (fptm), fileno (fptr), &last_char); fclose (fptm); if (last_char != '\n') fputc ('\n', fptr); fputs ("/EX\n", fptr); return (1); } static int merge_xfwd (XInfo * xinfo) { int nb; char asc_file[128]; bullist lbul; FILE *fptr; mess_noeud *lptr; fptr = fopen (xfwd_name (voiecur, asc_file), "wt"); if (fptr == NULL) return (0); for (nb = 0; nb < xinfo->nb_bid; nb++) { if (!xinfo->ok_bid[nb]) continue; /* Recuperer les infos du message */ if ((lptr = findmess (xinfo->numero[nb])) == NULL) return (0); ouvre_dir (); read_dir (lptr->noenr, &lbul); ferme_dir (); if (!wr_xfwd_mess (fptr, &lbul)) { fclose (fptr); return (0); } } fclose (fptr); return (1); } int not_in_xfwd_mess (long numero, int voie) { int nb = 0; for (nb = 0; nb < svoie[voie]->Xfwd->nb_bid; nb++) { if (svoie[voie]->Xfwd->numero[nb] == numero) return (FALSE); } return (TRUE); } static int chk_xfwd (XInfo * xinfo) { int nb; int nb_dupes = 0; int chk_dupes; int no_more = 0; long max_tfwd = 1024L * (long) p_port[no_port (voiecur)].maxbloc; long tail_tmess = 0L; nb = 0; pvoie->Xfwd->nb_bid = 0; chk_dupes = ((pvoie->typfwd & FWD_DUPES) == 0); while (nb < MAX_X) { if (tail_tmess > max_tfwd) break; for (;;) { if (!mess_suiv (voiecur)) { if ((nb_dupes) && (chk_dupes)) { pvoie->nb_egal -= nb_dupes; nb_dupes = 0; chk_dupes = 0; continue; } else { no_more = 1; break; } } break; } if (no_more) break; if (std_header & 16) { if (*ptmes->bbsv == '\0') { strcpy (ptmes->bbsv, mypath); } } if (*(ptmes->bbsv) == '\0') { strcpy (ptmes->bbsv, pvoie->sta.indicatif.call); } if ((*(ptmes->exped)) && (*(ptmes->bbsv)) && (*(ptmes->desti)) && (*(ptmes->bid)) && (ISGRAPH (ptmes->type))) { xinfo->numero[nb] = ptmes->numero; n_cpy (12, xinfo->bid[nb], ptmes->bid); tail_tmess += ptmes->taille; ++pvoie->Xfwd->nb_bid; ++nb; } else mark_fwd (voiecur, 0); } pvoie->nb_egal -= nb_dupes; return (pvoie->Xfwd->nb_bid); } fbb-7.0.10/src/xfbbd.c0000644000175000017500000007666613615603431011320 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* For main module */ #define PUBLIC #include #ifdef __ORB__ #include #endif #include /* Added Satoshi Yasuda for NLS */ #include #include #include #include #include #define NB_INIT_B 11 static int verbose = 0; static int init_phase = 1; static int info_canal = -1; static void sig_fct (int sig) { pid_t pid; int pstatus; sig &= 0xff; if ((pid = wait (&pstatus)) != -1); signal (sig, sig_fct); switch (sig) { case SIGHUP: /* reload system files */ if (verbose) fprintf (stderr, "Update system files\n"); init_buf_fwd (); init_buf_swap (); init_buf_rej (); init_bbs (); break; case SIGTERM: /* end of session */ if (verbose) fprintf (stderr, "Closing connections\n"); maintenance (); fbb_quit (1); break; case SIGBUS: /* end of session */ fprintf (stderr, "xfbbd : Bus error\n"); exit (5); break; case SIGSEGV: /* end of session */ fprintf (stderr, "xfbbd : Segmentation violation\n"); exit (5); break; } /* Other signals are ignored */ } static void xfbbd_init (void) { while (step_initialisations (init_phase) == 0) { /* Next step */ ++init_phase; }; } static char *XVersion (int dat) { static char prodVersion[80]; char sdate[30]; if (dat) sprintf (sdate, " (%s)", date ()); else *sdate = '\0'; sprintf (prodVersion, "%s%s", version (), sdate); return (prodVersion); } void banner (void) { fprintf (stderr, "*********************************************************\n" "* XFBB Linux daemon version %s PID=%d\n" "* Copyright F6FBB 1986-1999. All rights reserved.\n" "* Maintainer since 2000 : Bernard, f6bvp@free.fr\n" "*\n" "* This software is in the public domain. It can be copied\n" "* or installed for any use abiding by the laws\n" "* under GNU General Public License\n" "*\n" "* F6FBB (Jean-Paul ROUBELAT) and F6BVP (Bernard PIDOUX)\n" "* decline any responsibilty in the use of XFBB software.\n" "*\n" "*********************************************************\n", XVersion (TRUE), getpid ()); } static int pactor_status[NBPORT]; void test_pactor(int force) { int port; int p_status; for (port = 1; port < NBPORT; port++) { if ((p_port[port].pvalid) && (p_port[port].stop == 0)) { if (!IS_PACTOR(port)) continue; p_status = 0; if (pactor_scan[port]) p_status |= PACTOR_SCAN; /* Connect monitoring */ if (ISS(port)) p_status |= PACTOR_ISS; if (ONLINE(port)) p_status |= PACTOR_ONLINE; if (force || (p_status != pactor_status[port])) { pactor_status[port] = p_status; #ifdef __ORB__ orb_pactor_status(port, p_status); #endif } } } } void process (void) { FbbMem (0); kernel (); test_pactor(0); } #ifdef __ORB__ extern int fbb_orb (char *service, int port); #endif int main (int ac, char **av) { int init_mode = 0; int orb = 1; int port = 3286; char *service = NULL; int i, ng; daemon_mode = 1; all_packets = 0; setlocale(LC_CTYPE, ""); /* Added Satoshi Yasuda for NLS */ for (i = 1; i < NSIG; i++) { if (i == SIGBUS || i == SIGSEGV || i == SIGCHLD || i == SIGALRM) continue; else if (i == SIGHUP || i == SIGTERM || i == SIGBUS || i == SIGSEGV) signal (i, sig_fct); /* Use sig_fct only for signals that do something */ else signal (i, SIG_IGN); /* Otherwise ignore */ } for (ng = 1; ng < ac; ng++) { if (strcmp (av[ng], "-h") == 0) { fprintf (stderr, "usage : xfbbd [-v] [-p port | -s service]\n"); return (0); } else if (strcmp (av[ng], "-V") == 0) { printf("%s\n", version()); return 0; } else if (strcmp (av[ng], "-v") == 0) { verbose = 1; fprintf (stderr, "Verbose mode is selected\n"); } else if (strcmp (av[ng], "-a") == 0) { all_packets = 1; } else if (strcmp (av[ng], "-i") == 0) { init_mode = 1; } else if (strcmp (av[ng], "-p") == 0) { if ((ng + 1) != ac) port = atoi (av[ng + 1]); } else if (strcmp (av[ng], "-s") == 0) { if ((ng + 1) != ac) service = av[ng + 1]; } else if (strcmp (av[ng], "-n") == 0) { orb = 0; } } banner (); /* Initialisations */ xfbbd_init (); if (init_mode) { return (2); } #ifdef __ORB__ if (orb) fbb_orb (service, port); else { #endif fprintf (stderr, "xfbbd ready and running ...\n"); /* mainloop */ for (;;) { process (); if (is_idle) { usleep (50000); } else { is_idle = 1; } } #ifdef __ORB__ } #endif return 1; } char *itoa (int val, char *buffer, int base) { sprintf (buffer, "%d", val); return buffer; } char *ltoa (long lval, char *buffer, int base) { sprintf (buffer, "%ld", lval); return buffer; } char *ultoa (unsigned long lval, char *buffer, int base) { sprintf (buffer, "%lu", lval); return buffer; } void InitText (char *text) { static char *initext[NB_INIT_B] = { #ifdef __linux__ "Reading fbb.conf", #else "Reading INIT.SRV", #endif "Reading Texts (%s)", "Ports configuration (%s)", "TNC configuration (%s)", "Servers & PG (%s)", "Loading BIDs (%s)", "Callsigns set-up (%s)", "Messages set-up (%s)", "WP set-up (%s)", "Forward set-up (%s)", "BBS set-up (%s)" }; if (!verbose) return; if (init_phase > NB_INIT_B) return; printf (initext[init_phase - 1], text); #ifdef __linux__ putchar ('\n'); #else putchar ('\r'); #endif fflush (stdout); } void InfoMessage (int temps, char *texte, char *titre) { static char def_titre[80]; if (!verbose) return; if (texte == NULL) return; if (titre == NULL) titre = def_titre; else strcpy (def_titre, titre); printf ("%s : %s\n", titre, texte); } #include void WinDebug (char *fmt,...) { va_list argptr; int cnt; if (!verbose) return; va_start (argptr, fmt); cnt = vprintf (fmt, argptr); va_end (argptr); } /* cmd : tableau des commandes a executer nb_cmd : nombre de commandes a executer mode : REPORT_MODE : attend un fichier log en retour NO_REPORT_MODE : pas de fichier log en retour log : nom du fichier de retour xdir : repertoire dans lequel doivent s'executer les commandes */ int call_nbdos (char **cmd, int nb_cmd, int mode, char *log, char *xdir, char *data) { /* Appel DOS */ int i; int retour = 0; FILE *fp; char *ptr; char file[256]; char buf[256]; char dir[256]; char arg[256]; if (mode) //sprintf (file, " %s 2>&1", back2slash (log)); sprintf (file, " %s", back2slash (log)); else sprintf (file, " > 8; if (verbose) { printf ("Debug: command = {%s}\n", buf); printf ("Debug: exit code = %d\n", retour); } /* fail-safe bypass if filter executable isn't found (exit code 127) */ if (retour == 127) retour = 0; } return (retour); } void CompressPosition (int mode, int val, long numero) { static long last_num = 0; if ((verbose) && (numero != last_num)) { last_num = numero; /* printf ("%s : msg %ld\n", (mode) ? "Compress" : "Decompress", numero);*/ } } int filter (char *ligne, char *buffer, int len, char *data, char *xdir) { char deroute[80]; int retour; sprintf (deroute, "%sEXECUTE.xxx", MBINDIR); retour = call_nbdos (&ligne, 1, REPORT_MODE, deroute, xdir, data); /* F6BVP was if (retour != -1) * as retour is forced to 0 in call_nbos lets change test * to not display deroute file name */ // if (retour == -1) if (retour != -1) { outfichs (deroute); } unlink (deroute); return (retour); } void sysop_call (char *texte) { } void window_write (int numero, char *data, int len, int color, int header) { #ifdef __ORB__ orb_write (numero, data, len, color, header); #endif } void WinMessage (int temps, char *text) { char str[256]; fd_set sock_read; struct timeval to; FD_ZERO (&sock_read); FD_SET (0, &sock_read); to.tv_sec = temps; to.tv_usec = 0; /* fprintf (stderr, "Message : %s\n", text);*/ if (select (1, &sock_read, NULL, NULL, &to) > 0) read (0, str, sizeof (str)); } void win_status (char *txt) { } #ifdef __ORB__ static int old_priv; static int old_hold; static int old_total; void reset_msgs (void) { old_priv = -1; old_hold = -1; old_total = -1; } #endif void win_msg_cons (int priv, int hold) { #ifdef __ORB__ unsigned num_indic; ind_noeud *noeud; if (priv == -1) { noeud = insnoeud (cons_call.call, &num_indic); priv = noeud->nbnew; } if (old_priv != priv || old_hold != nb_hold || old_total != nbmess) { old_priv = priv; old_hold = nb_hold; old_total = nbmess; orb_nb_msg (priv, nb_hold, nbmess); } #endif } int fbb_list (int update) { #ifdef __ORB__ static char lcnx[MAXVOIES][80]; static int premier = 0; static int prec_con = 0; int nb_con = 0; int i; char buffer[80]; if ((premier) || (update)) { memset (lcnx, 0, NBVOIES * 80); premier = 0; } for (i = 0; i < NBVOIES; i++) { int ch; if (svoie[i]->sta.connect) { int ok = 0; int nobbs; struct tm *sdate; unsigned t_cnx; Forward *pfwd; char bbs[10]; char call[20]; int choix = 0; int fwd = 0; char fwd_char; ++nb_con; /* Test du forward */ ok = 0; *bbs = '\0'; pfwd = p_port[no_port (i)].listfwd; while (pfwd) { if ((svoie[i]->curfwd) && (pfwd->forward == i)) { nobbs = svoie[i]->bbsfwd; choix = (int) svoie[i]->cur_choix; strn_cpy (6, bbs, bbs_ptr + (nobbs - 1) * 7); ok = 1; fwd = 1; } pfwd = pfwd->suite; } if ((!ok) && (svoie[i]->mode & F_FOR) && (i != CONSOLE)) { fwd = 2; strcpy (bbs, svoie[i]->sta.indicatif.call); } strlwr (bbs); /* Affichage */ sdate = localtime (&(svoie[i]->debut)); t_cnx = (unsigned) (time (NULL) - svoie[i]->debut); if (i == 1) ch = 99; else ch = (i > 0) ? i - 1 : i; if (svoie[i]->sta.indicatif.num) sprintf (call, "%s-%d", svoie[i]->sta.indicatif.call, svoie[i]->sta.indicatif.num); else sprintf (call, "%s", svoie[i]->sta.indicatif.call); if (fwd == 1) fwd_char = '<'; else if (fwd == 2) fwd_char = '>'; else fwd_char = ' '; sprintf (buffer, "%c%02d %-9s %02d:%02d %02d:%02d %2d %3d %c%c%s", fwd_char, ch, call, sdate->tm_hour, sdate->tm_min, t_cnx / 3600, (t_cnx / 60) % 60, svoie[i]->sta.ret, svoie[i]->sta.ack, (choix < 2) ? ' ' : '0' + choix, (choix < 2) ? ' ' : '/', bbs ); } else { if (i == 1) ch = 99; else ch = (i > 0) ? i - 1 : i; sprintf (buffer, " %02d", ch); } if (strcmp (buffer, lcnx[i]) != 0) { orb_con_list (i, buffer); strcpy (lcnx[i], buffer); } } if (nb_con != prec_con) { prec_con = nb_con; orb_con_nb (nb_con); } return (nb_con); #else return (0); #endif } void FbbStatus (char *callsign, char *texte) { } void set_info_channel(int channel) { if (channel == -1) { user_status(-1); } else { info_canal = (channel > 0) ? channel+1 : channel; user_status(-1); user_status(info_canal); } } void user_status(int ch) { #ifdef __ORB__ int i; char str[256]; char call[80]; indicat *ind; static struct { char str[256]; char prenom[13]; char home[41]; stat_ch sta; int niv1, niv2, niv3, canal, nbmess, nbnew, paclen, memoc; unsigned flags; } prev; if (ch == -1) { memset(&prev, 0, sizeof(prev)); prev.niv1 = prev.niv2 = prev.niv3 = -1; prev.canal = prev.nbmess = prev.nbnew = -1; prev.paclen = prev.memoc = -1; prev.sta.ret = prev.sta.ack = -1; *prev.str = 0xff; *prev.prenom = 0xff; *prev.home = 0xff; return; } if (ch != info_canal) return; ind = &svoie[info_canal]->sta.indicatif; if (memcmp(ind, &prev.sta.indicatif, sizeof(indicat)) != 0) { prev.sta.indicatif = *ind; if (ind->num) sprintf(call, "%s-%d", ind->call, ind->num); else sprintf(call, "%s", ind->call); orb_info(ICall, call); *str = '\0'; for (i = 0; i < 2; i++) { ind = &svoie[info_canal]->sta.relais[i]; if (*(ind->call)) { if (ind->num) sprintf(call, "%s-%d", ind->call, ind->num); else sprintf(call, "%s", ind->call); if (i > 0) strcat(str, ","); strcat(str, call); } } ind = &svoie[info_canal]->sta.relais[i]; if (*(ind->call)) strcat(str, ",..."); orb_info(IDigis, str); } if (strcmp(prev.prenom, svoie[info_canal]->finf.prenom) != 0) { strcpy(prev.prenom, svoie[info_canal]->finf.prenom); orb_info(IName, svoie[info_canal]->finf.prenom); } if (strcmp(prev.home, svoie[info_canal]->finf.home) != 0) { strcpy(prev.home, svoie[info_canal]->finf.home); orb_info(IHome, svoie[info_canal]->finf.home); } if (info_canal != prev.canal) { prev.canal = info_canal; orb_info(IChan, itoa((info_canal > 0) ? info_canal - 1 : info_canal, str, 10)); orb_info(IPort, itoa(no_port(info_canal), str, 10)); } if ((svoie[info_canal]->niv1 != prev.niv1) || (svoie[info_canal]->niv2 != prev.niv2) || (svoie[info_canal]->niv3 != prev.niv3)) { prev.niv1 = svoie[info_canal]->niv1; prev.niv2 = svoie[info_canal]->niv2; prev.niv3 = svoie[info_canal]->niv3; sprintf(str, "%02d %02d %02d", svoie[info_canal]->niv1, svoie[info_canal]->niv2, svoie[info_canal]->niv3); orb_info(IN1N2N3, str); } if (svoie[info_canal]->finf.flags != prev.flags) { prev.flags = svoie[info_canal]->finf.flags; orb_info(IFlags, strflags(&svoie[info_canal]->finf)); } if (svoie[info_canal]->paclen != prev.paclen) { prev.paclen = svoie[info_canal]->paclen; orb_info(IPaclen, itoa(svoie[info_canal]->paclen, str, 10)); } if (svoie[info_canal]->sta.stat != prev.sta.stat) { prev.sta.stat = svoie[info_canal]->sta.stat; orb_info(IStatus, stat_voie(info_canal)); } if (svoie[info_canal]->memoc != prev.memoc) { prev.memoc = svoie[info_canal]->memoc; orb_info(IMem, itoa(svoie[info_canal]->memoc, str, 10)); } if (svoie[info_canal]->sta.ack != prev.sta.ack) { prev.sta.ack = svoie[info_canal]->sta.ack; orb_info(IBuf, itoa(svoie[info_canal]->sta.ack, str, 10)); } if (svoie[info_canal]->sta.ret != prev.sta.ret) { prev.sta.ret = svoie[info_canal]->sta.ret; orb_info(IRet, itoa(svoie[info_canal]->sta.ret, str, 10)); } if (svoie[info_canal]->ncur) { if (svoie[info_canal]->ncur->nbmess != prev.nbmess) { prev.nbmess = svoie[info_canal]->ncur->nbmess; orb_info(IPerso, itoa(svoie[info_canal]->ncur->nbmess, str, 10)); } if (svoie[info_canal]->ncur->nbnew != prev.nbnew) { prev.nbnew = svoie[info_canal]->ncur->nbnew; orb_info(IUnread, itoa(svoie[info_canal]->ncur->nbnew, str, 10)); } } else { orb_info(IPerso, "0"); orb_info(IUnread, "0"); } if (svoie[info_canal]->niv1 == N_YAPP) yapp_str(info_canal, str); else if (svoie[info_canal]->niv1 == N_BIN) abin_str(info_canal, str); else if (svoie[info_canal]->niv1 == N_XFWD) xfwd_str(info_canal, str); else if (svoie[info_canal]->niv1 == N_FORW) ffwd_str(info_canal, str); else *str = '\0'; if (strcmp(str, prev.str) != 0) { strcpy(prev.str, str); orb_info(IYapp, str); } orb_info(0, NULL); #endif } void maj_menu_options (void) { #ifdef __ORB__ orb_options(); #endif } void CloseFbbWindow (int numero) { #ifdef __ORB__ if (numero == CONSOLE) { if (v_tell) { selvoie (v_tell); pvoie->seq = v_tell = 0; retour_mbl (); /*maj_niv (pvoie->sniv1, pvoie->sniv2, pvoie->sniv3); prompt (pvoie->finf.flags, pvoie->niv1); */ selvoie (CONSOLE); maj_niv (0, 0, 0); pvoie->sta.connect = FALSE; } orb_disc (); } #endif } int xfbb_edit (void) { return 1; } int end_xfbb_edit (void) { return 1; } int call_dll (char *cmd, int mode, char *buffer, int len, char *data) { return 1; } static FILE *p_fptr = NULL; static int p_pos = 0; void RequestPendingForward(char *datafile) { p_pos = 0; p_fptr = fopen(datafile, "w"); if (p_fptr) { fwd_encours(); fclose(p_fptr); } } void AddPendingLine (char *call, int priv, int bull, int kb) { if (p_fptr == NULL) return; if (*call) fprintf(p_fptr, "%02d %s %d %d %d\n", p_pos++, call, priv, bull, kb); else fprintf(p_fptr, "%02d\n", p_pos++); } char *StartForward(int numbbs) { static char str[80]; char ifwd[NBBBS][7]; char bbs[8]; int retour; int port_fwd; ch_bbs (1, ifwd); if (numbbs < 0 || numbbs >= NBBBS || *ifwd[numbbs] == '\0') { sprintf(str, "Unknown BBS nb %d", numbbs); return str; } strn_cpy(6, bbs, ifwd[numbbs]); retour = val_fwd(bbs, &port_fwd, 1); if (retour < 0) { switch (retour) { case -1 : sprintf(str, "No forwarding channel on port %d", port_fwd); break; case -2: sprintf(str, "No port affected to %s", bbs); break; case -3 : sprintf(str, "Unknown BBS %s", bbs); break; case -4 : sprintf(str, "BBS %s already connected", bbs); break; default : sprintf(str, "Unknown error code %d", retour); break; } } else { sprintf(str, "Starting forward to %s on port %d", bbs, port_fwd); } return str; } char *StopForward(int numbbs) { static char str[80]; char ifwd[NBBBS][7]; char bbs[8]; int port_fwd; ch_bbs (1, ifwd); if (numbbs < 0 || numbbs >= NBBBS || *ifwd[numbbs] == '\0') { sprintf(str, "Unknown BBS nb %d", numbbs); return str; } strn_cpy(6, bbs, ifwd[numbbs]); port_fwd = dec_fwd(bbs); if (port_fwd < 0) { switch (port_fwd) { case -1 : sprintf(str, "BBS %s is not forwarding", bbs); break; case -2 : sprintf(str, "Unknown BBS %s", bbs); break; default : sprintf(str, "Unknown error code %d", port_fwd); break; } } else { sprintf(str, "Stopping forward with %s on port %d", bbs, port_fwd); } return str; } void window_connect (int numero) { } void ShowError (char *titre, char *info, int lig) { printf ("%s : %s %d\n", titre, info, lig); } void fbb_quit (unsigned retour) { sortie_prg (); exit (retour); } void WinMSleep (unsigned milliseconds) { usleep (milliseconds * 1000); } void WinSleep (unsigned seconds) { sleep (seconds); } int sel_option (char *texte, int *val) { char str[256]; for (;;) { fprintf (stderr, "%s (Y/N) ? ", texte); fflush (stdout); read (0, str, sizeof (str)); if ((*str == 'Y') || (*str == 'y')) { *val = 'y'; break; } if ((*str == 'N') || (*str == 'n')) break; } return (*val == 'y'); } void aff_traite (int voie, int val) { } void bipper (void) { if (!bip) return; } void music (int stat) { int i, j; int pid; static int pid_fils = 0; if (stat) { t_tell = 1000; pid = fork (); if (pid == 0) { /* fils */ for (j = 0; j < 5; j++) { if (!play ("syscall.wav")) { int fd; char c = '\a'; fd = open ("/dev/console", O_WRONLY); if (fd > 0) { for (i = 0; i < 10; i++) { write (fd, &c, 1); usleep (200000); } close (fd); } } sleep (10); } exit (0); } else pid_fils = pid; } else { if (pid_fils) kill (pid_fils, SIGKILL); pid_fils = 0; t_tell = -1; } } void SpoolLine (int voie, int attr, char *data, int lg) { } void window_init (void) { } void set_win_colors (void) { } void window_disconnect (int numero) { } void disconnect_channel (int channel, int immediate) { int ch = (channel > 0) ? channel+1 : channel; if ((svoie[ch]->sta.connect) && (ch) && (ch < NBVOIES)) { if (immediate) force_deconnexion (ch, 1); else deconnexion (ch, 1); } } void sysop_end (void) { } void FbbMem (int update) { static long old_avail = 0; static time_t old_time = 0; static int old_getd = 0; static long old_nbmess = -1L; static long old_temp = -1L; static long old_gMem = -1L; static long old_us = 0xffffffffL; int chg = 0; char texte[80]; int gMem = nb_ems_pages (); long us = mem_alloue; time_t new_time = time (NULL); if (update) { old_avail = 0; old_time = 0; old_getd = 0; old_nbmess = -1L; old_temp = -1L; old_gMem = -1; old_us = 0xffffffffL; } if (operationnel == -1) return; /* Mise a jour toutes les secondes */ if (old_time == new_time) return; old_time = new_time; if (us < 0L) us = 0L; if (us != old_us) { old_us = us; chg = 1; } if (gMem != old_gMem) { old_gMem = gMem; chg = 1; } /* Test disque toutes les 10 secondes */ if (old_getd == 0) { struct statfs dfree; if (statfs (DATADIR, &dfree) == 0) { sys_disk = dfree.f_bavail * (dfree.f_bsize / 1024L); if (sys_disk != old_avail) { old_avail = sys_disk; chg = 1; } } if (statfs (MBINDIR, &dfree) == 0) { tmp_disk = dfree.f_bavail * (dfree.f_bsize / 1024L); if (tmp_disk != old_avail && tmp_disk != old_temp) { old_temp = tmp_disk; chg = 1; } } else { tmp_disk = sys_disk; } old_getd = 10; } else --old_getd; #ifdef __ORB__ if (chg) { orb_status (old_us, old_gMem, old_avail, old_temp); } #endif if (nbmess != old_nbmess) { sprintf (texte, ": %ld", nbmess); old_nbmess = nbmess; } } void DisplayResync (int port, int nb) { static int tot_resync = 0; if (nb) { if (nb == 1) { printf ("Resynchro port %d (total = %d)\n", port, ++tot_resync); } } else { printf ("Port %d OK\n", port); } } int connect_tell (void) { char s[256]; if ((!svoie[CONSOLE]->sta.connect) && (svoie[v_tell]->sta.connect)) { console_on (); #ifdef ENGLISH sprintf (s, "*** Talking with %s (%s) ", svoie[v_tell]->sta.indicatif.call, svoie[v_tell]->finf.prenom); #else sprintf (s, "*** Convers. avec %s (%s)", svoie[v_tell]->sta.indicatif.call, svoie[v_tell]->finf.prenom); #endif selvoie (CONSOLE); pvoie->sta.connect = 16; pvoie->deconnect = FALSE; pvoie->ret = 0; pvoie->sid = 0; pvoie->pack = 0; pvoie->read_only = 0; pvoie->vdisk = 2; pvoie->xferok = 1; pvoie->msg_held = 0; pvoie->mess_recu = 1; pvoie->mbl = 0; init_timout (CONSOLE); pvoie->temp3 = 0; pvoie->nb_err = 0; pvoie->finf.lang = langue[0]->numlang; init_langue (voiecur); maj_niv (N_MBL, 9, 2); outln (s, strlen (s)); selvoie (v_tell); init_langue (voiecur); maj_niv (N_MBL, 9, 2); texte (T_MBL + 15); return 1; } return 0; } void RequestMsgsList(char *datafile) { p_pos = 0; p_fptr = fopen(datafile, "w"); if (p_fptr) { FbbRequestMessageList(); fclose(p_fptr); } } void AddMessageList (char *number) { if (p_fptr == NULL) return; fprintf(p_fptr, "%s\n", number); } char *GetMsgInfo(char *number, int *nLen) { static char buf[1024]; int nNum = 1; int nPos = 0; bullist rec; int i; if (GetMsgInfos (&rec, atol(number))) { nPos += sprintf(buf+nPos, "%d %c\n", nNum++, rec.type); nPos += sprintf(buf+nPos, "%d %c\n", nNum++, rec.status); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.numero); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.taille); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.date); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.bbsf); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.bbsv); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.exped); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.desti); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.bid); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.titre); nPos += sprintf(buf+nPos, "%d %d\n", nNum++, rec.bin); nPos += sprintf(buf+nPos, "%d %u\n", nNum++, rec.nblu); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.theme); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.datesd); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.datech); nPos += sprintf(buf+nPos, "%d", nNum++); for (i = 0 ; i < NBMASK ; i++) nPos += sprintf(buf+nPos, " %02x", rec.fbbs[i] & 0xff); nPos += sprintf(buf+nPos, "\n"); nPos += sprintf(buf+nPos, "%d", nNum++); for (i = 0 ; i < NBMASK ; i++) nPos += sprintf(buf+nPos, " %02x", rec.forw[i] & 0xff); nPos += sprintf(buf+nPos, "\n"); } *nLen = nPos; return buf; } int PutMsgInfo(char *number, char *buf, int nLen) { char *ptr; int nNum; bullist rec; int i; int fwd[NBMASK]; long NumMess = atol(number); if (!GetMsgInfos (&rec, NumMess)) return 0; ptr = strtok(buf, "\n"); while (ptr) { nNum = atoi(ptr); while (isdigit(*ptr)) ++ptr; while (isspace(*ptr)) ++ptr; switch (nNum) { case 1: rec.type = *ptr; break; case 2: rec.status = *ptr; break; case 3: rec.numero = atol(ptr); break; case 4: rec.taille = atol(ptr); break; case 5: rec.date = atol(ptr); break; case 6: strn_cpy(40, rec.bbsf, ptr); break; case 7: strn_cpy(40, rec.bbsv, ptr); break; case 8: strn_cpy(6, rec.exped, ptr); break; case 9: strn_cpy(6, rec.desti, ptr); break; case 10: strn_cpy(12, rec.bid, ptr); break; case 11: n_cpy(60, rec.titre, ptr); break; case 12: rec.bin = (*ptr == '0') ? '\0' : '\1'; break; case 13: rec.nblu = atoi(ptr); break; case 14: rec.theme = atol(ptr); break; case 15: rec.datesd = atol(ptr); break; case 16: rec.datech = atol(ptr); break; case 17: sscanf(ptr, "%x %x %x %x %x %x %x %x", &fwd[0], &fwd[1], &fwd[2], &fwd[3], &fwd[4], &fwd[5], &fwd[6], &fwd[7]); for (i = 0 ; i < NBMASK ; i++) rec.fbbs[i] = (char) fwd[i]; break; case 18: sscanf(ptr, "%x %x %x %x %x %x %x %x", &fwd[0], &fwd[1], &fwd[2], &fwd[3], &fwd[4], &fwd[5], &fwd[6], &fwd[7]); for (i = 0 ; i < NBMASK ; i++) rec.forw[i] = (char) fwd[i]; break; } ptr = strtok(NULL, "\n"); } SetMsgInfo(&rec, NumMess); return 1; } void RequestUsersList(char *datafile) { p_pos = 0; p_fptr = fopen(datafile, "w"); if (p_fptr) { FbbRequestUserList(); fclose(p_fptr); } } void AddUserList (char *callsign) { if (p_fptr == NULL) return; fprintf(p_fptr, "%s\n", callsign); } void AddUserLang (char *lang) { if (p_fptr == NULL) return; fprintf(p_fptr, "%d %s\n", p_pos++, lang); } char *GetUserInfo(char *call, int *nLen) { static char buf[1024]; int nNum = 1; int nPos = 0; info rec; int i; if (GetUserInfos (call, &rec)) { nPos += sprintf(buf+nPos, "%d %s-%d\n", nNum++, rec.indic.call, rec.indic.num); for (i = 0 ; i < 8 ; i++) nPos += sprintf(buf+nPos, "%d %s-%d\n", nNum++, rec.relai[i].call, rec.relai[i].num); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.lastmes); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.nbcon); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.hcon); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.lastyap); nPos += sprintf(buf+nPos, "%d %u\n", nNum++, rec.flags); nPos += sprintf(buf+nPos, "%d %u\n", nNum++, rec.on_base); nPos += sprintf(buf+nPos, "%d %u\n", nNum++, rec.nbl); nPos += sprintf(buf+nPos, "%d %u\n", nNum++, rec.lang); nPos += sprintf(buf+nPos, "%d %ld\n", nNum++, rec.newbanner); nPos += sprintf(buf+nPos, "%d %u\n", nNum++, rec.download); nPos += sprintf(buf+nPos, "%d %d\n", nNum++, rec.theme); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.nom); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.prenom); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.adres); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.ville); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.teld); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.telp); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.home); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.qra); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.priv); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.filtre); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.pass); nPos += sprintf(buf+nPos, "%d %s\n", nNum++, rec.zip); } *nLen = nPos; return buf; } int PutUserInfo(char *call, char *buf, int nLen) { int nNum; info rec; char *ptr; if (!GetUserInfos (call, &rec)) return 0; ptr = strtok(buf, "\n"); while (ptr) { nNum = atoi(ptr); while (isdigit(*ptr)) ++ptr; while (isspace(*ptr)) ++ptr; switch (nNum) { case 11: rec.lastmes = atol(ptr); break; case 12: rec.hcon = atol(ptr); break; case 13: rec.lastyap = atol(ptr); break; case 14: rec.flags = atoi(ptr); break; case 15: rec.on_base = atoi(ptr); break; case 16: rec.nbl = atoi(ptr); break; case 17: rec.lang = atoi(ptr); break; case 18: rec.newbanner = atol(ptr); break; case 19: rec.download = atoi(ptr); break; case 20: rec.theme = atoi(ptr); break; case 21: n_cpy(17, rec.nom, ptr); break; case 22: n_cpy(12, rec.prenom, ptr); break; case 23: n_cpy(60, rec.adres, ptr); break; case 24: n_cpy(30, rec.ville, ptr); break; case 25: n_cpy(12, rec.teld, ptr); break; case 26: n_cpy(12, rec.telp, ptr); break; case 27: n_cpy(40, rec.home, ptr); break; case 28: strn_cpy(6, rec.qra, ptr); break; case 29: n_cpy(12, rec.priv, ptr); break; case 30: n_cpy(6, rec.filtre, ptr); break; case 31: strn_cpy(12, rec.pass, ptr); break; case 32: n_cpy(8, rec.zip, ptr); break; } ptr = strtok(NULL, "\n"); } SetUserInfos(call, &rec); return 1; } int DelUserInfo(char *call) { info rec; FILE *fptr; ind_noeud *noeud; noeud = cher_noeud(call); if (noeud == NULL) return 0; fptr = ouvre_nomenc() ; fseek(fptr, (long)noeud->coord * ((long) sizeof(info)), 0) ; fread((char *) &rec, (int) sizeof(info), 1, fptr) ; *(rec.indic.call) = '\0'; fseek(fptr, (long)noeud->coord * ((long) sizeof(info)), 0) ; fwrite((char *) &rec, (int) sizeof(info), 1, fptr) ; ferme(fptr, 40) ; noeud->coord = 0xffff; return 1; } int NewUserInfo(char *call) { info rec; indicat callsign; unsigned num_indic; FILE *fptr; ind_noeud *noeud; n_cpy(6, callsign.call, call); callsign.num = 0; noeud = insnoeud(callsign.call, &num_indic); if (noeud->coord != 0xffff) return 0; init_info(&rec, &callsign); noeud->coord = rinfo++; noeud->val = 1; fptr = ouvre_nomenc() ; fseek(fptr, (long)noeud->coord * ((long) sizeof(info)), 0) ; fwrite((char *) &rec, (int) sizeof(info), 1, fptr) ; ferme(fptr, 40) ; return 1; } void CmdCHO(int port, int val) { if (IS_PACTOR(port) && (ONLINE(port))) { // Tue l'eventuel timer en cours del_timer(p_port[port].t_iss); p_port[port].t_iss = NULL; if (val) { tor_stop(p_port[port].pr_voie); } else { tor_start(p_port[port].pr_voie); } } } void CmdScan(int port, int val) { char cmde[80]; /* Start/Stop scanning */ wsprintf(cmde, "PTCTRX SCAN %d", val); ptctrx(0, cmde); } fbb-7.0.10/src/wp.c0000644000175000017500000006470413613360505010647 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include extern void *tete_wp; static char *l2call (lcall); int init_white_pages (void) { #if defined(__WINDOWS__) || defined(__linux__) char buf[80]; #endif #ifdef __FBBDOS__ fen *fen_ptr; #endif FILE *fptr; Wps rec; Wp wp; unsigned record = 0; if (!EMS_WPG_OK ()) return (0); init_wp_cache (); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (1); #ifdef __linux__ #ifdef ENGLISH cprintf ("White Pages Set-up \n"); #else cprintf ("Initialisation Pages Blanches\n"); #endif #else #ifdef ENGLISH cprintf ("White Pages Set-up \r\n"); #else cprintf ("Initialisation Pages Blanches\r\n"); #endif #endif deb_io (); #ifdef __FBBDOS__ #ifdef ENGLISH fen_ptr = open_win (10, 5, 50, 8, INIT, " White Pages "); #else fen_ptr = open_win (10, 5, 50, 8, INIT, "Pages Blanches"); #endif #endif /* __FBBDOS__ */ while (fread (&rec, sizeof (Wps), 1, fptr)) { if ((record % 100) == 0) { #if defined(__WINDOWS__) || defined(__linux__) InitText (ltoa ((long) record, buf, 10)); #endif #ifdef __FBBDOS__ cprintf ("\rrecord %u", record); #endif } wp.callsign = call2l (rec.callsign); wp.home = call2l (bbs_via (rec.first_homebbs)); write_wp (record, &wp); ++record; } fclose (fptr); #if defined(__WINDOWS__) || defined(__linux__) InitText (ltoa ((long) record, buf, 10)); #endif #ifdef __FBBDOS__ cprintf ("\rrecord %u", record); attend_caractere (2); close_win (fen_ptr); #endif fin_io (); #ifdef __linux__ #ifdef ENGLISH cprintf ("%u records updated\n", record); #else cprintf ("%u enregistrements mis a jour\n", record); #endif #else #ifdef ENGLISH cprintf ("%u records updated\r\n", record); #else cprintf ("%u enregistrements mis a jour\r\n", record); #endif #endif return (1); } static void mess_wp (char *chaine) { Wpr rec; char *ptr; char source = '\0'; char date[80]; char call[80]; char route[80]; char zip[80]; char name[80]; char qth[80]; static char *qmark = "?"; ini_rec (&rec); *date = '\0'; *call = '\0'; strcpy (route, qmark); strcpy (zip, qmark); strcpy (name, qmark); strcpy (qth, qmark); sscanf (chaine, "%*s %s %s %*s %s %*s %s %s %[^\n]", date, call, route, zip, name, qth); if ((*date == '\0') || (*call == '\0')) { char debwp[300]; sprintf (debwp, "invalid update :\n %s\n", chaine); debug_wp (debwp); return; } ptr = strrchr (call, '/'); if (ptr) { *ptr++ = '\0'; if (isalpha (*ptr)) source = toupper (*ptr); } rec.local = 1; /* Pas de ligne si update par message */ rec.source = source; rec.last = date_to_time (date); strn_cpy (6, rec.callsign, call); strn_cpy (40, rec.homebbs, route); if (*zip != '?') strn_cpy (8, rec.zip, zip); if (*name != '?') n_cpy (12, rec.name, name); if (*qth != '?') n_cpy (30, rec.qth, qth); if ((*route != '?') && (addr_check (route))) wp_upd (&rec, 0); else { char debwp[300]; debug_wp (chaine); sprintf (debwp, "Address <%s> is not valid, WP not updated\n\n", route); debug_wp (debwp); } } void wp_read_mess (bullist * pbul) { char chaine[256]; FILE *fptr; ind_noeud *noeud; mess_noeud *mptr; char bbs[10]; if (!EMS_WPG_OK ()) return; deb_io (); aff_etat ('X'); strcpy (bbs, bbs_via (pbul->bbsv)); if ((fptr = ouvre_mess (O_TEXT, pbul->numero, '\0')) != NULL) { while (fgets (chaine, 255, fptr)) { if (strncmp (chaine, "On", 2) == 0) mess_wp (chaine); trait_time = 0; } fclose (fptr); } fin_io (); if ((*pbul->bbsv == '\0') && ((mptr = findmess (pbul->numero)) != NULL)) { /* Tue le message */ ouvre_dir (); pbul->status = 'K'; write_dir (mptr->noenr, pbul); ferme_dir (); noeud = cher_noeud (pbul->desti); --(noeud->nbnew); --(noeud->nbmess); chg_mess (0xffff, pbul->numero); } aff_etat ('A'); } static int wp_stats (void) { char s[256]; long record; long bbs; long users; int retour = 1; double ratio; Wp wp; bbs = users = 0L; for (record = 0L;; ++record) { if (!read_wp ((unsigned) record, &wp)) break; if (wp.callsign == wp.home) ++bbs; else ++users; } sprintf (s, "%6ld records in WP", record); outln (s, strlen (s)); ratio = (double) users *100.0 / (double) record; sprintf (s, "%6ld Users (%2d%%)", users, (int) (ratio + .5)); outln (s, strlen (s)); ratio = (double) bbs *100.0 / (double) record; sprintf (s, "%6ld BBS (%2d%%)", bbs, (int) (ratio + .5)); outln (s, strlen (s)); return (retour); } static int str_alnum (char *mask) { while (*mask) { if (!isalnum (*mask)) return (0); ++mask; } return (1); } static int display_wp_line (Wps * rec) { char s[256]; if (*rec->first_homebbs) { sprintf (s, "%-6s @%s %s %s %s", rec->callsign, rec->first_homebbs, (*rec->name) ? rec->name : "?", (*rec->first_zip) ? rec->first_zip : "?", (*rec->first_qth) ? rec->first_qth : "?" ); outln (s, strlen (s)); return (1); } return (0); } static int wp_search_call (void) { char mask[42]; FILE *fptr; unsigned record; int retour = 1; int no_mask; lcall callsign = 0; Wps rec; Wp wp; if (!*pvoie->ch_temp) return (retour); pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); if ((no_mask = str_alnum (mask)) != 0) callsign = call2l (mask); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (retour); if (no_mask) { record = search_wp_record (callsign, USR_CALL, 0); if (record < 0xffff) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (display_wp_line (&rec)) pvoie->temp1 = 1; } } else { while (read_wp (record, &wp)) { if ((wp.callsign) && (strmatch (l2call (wp.callsign), mask))) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (display_wp_line (&rec)) pvoie->temp1 = 1; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } ++record; } } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) texte (T_ERR + 19); return (retour); } Wps *wp_find (char *callsign, int update) { FILE *fptr; unsigned record = 0; static Wps rec; if (!EMS_WPG_OK ()) return (NULL); record = search_wp_record (call2l (callsign), USR_CALL, 0); if (record == 0xffff) return (NULL); deb_io (); fptr = fopen (d_disque ("WP\\WP.SYS"), "r+b"); if (fptr == NULL) { fin_io (); return (NULL); } fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); if (update) { rec.last_seen = time (NULL); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fwrite (&rec, sizeof (Wps), 1, fptr); } fclose (fptr); fin_io (); return (&rec); } static void display_wp_user (long record, Wps * rec) { char s[256]; char modif[80]; char seen[80]; strcpy (modif, date_mbl (rec->last_modif)); strcpy (seen, date_mbl (rec->last_seen)); sprintf (s, "%-4ld: %s %s %-6s (%u) %s", record, modif, seen, rec->callsign, rec->seen, (*rec->name) ? rec->name : "?" ); outln (s, strlen (s)); sprintf (s, " [1] @%s Zip:%s Qth:%s", rec->first_homebbs, (*rec->first_zip) ? rec->first_zip : "?", (*rec->first_qth) ? rec->first_qth : "?" ); outln (s, strlen (s)); sprintf (s, " [2] @%s Zip:%s Qth:%s", rec->secnd_homebbs, (*rec->secnd_zip) ? rec->secnd_zip : "?", (*rec->secnd_qth) ? rec->secnd_qth : "?" ); outln (s, strlen (s)); } static int wp_list_user (void) { char mask[42]; FILE *fptr; unsigned record; int retour = 1; lcall lc; Wps rec; Wp wp; if (!*pvoie->ch_temp) { texte (T_ERR + 2); return (retour); } pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (retour); lc = call2l (mask); while (read_wp (record, &wp)) { if (wp.callsign == lc) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (*rec.first_homebbs) { display_wp_user ((long) record, &rec); pvoie->temp1 = 1; break; } } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } ++record; } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) { texte (T_ERR + 19); pvoie->noenr_menu = -1L; } return (retour); } static int wp_search_bbs (void) { /* char s[256]; */ char mask[42]; FILE *fptr; Wps rec; Wp wp; unsigned record; int retour = 1; int no_mask; lcall callsign; if (!*pvoie->ch_temp) { texte (T_ERR + 2); return (retour); } pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (1); if ((no_mask = str_alnum (mask)) != 0) callsign = call2l (mask); if (no_mask) { while (read_wp (record, &wp)) { if (wp.home == callsign) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (display_wp_line (&rec)) pvoie->temp1 = 1; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } ++record; } } else { while (read_wp (record, &wp)) { if ((wp.callsign) && (strmatch (l2call (wp.home), mask))) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (display_wp_line (&rec)) pvoie->temp1 = 1; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } ++record; } } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) texte (T_ERR + 19); return (retour); } static int wp_search_name (void) { char mask[42]; FILE *fptr; Wps rec; unsigned record; int retour = 1; int ok; if (!*pvoie->ch_temp) { texte (T_ERR + 2); return (retour); } pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (1); while (1) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); ok = fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (ok == 0) break; if ((*rec.first_homebbs) && (*rec.name) && (*rec.name != '?')) { if ((*rec.callsign) && (strstr (strupr (rec.name), mask))) { display_wp_line (&rec); pvoie->temp1 = 1; } } ++record; if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) texte (T_ERR + 19); return (retour); } static int wp_search_qth (void) { char mask[42]; FILE *fptr; Wps rec; unsigned record; int retour = 1; int ok; if (!*pvoie->ch_temp) { texte (T_ERR + 2); return (retour); } pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (1); while (1) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); ok = fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (ok == 0) break; if ((*rec.first_homebbs) && (*rec.first_qth) && (*rec.first_qth != '?')) { if ((*rec.callsign) && (strstr (strupr (rec.first_qth), mask))) { display_wp_line (&rec); pvoie->temp1 = 1; } } ++record; if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) texte (T_ERR + 19); return (retour); } static int wp_search_zip (void) { char mask[42]; FILE *fptr; Wps rec; unsigned record; int retour = 1; int ok; if (!*pvoie->ch_temp) { texte (T_ERR + 2); return (retour); } pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (1); while (1) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); ok = fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (ok == 0) break; if (*rec.first_homebbs) { if ((*rec.callsign) && (strmatch (rec.first_zip, mask))) { display_wp_line (&rec); pvoie->temp1 = 1; } } ++record; if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) texte (T_ERR + 19); return (retour); } static int wp_search_area (void) { char *ptr; char mask[42]; char route[42]; FILE *fptr; Wps rec; unsigned record; int retour = 1; int ok; if (!*pvoie->ch_temp) { texte (T_ERR + 2); return (retour); } pvoie->sr_mem = pvoie->seq = FALSE; record = (unsigned) pvoie->noenr_menu; strn_cpy (40, mask, pvoie->ch_temp); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return (1); while (1) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); ok = fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (ok == 0) break; if (*rec.first_homebbs) { strn_cpy (40, route, rec.first_homebbs); ptr = strtok (route, "."); while (ptr) { if (strcmp (ptr, mask) == 0) { display_wp_line (&rec); pvoie->temp1 = 1; break; } ptr = strtok (NULL, "."); } } ++record; if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } fclose (fptr); pvoie->noenr_menu = record; if (retour && (pvoie->temp1 == 0)) texte (T_ERR + 19); return (retour); } static char *replace_space (char *ptr) { char *scan = ptr; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } return (ptr); } static void update_user_home_bbs (char *callsign, char *homebbs) { FILE *fpti; info frec; unsigned num_indic; char call[8]; char *ptr; /* Modifie le user eventuellement */ pvoie->emis = insnoeud (callsign, &num_indic); if (pvoie->emis->coord != 0xffff) { /* Seulement l'indicatif */ n_cpy (6, call, homebbs); ptr = strchr (call, '.'); if (ptr) *ptr = '\0'; fpti = ouvre_nomenc (); fseek (fpti, (long) pvoie->emis->coord * sizeof (info), 0); fread (&frec, sizeof (info), 1, fpti); strcpy (frec.home, call); fseek (fpti, (long) pvoie->emis->coord * sizeof (info), 0); fwrite (&frec, sizeof (info), 1, fpti); ferme (fpti, 39); } } static void modif_wp_record (long record) { int c; int err = 0; FILE *fptr; Wp wp; Wps rec; unsigned num_indic; fptr = fopen (d_disque ("WP\\WP.SYS"), "r+b"); if (fptr == NULL) return; deb_io (); fseek (fptr, record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); c = *indd++; switch (toupper (c)) { case 'N': incindd (); n_cpy (12, rec.name, replace_space (indd)); break; case 'U': n_cpy (40, rec.first_homebbs, rec.secnd_homebbs); n_cpy (30, rec.first_qth, rec.secnd_qth); n_cpy (8, rec.first_zip, rec.secnd_zip); read_wp ((unsigned) record, &wp); wp.home = call2l (bbs_via (rec.first_homebbs)); write_wp ((unsigned) record, &wp); update_user_home_bbs (rec.callsign, rec.first_homebbs); break; case '1': c = *indd++; incindd (); if (strcmp (indd, ".") == 0) *indd = '\0'; switch (toupper (c)) { case 'H': strn_cpy (40, rec.first_homebbs, extend_bbs (indd)); read_wp ((unsigned) record, &wp); wp.home = call2l (bbs_via (rec.first_homebbs)); write_wp ((unsigned) record, &wp); update_user_home_bbs (rec.callsign, rec.first_homebbs); break; case 'Q': n_cpy (30, rec.first_qth, indd); break; case 'Z': strn_cpy (8, rec.first_zip, replace_space (indd)); /* Modifie le zip eventuellement */ pvoie->emis = insnoeud (rec.callsign, &num_indic); if (pvoie->emis->coord != 0xffff) { FILE *fpti; info frec; fpti = ouvre_nomenc (); fseek (fpti, (long) pvoie->emis->coord * sizeof (info), 0); fread (&frec, sizeof (info), 1, fpti); strcpy (frec.zip, rec.first_zip); fseek (fpti, (long) pvoie->emis->coord * sizeof (info), 0); fwrite (&frec, sizeof (info), 1, fpti); ferme (fpti, 39); } break; default: err = 1; texte (T_ERR + 0); break; } break; case '2': c = *indd++; incindd (); switch (toupper (c)) { case 'H': strn_cpy (40, rec.secnd_homebbs, extend_bbs (indd)); break; case 'Q': n_cpy (30, rec.secnd_qth, indd); break; case 'Z': strn_cpy (8, rec.secnd_zip, replace_space (indd)); break; default: err = 1; texte (T_ERR + 0); break; } break; default: err = 1; texte (T_ERR + 0); break; } if (!err) { rec.changed = 'U'; fseek (fptr, record * sizeof (Wps), SEEK_SET); fwrite (&rec, sizeof (Wps), 1, fptr); } fin_io (); fclose (fptr); display_wp_user (record, &rec); } static void kill_wp_record (long record) { FILE *fptr; Wp wp; Wps rec; fptr = fopen (d_disque ("WP\\WP.SYS"), "r+b"); if (fptr == NULL) return; deb_io (); fseek (fptr, record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); *rec.callsign = '\0'; *rec.first_homebbs = '\0'; fseek (fptr, record * sizeof (Wps), SEEK_SET); fwrite (&rec, sizeof (Wps), 1, fptr); read_wp ((unsigned) record, &wp); wp.callsign = 0L; wp.home = 0L; write_wp ((unsigned) record, &wp); fin_io (); fclose (fptr); } static int wp_edit (void) { int fin = 1; int prompt = 1; char s[80]; sup_ln (indd); switch (pvoie->niv3) { case 20: prompt = 0; if (wp_list_user () == 0) { return (0); } if ((!*pvoie->ch_temp) || (pvoie->noenr_menu == -1L)) { fin = 1; } else { ch_niv3 (21); var_cpy (0, pvoie->ch_temp); texte (T_MBL + 30); fin = 0; } break; case 21: if (toupper (*indd) == Oui) { kill_wp_record (pvoie->noenr_menu); fin = 1; prompt = 0; } else { fin = 0; ch_niv3 (22); } break; case 22: if (*indd) { modif_wp_record (pvoie->noenr_menu); fin = 0; } else { fin = 1; prompt = 0; } break; } if (prompt) { sprintf (s, "(U)pdate,(N)ame,(1H)ome,(1Z)ip,(1Q)th,(2H)ome,(2Z)ip,(2Q)th,(Return) >"); outln (s, strlen (s)); } return (fin); } int menu_wp_search (void) { int menu = 1; int error = 0; int c; sup_ln (indd); c = *indd++; while_space (); pvoie->temp1 = 0; pvoie->noenr_menu = 0; strn_cpy (40, pvoie->ch_temp, indd); if (c == '\0') { mbl_info (); retour_mbl (); return (0); } if (!EMS_WPG_OK ()) { return (1); } switch (toupper (c)) { case ' ': if (wp_search_call () == 0) { menu = 0; ch_niv3 (1); } break; case '@': if (wp_search_bbs () == 0) { menu = 0; ch_niv3 (2); } break; case 'D': if (wp_stats () == 0) { menu = 0; ch_niv3 (10); } break; case 'E': if (droits (COSYSOP)) { ch_niv3 (20); if (wp_edit () == 0) { menu = 0; } } else error = 1; break; case 'H': if (wp_search_area () == 0) { menu = 0; ch_niv3 (4); } break; case 'L': if (droits (COSYSOP)) { if (wp_list_user () == 0) { menu = 0; ch_niv3 (5); } } else error = 1; break; case 'N': if (wp_search_name () == 0) { menu = 0; ch_niv3 (6); } break; case 'Q': if (wp_search_qth () == 0) { menu = 0; ch_niv3 (7); } break; case 'Z': if (wp_search_zip () == 0) { menu = 0; ch_niv3 (3); } break; default: error = 1; break; } if (!error && menu) retour_mbl (); return (error); } void wp_search (void) { int fin; switch (pvoie->niv3) { case 1: fin = wp_search_call (); break; case 2: fin = wp_search_bbs (); break; case 3: fin = wp_search_zip (); break; case 4: fin = wp_search_area (); break; case 5: fin = wp_list_user (); break; case 6: fin = wp_search_name (); break; case 7: fin = wp_search_qth (); break; case 10: fin = wp_stats (); break; case 20: case 21: case 22: case 23: case 24: case 25: case 26: case 27: case 28: case 29: fin = wp_edit (); break; default: fin = 1; fbb_error (ERR_NIVEAU, "WP-SEARCH", pvoie->niv3); break; } if (fin) retour_mbl (); } /* Service WP */ static void wp_serv_callsign (FILE * fpto, char *mask) { unsigned record = 0; FILE *fptr; int nb = 0; Wps rec; Wp wp; fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) return; while (read_wp (record, &wp)) { if ((wp.callsign) && (strmatch (l2call (wp.callsign), mask))) { deb_io (); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fin_io (); if (*rec.first_homebbs) { fprintf (fpto, "On %s %s @ %s zip %s %s %s\r\n", date_mbl (rec.last_modif), rec.callsign, (*rec.first_homebbs) ? rec.first_homebbs : "?", (*rec.first_zip) ? rec.first_zip : "?", (*rec.name) ? rec.name : "?", (*rec.first_qth) ? rec.first_qth : "?" ); if (++nb == 100) { fprintf (fpto, "*** More than 100 entries for %s.\r\n", mask); break; } } } ++record; } fclose (fptr); if (nb == 0) { fprintf (fpto, "*** %s not found.\n", mask); } } int wp_service (char *filename) { int ok; int premier = 1; FILE *fptr; FILE *fpto; char buffer[256]; char sender[80]; char commande[80]; char qmark[80]; if (!EMS_WPG_OK ()) return (1); fptr = fopen (filename, "rt"); /* Open the received message */ if (fptr == NULL) return (1); fgets (buffer, 80, fptr); /* Read the command line */ sscanf (buffer, "%s %s %s %s\n", commande, commande, commande, sender); *qmark = '\0'; fgets (buffer, 80, fptr); /* Read the subject */ if ((strcmp (sender, "WP") == 0) || (is_wpupdate (buffer))) { fclose (fptr); return (1); } fpto = fappend (MAILIN, "b"); if (fpto == NULL) return (1); while (fgets (buffer, 80, fptr)) { /* Read the lines */ strupr (buffer); *qmark = '\0'; /* Capitalize */ sscanf (buffer, "%s %s", commande, qmark); /* Scan lines */ ok = 0; if (*qmark == '?') { ok = 1; } else if (*qmark == '\0') { if (commande[strlen (commande) - 1] == '?') { commande[strlen (commande) - 1] = '\0'; ok = 1; } } if (ok) { if (premier) { fprintf (fpto, "#\r\n"); /* Tell that this is a message from this BBS */ fprintf (fpto, "SP %s @ %s < %s\r\n", sender, pvoie->mess_home, mycall); fprintf (fpto, "WP Reply\r\n"); premier = 0; } wp_serv_callsign (fpto, commande); } } if (!premier) fprintf (fpto, "[ From WP @ %s ]\r\n/EX\r\n", mycall); fclose (fpto); fclose (fptr); /* All needed is read */ return (0); /* Retour ok */ } /* Cherche un home BBS pour le destinataire specifie et le met dans bbsv le champ bbsv doit etre vide en entree. retourne 1 si le destinataire a ete trouve dans la base. */ int route_wp_home (bullist * pbull) { FILE *fptr; unsigned record; int retour = 0; Wps rec; record = search_wp_record (call2l (pbull->desti), USR_CALL, 0); if (record < 0xffff) { deb_io (); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) { fin_io (); return (0); } fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); fclose (fptr); if (*rec.first_homebbs) { strn_cpy (40, pbull->bbsv, rec.first_homebbs); retour = 1; } fin_io (); } return (retour); } /* Cherche l'extension hierarchique d'une BBS et la met dans bbsv le champ bbsv ne doit pas avoir d'extension en entree. retourne 1 si l'extension a ete trouvee dans la base. */ int route_wp_hier (bullist * pbull) { FILE *fptr; unsigned record; int retour = 0; Wps rec; if (!EMS_WPG_OK ()) return (0); record = search_wp_record (call2l (pbull->bbsv), BBS_CALL, 0); if (record < 0xffff) { deb_io (); fptr = fopen (d_disque ("WP\\WP.SYS"), "rb"); if (fptr == NULL) { fin_io (); return (0); } fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&rec, sizeof (Wps), 1, fptr); if (*rec.first_homebbs) { strn_cpy (40, pbull->bbsv, rec.first_homebbs); retour = 1; } fclose (fptr); fin_io (); } return (retour); } static char *l2call (lcall val) { static char callsign[7]; char *ptr = callsign; unsigned long c; c = val / 69343957L; if (c) { val -= (c * 69343957L); *ptr++ = (char) ((c >= 11) ? c + 54 : c + 47); } c = val / 1874161L; if (c) { val -= (c * 1874161L); *ptr++ = (char) ((c >= 11) ? c + 54 : c + 47); } c = val / 50653L; if (c) { val -= (c * 50653L); *ptr++ = (char) ((c >= 11) ? c + 54 : c + 47); } c = val / 1369L; if (c) { val -= (c * 1369L); *ptr++ = (char) ((c >= 11) ? c + 54 : c + 47); } c = val / 37L; if (c) { val -= (c * 37L); *ptr++ = (char) ((c >= 11) ? c + 54 : c + 47); } c = val; if (c) { *ptr++ = (char) ((c >= 11) ? c + 54 : c + 47); } *ptr = '\0'; return (callsign); } fbb-7.0.10/src/drv_mod.c0000644000175000017500000005766313613360505011661 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /****************************** * * DRIVERS pour ligne MODEM * ******************************/ #include #ifdef __linux__ #include #include #include #include #include #define N_TTY_BUF_SIZE 4096 #endif #include #include #define ANCIEN 1 extern int GetModemDCD (int port); /* #if defined (__WINDOWS__) || defined(__linux__) */ #define LOCSIZ 256 static char *locbuf[NBPORT] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}; static int locnb[NBPORT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; static int echap[NBPORT] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; /* #endif */ static int bs[NBPORT] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; int echo[NBPORT] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; /* * Fonctions g‚n‚riques du driver */ int sta_mod (int port, int canal, int cmd, void *ptr) { int ret = 0; char command[256]; switch (cmd) { case PORTCMD: strcpy (command, (char *) ptr); strcat (command, "\r"); ret = snd_mod (port, 0, COMMAND, command, strlen (command), NULL); sleep_ (1); break; case BSCMD: bs[port] = *((int *) ptr); return (1); case ECHOCMD: echo[port] = *((int *) ptr); #ifdef __WIN32__ SetModemEcho (port, echo[port]); #endif return (1); case SUSPCMD: return (1); } return (ret); } int snd_mod (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ctrl = 0; char c; switch (cmd) { case COMMAND: while (len--) { c = *buffer++; switch (c) { case '~': deb_io (); #ifdef __WINDOWS__ WinMSleep (500); #else tempo = 10; while (tempo); #endif break; case '^': ctrl = 1; break; default: if (ctrl) { c -= '@'; ctrl = 0; } #ifdef __linux__ if (BIOS (port) == P_LINUX) { defcom *ptrcom = &p_com[(int)p_port[port].ccom]; int nb; if (ptrcom->comfd < 0) return (1); for (;;) { int nbcar; ioctl (ptrcom->comfd, TIOCOUTQ, &nbcar); if ((N_TTY_BUF_SIZE - nbcar) >= 1) break; sleep_ (1); } nb = write (ptrcom->comfd, &c, 1); nb = N_TTY_BUF_SIZE >> 8; p_port[port].frame = (uchar) nb - 2; } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { #ifdef __WIN32__ int nb; nb = PutModemBuf (port, &c, 1); #else defcom *ptrcom = &p_com[p_port[port].ccom]; COMSTAT cstat; DWORD dwErrorMask; int nb; if (ptrcom->comfd < 0) return (1); for (;;) { GetCommError (ptrcom->comfd, &cstat); if ((OUTQUE - cstat.cbOutQue) >= 1) break; sleep_ (1); } nb = WriteComm (ptrcom->comfd, &c, 1); while (GetCommError (ptrcom->comfd, &cstat)); #endif nb = OUTQUE >> 8; p_port[port].frame = (uchar) nb - 2; } #endif #ifdef __FBBDOS__ { RSEGS rsegs; BufReel[0] = c; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.CX = 1; rsegs.DX = (int) p_port[port].ccom - 1; rsegs.DI = 0; rsegs.ES = BufSeg; rsegs.DS = BufSeg; while (rsegs.CX) { rsegs.AX = 0x0a00; int14real (&rsegs); } } #endif break; } } break; case DATA: #ifdef __linux__ if (BIOS (port) == P_LINUX) { defcom *ptrcom = &p_com[(int)p_port[port].ccom]; int nb; int c; int i; int dbl; /* int binary; */ char buf[600]; if (ptrcom->comfd < 0) return (1); /* binary = svoie[p_port[port].pr_voie]->binary; */ if (bs[port]) { i = 0; for (nb = 0; nb < len; nb++) { buf[i++] = buffer[nb]; if (buffer[nb] == '\r') buf[i++] = '\n'; } } else { i = 0; for (nb = 0; nb < len; nb++) { c = buffer[nb] & 0xff; switch (c) { case 0x01: /* Echappement */ case 0x11: /* XOn */ case 0x13: /* XOff */ case 0x08: /* BS */ case 0x0a: /* LF */ case 0x00: /* Null */ c += 0x40; dbl = 1; break; default: dbl = 0; break; } if (dbl) { /* Caractere d'echappement */ buf[i++] = 0x01; } buf[i++] = c; } } for (;;) { int nbcar; ioctl (ptrcom->comfd, TIOCOUTQ, &nbcar); if ((N_TTY_BUF_SIZE - nbcar) >= i) break; sleep_ (1); } nb = write (ptrcom->comfd, buf, i); nb = N_TTY_BUF_SIZE >> 8; p_port[port].frame = (uchar) nb - 2; } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { #ifdef __WIN32__ defcom *ptrcom = &p_com[p_port[port].ccom]; int nb; int c; int i; int dbl; char buf[600]; if (ptrcom->comfd == NULL) return (1); i = 0; if (bs[port]) { for (nb = 0; nb < len; nb++) { c = buffer[nb] & 0xff; buf[i++] = c; /* Envoie le LF si pas d'echo ... */ if (c == '\r') buf[i++] = '\n'; } } else { for (nb = 0; nb < len; nb++) { c = buffer[nb] & 0xff; if (!bs[port]) { switch (c) { case 0x01: /* Echappement */ case 0x11: /* XOn */ case 0x13: /* XOff */ case 0x08: /* BS */ case 0x0a: /* LF */ case 0x00: /* Null */ c += 0x40; dbl = 1; break; default: dbl = 0; break; } if (dbl) { /* Caractere d'echappement */ buf[i++] = 0x01; } } buf[i++] = c; } } nb = PutModemBuf (port, buf, i); nb = OUTQUE >> 8; p_port[port].frame = (uchar) nb - 2; #else defcom *ptrcom = &p_com[p_port[port].ccom]; COMSTAT cstat; int nb; int c; int i; int dbl; /* int binary; */ char buf[600]; if (ptrcom->comfd < 0) return (1); /* binary = svoie[p_port[port].pr_voie]->binary; */ i = 0; if (bs[port]) { for (nb = 0; nb < len; nb++) { c = buffer[nb] & 0xff; buf[i++] = c; /* Envoie le LF si pas d'echo ... */ if (c == '\r') buf[i++] = '\n'; } } else { for (nb = 0; nb < len; nb++) { c = buffer[nb] & 0xff; if (!bs[port]) { switch (c) { case 0x01: /* Echappement */ case 0x11: /* XOn */ case 0x13: /* XOff */ case 0x08: /* BS */ case 0x0a: /* LF */ case 0x00: /* Null */ c += 0x40; dbl = 1; break; default: dbl = 0; break; } if (dbl) { /* Caractere d'echappement */ buf[i++] = 0x01; } } buf[i++] = c; } } for (;;) { GetCommError (ptrcom->comfd, &cstat); if ((OUTQUE - cstat.cbOutQue) >= i) break; sleep_ (1); } nb = WriteComm (ptrcom->comfd, buf, i); while (GetCommError (ptrcom->comfd, &cstat)); nb = OUTQUE >> 8; p_port[port].frame = (uchar) nb - 2; #endif } #endif #ifdef __FBBDOS__ { int nb; int c; int i; int dbl; /* int binary; */ char buf[600]; /* binary = svoie[p_port[port].pr_voie]->binary; */ i = 0; if (bs[port]) { memcpy (buf, buffer, len); } else { for (nb = 0; nb < len; nb++) { c = buffer[nb] & 0xff; switch (c) { case 0x01: /* Echappement */ case 0x11: /* XOn */ case 0x13: /* XOff */ case 0x0a: /* LF */ case 0x08: /* BS */ case 0x00: /* Null */ c += 0x40; dbl = 1; break; default: dbl = 0; break; } if (dbl) { /* Caractere d'echappement */ buf[i++] = 0x01; } buf[i++] = c; /* Envoie le LF si pas d'echo ... if ((!binary) && (p_port[port].echo) && (c == '\r')) */ } len = i; } memcpy (BufReel, buf, len); memset (&rsegs, 0, sizeof (RSEGS)); rsegs.CX = len; rsegs.DX = (int) p_port[port].ccom - 1; rsegs.DI = 0; rsegs.ES = BufSeg; rsegs.DS = BufSeg; while (rsegs.CX) { rsegs.AX = 0xa00; if (rsegs.CX != len) sleep_ (1); int14real (&rsegs); } p_port[port].frame = (uchar) (rsegs.BX >> 9) - 2; } #endif return (1); case UNPROTO: break; } return (1); } void end_modem (void) { #if defined(__WINDOWS__) || defined(__linux__) int i; for (i = 0; i < NBPORT; i++) { if (locbuf[i]) { m_libere (locbuf[i], LOCSIZ); locbuf[i] = NULL; } } #endif } int lit_port_modem (int port) { int fin_rxmodem; int fin_txmodem; int abort_xmodem; int zr_pos; int nb, con; int nbtot; int voie; int ch_stat; Forward *pfwd; if (DEBUG) return (0); df ("lit_port_modem", 3); voie = p_port[port].pr_voie; pfwd = svoie[voie]->curfwd; ch_stat = 0; #ifdef __linux__ if (BIOS (port) == P_LINUX) /* LINUX driver */ { defcom *ptrcom = &p_com[(int)p_port[port].ccom]; char buffer[300]; if (ptrcom->comfd < 0) return 0; for (;;) { int mcs; int old; if (svoie[voie]->binary == 2) nb = 0; else { old = fcntl (ptrcom->comfd, F_GETFL, 0); (void) fcntl (ptrcom->comfd, F_SETFL, old | O_NDELAY); nb = read (ptrcom->comfd, buffer, 300); (void) fcntl (ptrcom->comfd, F_SETFL, old); } if (nb < 0) { /* perror("com read"); */ nb = 0; } /* Lit l'etat du DCD */ ioctl (ptrcom->comfd, TIOCMGET, &mcs); con = (mcs & TIOCM_CAR) ? 1 : 0; fin_rxmodem = 0; fin_txmodem = 0; abort_xmodem = 0; zr_pos = 0; if ((svoie[voie]->sta.connect > 1) && (svoie[voie]->sta.connect < 17) && (!con)) { md_no_echo (voie); if (svoie[voie]->kiss >= 0) { init_timout (voie); selvoie (svoie[voie]->kiss); /* outln("MODEM DISCONNECTION", 20) ; */ ch_niv3 (2); texte (T_GAT + 1); selvoie (voie); status (voie); svoie[voie]->sta.connect = 17; } else { dec_voie (voie); re_init_modem (voie); echap[port] = 0; ch_stat = 1; } } if (nb) { if (con) { int c; int i; char *lbuf = locbuf[port]; int lnb = locnb[port]; if (lbuf == NULL) { lbuf = locbuf[port] = malloc (LOCSIZ); lnb = locnb[port] = 0; } if (svoie[voie]->binary == 2) { /* Envoie les donnees au process du FORK */ int fd = svoie[voie]->to_rzsz[1]; nb = write (fd, buffer, nb); if (nb < 0) nb = 0; if (nb) { /* int i; dprintf("Envoye %d carac a rszs(fd = %d)\n", nb, fd); for (i = 0 ; i < nb ; i++) dprintf("%02x ", buffer[i] &0xff); dprintf("\n"); */ } } else { for (i = 0; i < nb; i++) { c = buffer[i] & 0xff; if (echap[port]) { c -= 0x40; echap[port] = 0; } else if (c == 0x01) { /* Caractere d'echappement */ echap[port] = c; continue; } else if ((c == 0x08) /* && (bs[port]) */ ) { if (lnb > 0) { selvoie (voie); outs ("\b \b", 3); --lnb; } continue; } else if ((c == 0x0d) || /* CR */ (c == 0x11) || /* XOn */ (c == 0x13) || /* XOff */ (c == 0x00)) /* Null */ { /* A jeter !! */ continue; } else if (c == '\n') { /* transformer les LF en CR */ c = '\r'; } lbuf[lnb++] = c; if ((c == '\r') || (lnb == LOCSIZ) || ((svoie[voie]->binary) && (nb == i + 1))) { if (svoie[voie]->kiss >= 0) { init_timout (voie); selvoie (svoie[voie]->kiss); outs (lbuf, lnb); write_capture (lbuf, lnb); selvoie (voie); } else { md_inbuf (voie, lbuf, lnb); if ((pfwd) && (*pfwd->txt_con)) { md_send (no_port (voie), pfwd->txt_con); *pfwd->txt_con = '\0'; } } lnb = 0; } } locnb[port] = lnb; } } else if (md_busy (buffer, nb)) { /* Arret de la connexion */ md_no_echo (voie); if (svoie[voie]->sta.connect) { dec_voie (voie); deconnect_modem (voie); re_init_modem (voie); echap[port] = 0; ch_stat = 1; } } } else { if (con) { if (svoie[voie]->sta.connect <= 1) { sleep_ (1); connect_modem (voie); nb_trait = 0; status (voie); traite_voie (voie); } else if (svoie[voie]->sta.connect == 17) { sleep_ (1); init_timout (voie); selvoie (svoie[voie]->kiss); ch_niv3 (3); selvoie (voie); status (voie); svoie[voie]->sta.connect = 2; md_defaut (voie); } } break; } } if (ch_stat) { nb_trait = 0; traite_voie (voie); } /* Lire le nb de buffers dispos en emission */ { int nbcar; if (ioctl (ptrcom->comfd, TIOCOUTQ, &nbcar) == -1) perror ("ioctl"); /* printf("buf = %d\n", nbcar); */ nbtot = (nbcar + 127) >> 7; p_port[no_port (voie)].frame = (uchar) (N_TTY_BUF_SIZE >> 8) - 1; svoie[voie]->sta.mem = (N_TTY_BUF_SIZE >> 7); /* nbtot = (cstat.cbOutQue + 127) >> 7; p_port[no_port (voie)].frame = (uchar) (OUTQUE >> 8) - 1; svoie[voie]->sta.mem = (OUTQUE >> 7); */ } if (nbtot != svoie[voie]->sta.ack) { svoie[voie]->sta.ack = nbtot; if ((nbtot > 20) && (svoie[voie]->ch_mon >= 0)) { svoie[voie]->ch_mon = -1; } ch_stat = 1; } if (svoie[voie]->sta.connect) { ack_suiv (voie); } if ((!svoie[voie]->stop) && (svoie[voie]->seq)) { /* Recharge les bufs de sortie */ if (tot_mem > 10000L) traite_voie (voie); ff (); return (0); } if ((v_tell == 0) || (v_tell != voie) || ((v_tell) && (v_tell == voie))) { while ((!svoie[voie]->seq) && (inbuf_ok (voie))) { traite_voie (voie); if (svoie[voie]->seq) break; } } } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) /* WINDOWS driver */ { int nstat; COMSTAT cstat; defcom *ptrcom = &p_com[p_port[port].ccom]; char buffer[300]; #ifdef __WIN32__ int nbused; if (ptrcom->comfd == NULL) return; #else if (ptrcom->comfd < 0) return; #endif for (;;) { #ifdef __WIN32__ con = GetModemDCD (port); if ((con) && (svoie[voie]->niv1 == N_MOD) && (svoie[voie]->niv2 == 4) && ((svoie[voie]->niv3 == XR_EXTERN) || (svoie[voie]->niv3 == XS_EXTERN))) { if ((GetTransferStat (port)) == 0) { traite_voie (voie); return (0); } nb = 0; } else { nb = GetModemBuf (port, buffer, 300); } #else nb = ReadComm (ptrcom->comfd, buffer, 300); if (nb < 0) nb = -nb; while (GetCommError (ptrcom->comfd, &cstat)); nstat = GetCommStatus (ptrcom->comfd); con = (nstat & 0x80) ? 1 : 0; #endif fin_rxmodem = 0; fin_txmodem = 0; abort_xmodem = 0; zr_pos = 0; if ((svoie[voie]->sta.connect > 1) && (svoie[voie]->sta.connect < 17) && (!con)) { md_no_echo (voie); if (svoie[voie]->kiss >= 0) { init_timout (voie); selvoie (svoie[voie]->kiss); /* outln("MODEM DISCONNECTION", 20) ; */ ch_niv3 (2); texte (T_GAT + 1); selvoie (voie); status (voie); svoie[voie]->sta.connect = 17; } else { dec_voie (voie); re_init_modem (voie); echap[port] = 0; ch_stat = 1; } } if (nb) { if (con) { int c; int i; char *lbuf = locbuf[port]; int lnb = locnb[port]; if (lbuf == NULL) { lbuf = locbuf[port] = malloc (LOCSIZ); lnb = locnb[port] = 0; } for (i = 0; i < nb; i++) { c = buffer[i] & 0xff; if (echap[port]) { c -= 0x40; echap[port] = 0; } else if (c == 0x01) { /* Caractere d'echappement */ echap[port] = c; continue; } else if (c == 0x08) { if ((lnb > 0) && (bs[port])) { #ifndef __WIN32__ selvoie (voie); outs ("\b \b", 3); #endif --lnb; } continue; } else if ((c == 0x0a) || /* LF */ (c == 0x11) || /* XOn */ (c == 0x13) || /* XOff */ (c == 0x00)) /* Null */ { /* A jeter !! */ continue; } lbuf[lnb++] = c; if ((c == '\r') || (lnb == LOCSIZ) || ((svoie[voie]->binary) && (nb == i + 1))) { if (svoie[voie]->kiss >= 0) { init_timout (voie); selvoie (svoie[voie]->kiss); outs (lbuf, lnb); write_capture (lbuf, lnb); selvoie (voie); } else { md_inbuf (voie, lbuf, lnb); if ((pfwd) && (*pfwd->txt_con)) { md_send (no_port (voie), pfwd->txt_con); *pfwd->txt_con = '\0'; } } lnb = 0; } } locnb[port] = lnb; } else if (md_busy (buffer, nb)) { /* Arret de la connexion */ md_no_echo (voie); if (svoie[voie]->sta.connect) { dec_voie (voie); deconnect_modem (voie); #ifndef __WIN32__ re_init_modem (voie); #endif echap[port] = 0; ch_stat = 1; } } } else { if (con) { if (svoie[voie]->sta.connect <= 1) { sleep_ (1); connect_modem (voie); nb_trait = 0; status (voie); traite_voie (voie); } else if (svoie[voie]->sta.connect == 17) { sleep_ (1); init_timout (voie); selvoie (svoie[voie]->kiss); ch_niv3 (3); selvoie (voie); status (voie); svoie[voie]->sta.connect = 2; md_defaut (voie); } } break; } } if (ch_stat) { nb_trait = 0; traite_voie (voie); } #ifdef __WIN32__ GetModemStat (no_port (voie), &nbtot, &nbused); svoie[voie]->sta.mem = nbtot >> 8; nbtot = (nbused + 249) >> 8; #else nbtot = (cstat.cbOutQue + 127) >> 7; p_port[no_port (voie)].frame = (uchar) (OUTQUE >> 8) - 1; svoie[voie]->sta.mem = (OUTQUE >> 7); #endif if (nbtot != svoie[voie]->sta.ack) { svoie[voie]->sta.ack = nbtot; if ((nbtot > 20) && (svoie[voie]->ch_mon >= 0)) { svoie[voie]->ch_mon = -1; } ch_stat = 1; } if (svoie[voie]->sta.connect) { ack_suiv (voie); } if ((!svoie[voie]->stop) && (svoie[voie]->seq)) { /* Recharge les bufs de sortie */ if (tot_mem > 10000L) traite_voie (voie); ff (); return (0); } if ((v_tell == 0) || (v_tell != voie) || ((v_tell) && (v_tell == voie))) { while ((!svoie[voie]->seq) && (inbuf_ok (voie))) { traite_voie (voie); if (svoie[voie]->seq) break; } } } #endif #ifdef __FBBDOS__ { RSEGS rsegs; for (;;) { memset (&rsegs, 0, sizeof (RSEGS)); rsegs.AX = 0xb00; rsegs.CX = 256; rsegs.DX = (int) p_port[port].ccom - 1; rsegs.DI = 0; rsegs.ES = BufSeg; rsegs.DS = BufSeg; int14real (&rsegs); nb = (int) rsegs.CX; con = (rsegs.AX & 0x80) ? 1 : 0; fin_rxmodem = ((nb == 0) && (rsegs.BX & 0x1000)); fin_txmodem = ((rsegs.BX & 0x0080) == 0); abort_xmodem = ((rsegs.BX & 0x4000) != 0); zr_pos = ((rsegs.BX & 0x0040) != 0); if ((svoie[voie]->type_yapp == 3) && ((rsegs.BX & 0x8000) != 0)) { fin_txmodem = 1; } if (zr_pos) get_zrpos (voie); if ((svoie[voie]->time_trans == 0L) && ((rsegs.BX & 0x0100) == 0)) svoie[voie]->time_trans = time (NULL); if ((svoie[voie]->sta.connect > 1) && (svoie[voie]->sta.connect < 17) && (!con)) { md_no_echo (voie); if (svoie[voie]->kiss >= 0) { init_timout (voie); selvoie (svoie[voie]->kiss); /* outln("MODEM DISCONNECTION", 20) ; */ ch_niv3 (2); texte (T_GAT + 1); selvoie (voie); status (voie); svoie[voie]->sta.connect = 17; } else { dec_voie (voie); re_init_modem (voie); echap[port] = 0; ch_stat = 1; } } if (nb) { if (con) { if (svoie[voie]->kiss >= 0) { init_timout (voie); selvoie (svoie[voie]->kiss); outs (BufReel, nb); write_capture (BufReel, nb); selvoie (voie); } else { int i; int c; int lnb = nb; #if 0 lnb = 0; for (i = 0; i < nb; i++) { c = BufReel[i] & 0xff; if (echap[port]) { c -= 0x40; echap[port] = 0; } else if (c == 0x01) { echap[port] = c; continue; } else if (c == 0x08) { continue; } else if ((c == 0x0a) || /* LF */ (c == 0x11) || /* XOn */ (c == 0x13) || /* XOff */ (c == 0x00)) /* Null */ { continue; } BufReel[lnb++] = c; } #endif md_inbuf (voie, BufReel, lnb); if ((pfwd) && (*pfwd->txt_con)) { md_send (no_port (voie), pfwd->txt_con); *pfwd->txt_con = '\0'; } } } else if (md_busy (BufReel, nb)) { /* Arret de la connexion */ md_no_echo (voie); if (svoie[voie]->sta.connect) { dec_voie (voie); deconnect_modem (voie); re_init_modem (voie); echap[port] = 0; ch_stat = 1; } } } else { if (con) { if (svoie[voie]->sta.connect <= 1) { sleep_ (1); connect_modem (voie); nb_trait = 0; status (voie); traite_voie (voie); } else if (svoie[voie]->sta.connect == 17) { sleep_ (1); init_timout (voie); selvoie (svoie[voie]->kiss); ch_niv3 (3); selvoie (voie); status (voie); svoie[voie]->sta.connect = 2; md_defaut (voie); } } break; } } if (ch_stat) { nb_trait = 0; traite_voie (voie); } if ((svoie[voie]->binary) && (abort_xmodem)) { xmodem_fin (voie); svoie[voie]->niv3 = XM_ABORT; traite_voie (voie); } memset (&rsegs, 0, sizeof (RSEGS)); rsegs.AX = 0x0a00; rsegs.CX = 0; rsegs.DX = (int) p_port[port].ccom - 1; rsegs.DI = 0; rsegs.ES = BufSeg; rsegs.DS = BufSeg; int14real (&rsegs); nbtot = (int) ((rsegs.BX >> 8) - (rsegs.BX & 0xff)); p_port[no_port (voie)].frame = (uchar) (rsegs.BX >> 9) - 1; svoie[voie]->sta.mem = (int) (rsegs.BX >> 8) + 4; if (nbtot != svoie[voie]->sta.ack) { svoie[voie]->sta.ack = nbtot; if ((nbtot > 20) && (svoie[voie]->ch_mon >= 0)) { svoie[voie]->ch_mon = -1; } ch_stat = 1; } if (svoie[voie]->sta.connect) { ack_suiv (voie); } if ((svoie[voie]->binary) && (svoie[voie]->outptr == NULL) && (svoie[voie]->niv3 == XS_QUEUE)) { xmodem_fin (voie); svoie[voie]->niv3 = XS_END; } #ifdef ANCIEN if ((svoie[voie]->binary) && (fin_txmodem) && (svoie[voie]->niv3 == XS_END)) { traite_voie (voie); } #else if ((svoie[voie]->binary) && (fin_txmodem)) { traite_voie (voie); } #endif if ((!svoie[voie]->stop) && (svoie[voie]->seq)) { /* Recharge les bufs de sortie */ if (tot_mem > 10000L) traite_voie (voie); ff (); return (0); } if ((v_tell == 0) || (v_tell != voie) || ((v_tell) && (v_tell == voie))) { while ((!svoie[voie]->seq) && (inbuf_ok (voie))) { traite_voie (voie); if (svoie[voie]->seq) break; } } if ((svoie[voie]->binary) && (fin_rxmodem) && (svoie[voie]->niv3 == XR_RECV)) { svoie[voie]->xferok = 1; svoie[voie]->niv3 = XR_END; traite_voie (voie); } } #endif if (ch_stat) status (voie); ff (); return (0); } fbb-7.0.10/src/xmodem.c0000644000175000017500000007356413613360505011516 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE X, Y, ZMODEM */ #include #include #ifdef __linux__ #include #include #include #include #endif #ifdef __WINDOWS__ char *xmodem_str (int voie, char *s) { #define XMODLEN 44 static char stdesc[10][11] = { "SendInit ", "SendData ", "SendData ", "SendEof ", "RcvInit ", "RcvLabel ", "RcvData ", "RcvEnd ", "XmodmAbort", "ZsInit " }; static char xmod_name[4][5] = {"Xmod", "Xm1K", "Ymod", "Zmod"}; char taille[40]; int n; int niv = svoie[voie]->niv3; long offset = svoie[voie]->enrcur; if (offset < 0L) offset = 0L; *s = '\0'; if ((niv >= 0) && (niv < 10)) { if (svoie[voie]->tailm) { sprintf (taille, "/%ld", svoie[voie]->tailm); } else { *taille = '\0'; } sprintf (s, "%s:%s %s %ld%s", xmod_name[svoie[voie]->type_yapp], stdesc[niv], svoie[voie]->appendf, offset, taille); } return (s); } #else static void aff_xmodem (int ok) { #define XMODLEN 44 static char stdesc[10][11] = { "SendInit ", "SendData ", "SendData ", "SendEof ", "RcvInit ", "RcvLabel ", "RcvData ", "RcvEnd ", "XmodmAbort", "ZsInit " }; static char xmod_name[4][5] = {"Xmod", "Xm1K", "Ymod", "Zmod"}; char s[80]; char taille[40]; int n; int niv = pvoie->niv3; long offset = pvoie->enrcur; if (offset < 0L) offset = 0L; *s = '\0'; if (ok) { if ((niv >= 0) && (niv < 10)) { if (pvoie->tailm) { sprintf (taille, "/%ld", pvoie->tailm); } else { *taille = '\0'; } sprintf (s, "%s:%s %s %ld%s", xmod_name[pvoie->type_yapp], stdesc[niv], pvoie->appendf, offset, taille); } } for (n = strlen (s); n < XMODLEN; n++) s[n] = ' '; s[XMODLEN] = '\0'; aff_chaine (W_DEFL, 17, 3, s); } #endif void display_dsz_perf (int voie) { int save_voie; FILE *fptr; long lg_file; Ylist *temp; Ylist *yptr; char ligne[256]; selvoie (voie); cr (); pvoie->size_trans = 0L; fptr = fopen (svoie[voie]->ch_temp, "rt"); if (fptr == NULL) return; yptr = svoie[voie]->ytete; while (yptr) { char tmp1[80]; char tmp2[80]; char tmp3[80]; temp = yptr; strcpy (svoie[voie]->appendf, yptr->filename); fgets (ligne, sizeof (ligne), fptr); WinDebug ("Res -> %s\r\n", ligne); sscanf (ligne, "%s %s %s %s %s", tmp1, varx[0], tmp2, tmp3, varx[1]); lg_file = atol (varx[0]); pvoie->size_trans += lg_file; if (pvoie->kiss == -2) { save_voie = voiecur; selvoie (CONSOLE); texte (T_DOS + 5); selvoie (save_voie); } else texte (T_DOS + 5); yptr = yptr->next; m_libere (temp, sizeof (Ylist)); } svoie[voie]->ytete = NULL; fclose (fptr); unlink (svoie[voie]->ch_temp); sprintf (ligne, "%sDSZFIL.%d", MBINDIR, voiecur); unlink (ligne); } void xmodem_mode (int mode, int voie) { #ifdef __FBBDOS__ RSEGS rsegs; int port = no_port (voie); memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0e00 | (mode & 0xff); int14real (&rsegs); #endif } static void zmodem_tx_on (int voie, int type, int lg) { #ifdef __FBBDOS__ RSEGS rsegs; int port = no_port (voie); memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0e00 | ((type) ? 0x9 : 0x8); rsegs.CX = lg; int14real (&rsegs); #endif } void get_zrpos (int voie) { #ifdef __FBBDOS__ RSEGS rsegs; int port = no_port (voie); char str[80]; selvoie (voie); memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0e0a; rsegs.BX = 0x00; int14real (&rsegs); svoie[voie]->enrcur = (((long) rsegs.BX) << 16) | (((long) rsegs.AX) & 0xffff); if (svoie[voie]->enrcur) { sprintf (str, "ZRPOS to %ld\r", svoie[voie]->enrcur); aff_bas (voie, W_RCVT, str, strlen (str)); } clear_outbuf (voie); svoie[voie]->stop = 0; ch_niv3 (XS_SEND); xmodem (); #endif } static char *ymodem_header (int voie, long date, int *lg) { static char ybuf[128]; char *ptr; int len = 0; memset (ybuf, 0, 128); strcpy (ybuf, svoie[voie]->appendf); ptr = ybuf; while (*ptr) { ++ptr; ++len; } ++ptr; ++len; sprintf (ptr, "%ld %lo ", svoie[voie]->tailm, date); *lg = strlen (ptr) + len + 1; return (ybuf); } void libere_ymodem (int voie, int display) { Ylist *yptr, *temp; yptr = svoie[voie]->ytete; while (yptr) { temp = yptr; if ((display) && (yptr->ok == 1)) { svoie[voie]->size_trans = temp->size_trans; svoie[voie]->time_trans = temp->time_trans; strcpy (svoie[voie]->appendf, temp->filename); display_perf (voie); } yptr = yptr->next; m_libere (temp, sizeof (Ylist)); } svoie[voie]->ytete = NULL; } static int ymodem_files (void) { int nb = 0; Ylist *yptr; struct stat bufstat; libere_ymodem (voiecur, 0); yptr = pvoie->ytete; strtok (indd, " \r"); indd[40] = '\0'; if ((indd = strtok (NULL, " \r")) == NULL) { texte (T_ERR + 20); retour_appel (); return (0); } do { if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) != -1) && ((bufstat.st_mode & S_IFREG) != 0)) { if (yptr) { yptr->next = (Ylist *) m_alloue (sizeof (Ylist)); yptr = yptr->next; } else { pvoie->ytete = yptr = (Ylist *) m_alloue (sizeof (Ylist)); } n_cpy (255, yptr->filename, pvoie->appendf); ++nb; } else texte (T_ERR + 11); } while ((indd = strtok (NULL, " \r")) != NULL); yptr = pvoie->ytete; if (yptr) { *pvoie->appendf = '\0'; while (yptr) { strcat (pvoie->appendf, yptr->filename); yptr = yptr->next; if (yptr) strcat (pvoie->appendf, " "); } texte (T_YAP + 0); aff_etat ('E'); send_buf (voiecur); sleep_ (1); } else { retour_appel (); } return (nb); } static void zmodem_init (void) { static char zrqinit[25] = "rz\r**\030B00000000000000\r\n\021"; md_no_echo (voiecur); outs (zrqinit, strlen (zrqinit)); ch_niv3 (ZS_FILE); } static int zmodem_tx (int voie) { int lg; int retour = 0; struct stat bufstat; Ylist *yptr; char *ptr; yptr = svoie[voie]->ytete; while ((yptr) && (yptr->ok)) yptr = yptr->next; while ((retour == 0) && (yptr)) { indd = yptr->filename; if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) != -1) && ((bufstat.st_mode & S_IFREG) != 0)) { while (!modem_vide (voie)) ; sleep_ (1); pvoie->enrcur = -1L; pvoie->tailm = file_size (pvoie->sr_fic); set_binary (voiecur, 1); pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voie); ptr = ymodem_header (voie, bufstat.st_ctime, &lg); zmodem_tx_on (voie, (yptr->next != NULL), lg); outs (ptr, lg); svoie[voie]->stop = 0; ch_niv3 (XS_WAIT); retour = 1; } else { yptr->ok = -1; yptr = yptr->next; } } return (retour); } static int ymodem_tx (int voie) { int lg; int retour = 0; struct stat bufstat; Ylist *yptr; char *ptr; yptr = svoie[voie]->ytete; while ((yptr) && (yptr->ok)) yptr = yptr->next; while ((retour == 0) && (yptr)) { indd = yptr->filename; if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) != -1) && ((bufstat.st_mode & S_IFREG) != 0)) { while (!modem_vide (voie)) ; sleep_ (1); pvoie->enrcur = 0L; pvoie->tailm = file_size (pvoie->sr_fic); set_binary (voiecur, 1); pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voie); ptr = ymodem_header (voie, bufstat.st_ctime, &lg); ymodem_tx_on (voie, (yptr->next != NULL)); outs (ptr, 128); if (senddata (1)) { ch_niv3 (XS_QUEUE); } else ch_niv3 (XS_SEND); retour = 1; } else { yptr->ok = -1; yptr = yptr->next; } } return (retour); } #ifdef __FBBDOS__ static int xmodem_tx (int voie) { int retour = 0; struct stat bufstat; char *ptr; strtok (indd, " \r"); if ((indd = strtok (NULL, " \r")) == NULL) { texte (T_ERR + 20); retour_appel (); } else if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) != -1) && ((bufstat.st_mode & S_IFREG) != 0)) { texte (T_YAP + 0); aff_etat ('E'); send_buf (voie); while (!modem_vide (voie)) ; sleep_ (1); pvoie->enrcur = 0L; if ((ptr = strtok (NULL, " \r")) != NULL) pvoie->enrcur = atol (ptr); pvoie->tailm = file_size (pvoie->sr_fic); set_binary (voiecur, 1); pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voie); switch (pvoie->type_yapp) { case 0: xmodem_tx_on (voie); break; case 1: xmodem_tx_1k (voie); break; } if (senddata (1)) { ch_niv3 (XS_QUEUE); } else ch_niv3 (XS_SEND); retour = 1; } else { texte (T_ERR + 11); retour_appel (); } return (retour); } #endif static int xmodem_rx (int voie) { int fd; int retour = 0; struct stat bufstat; strtok (indd, " \r"); if (read_only ()) retour_appel (); else if ((indd = strtok (NULL, " \r")) == NULL) { texte (T_ERR + 20); retour_appel (); } else if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) == -1)) { fd = open (svoie[voie]->sr_fic, O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE); if (fd > 0) { close (fd); unlink (svoie[voie]->sr_fic); pvoie->ytete = (Ylist *) m_alloue (sizeof (Ylist)); n_cpy (255, pvoie->ytete->filename, pvoie->appendf); texte (T_YAP + 3); ch_niv3 (XR_LABL); del_temp (voie); pvoie->enrcur = 0L; pvoie->tailm = 0L; pvoie->size_trans = 0L; pvoie->time_trans = time (NULL); retour = 1; } else { texte (T_ERR + 30); retour_appel (); } } else { texte (T_ERR + 23); retour_appel (); } return (retour); } #define hex(d) ((d > '9') ? d-55 : d-48) static int gethex (void) { int val = 0; val = (int) (hex (*indd)) << 4; ++indd; val += (int) (hex (*indd)); ++indd; return (val); } static int ztyp_header (long *f) { long fl = 0L; int type = ZFERR; int i; while ((*indd) && (*indd != '*')) ++indd; if (*indd) { while (*indd == '*') ++indd; if (*indd == 24) ++indd; if (*indd == 'B') { ++indd; type = gethex (); for (i = 0; i < 4; i++) { fl <<= 8; fl += gethex (); } } } *f = fl; return (type); } #ifdef __linux__ void m_flush (int fd) { ioctl (fd, TCFLSH, TCOFLUSH); } void kill_rzsz (int voie) { if (svoie[voiecur]->rzsz_pid != -1) { kill (svoie[voie]->rzsz_pid, SIGTERM); } } static void sig_child (int sig) { int ret; int pid; int voie; int status; pid = wait (&status); ret = WEXITSTATUS (status); for (voie = 0; voie < NBVOIES; voie++) { if (svoie[voie]->rzsz_pid == pid) { svoie[voie]->rzsz_pid = -1; svoie[voie]->ask = 1; break; } } signal (SIGCHLD, sig_child); } int run_rzsz (int voie, char *cmde) { char *args[128]; struct termios tty; defcom *ptrcom = &p_com[(int)p_port[no_port (voie)].ccom]; int n; printf ("Commande = <%s>\n", cmde); set_binary (voie, 2); signal (SIGPIPE, SIG_IGN); signal (SIGCHLD, sig_child); /* Serial port in binary raw mode */ tcgetattr (ptrcom->comfd, &tty); tty.c_iflag &= ~(IGNBRK | IGNCR | INLCR | ICRNL | IUCLC | IXANY | IXON | IXOFF | INPCK | ISTRIP); tty.c_iflag |= (BRKINT | IGNPAR); tty.c_oflag &= ~OPOST; tty.c_lflag = ~(ICANON | ISIG | ECHO | ECHONL | ECHOE | ECHOK); tcsetattr (ptrcom->comfd, TCSANOW, &tty); /* pipe(svoie[voie]->to_xfbb); */ /* pipe(svoie[voie]->to_rzsz); */ switch (svoie[voie]->rzsz_pid = fork ()) { case -1: return (0); case 0: /* Child */ dup2 (ptrcom->comfd, 0); dup2 (ptrcom->comfd, 1); for (n = 1; n < NSIG; n++) signal (n, SIG_DFL); n = 0; args[n] = strtok (cmde, " "); while (args[n]) { if (n == 127) { args[n] = NULL; break; } args[++n] = strtok (NULL, " "); } (void) execvp (args[0], args); printf ("Exec %s failed\n", args[0]); exit (1); default: /* Parent */ break; } return (1); } #endif void xmodem (void) { long f; int ok = 1; int ncars; obuf *msgtemp; char *ptcur; char *ptr; Ylist *yptr; switch (pvoie->type_yapp) { case 0: var_cpy (0, "XMODEM"); break; case 1: var_cpy (0, "1K-XMODEM"); break; case 2: var_cpy (0, "YMODEM"); break; case 3: var_cpy (0, "ZMODEM"); break; } switch (pvoie->niv3) { case XS_EXTERN: /* Infos pour statistiques */ pvoie->time_trans = time (NULL) - pvoie->time_trans; pvoie->finf.download += (int) (pvoie->size_trans / 1024L); #ifdef __linux__ /* Attend le vidage de la queue */ set_binary (voiecur, 0); ioctl (p_com[(int)p_port[no_port (voiecur)].ccom].comfd, TCFLSH, 2); /* Reinitialise le port */ init_modem (no_port (voiecur)); clear_inbuf (voiecur); #else /* Reeinitialisation du modem */ #ifdef __WIN32__ { int val = 0; sta_drv (voiecur, SUSPCMD, &val); } #else init_modem (no_port (voiecur)); #endif #endif aff_header (voiecur); display_dsz_perf (voiecur); pvoie->finf.download += (int) (pvoie->size_trans / 1024L); retour_appel (); break; case XS_INIT: switch (pvoie->type_yapp) { case 0: case 1: #ifdef __linux__ if (BIOS (no_port (voiecur)) == P_LINUX) { if (ymodem_files ()) { /* Runs DSZ or equivalent */ char cmde[1024]; int ok_send = 0; if (pvoie->type_yapp == 0) sprintf (cmde, "fbb_zm sx "); else sprintf (cmde, "fbb_zm sx -k "); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, back2slash (nom_yapp ())); yptr = yptr->next; ok_send = 1; break; } /* Execute la commande en tache de fond */ ok = 0; if (ok_send) { pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); sleep (1); if (run_rzsz (voiecur, cmde)) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); ch_niv3 (XS_EXTERN); ok = 1; } } } } #endif #ifdef __WINDOWS__ if (BIOS (no_port (voiecur)) == P_WINDOWS) { #ifdef __WIN32__ if (ymodem_files ()) { /* Runs DSZ or equivalent */ char cmde[256]; int ok_send = 0; sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); if (pvoie->type_yapp == 0) sprintf (cmde, "sx -g %s", pvoie->ch_temp); else sprintf (cmde, "sx -k -g %s", pvoie->ch_temp); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, nom_yapp ()); yptr = yptr->next; ok_send = 1; break; /* Only 1 file with XModem */ } /* Execute la commande en tache de fond */ ok = 0; if (ok_send) { int val = 1; pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); // sta_drv(voiecur, SUSPCMD, &val); // sleep(1); if (run_rzsz (voiecur, cmde) == 0) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); /* pvoie->seq = 1; */ ch_niv3 (XS_EXTERN); ok = 1; } } } else ok = 0; #else if (ymodem_files ()) { /* Runs DSZ or equivalent */ char cmde[256]; int ok_send = 0; sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); if (pvoie->type_yapp == 0) wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on sx", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud); else wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on sx", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, nom_yapp ()); yptr = yptr->next; ok_send = 1; break; /* Only 1 file with XModem */ } /* Execute la commande en tache de fond */ if (ok_send) { closecom_windows (p_port[no_port (voiecur)].ccom); pvoie->sta.ack = 0; win_execute (cmde); ch_niv3 (XS_EXTERN); ok = 1; } else ok = 0; } else ok = 0; #endif } #endif #ifdef __FBBDOS__ ok = xmodem_tx (voiecur); #endif break; case 2: if (ymodem_files ()) { #ifdef __linux__ if (BIOS (no_port (voiecur)) == P_LINUX) { /* Runs DSZ or equivalent */ char cmde[1024]; int ok_send = 0; sprintf (cmde, "fbb_zm sb -k "); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, back2slash (nom_yapp ())); yptr = yptr->next; ok_send = 1; } /* Execute la commande en tache de fond */ ok = 0; if (ok_send) { pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); sleep (1); if (run_rzsz (voiecur, cmde)) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); /* pvoie->seq = 1; */ ch_niv3 (XS_EXTERN); ok = 1; } } } #endif #ifdef __WINDOWS__ if (BIOS (no_port (voiecur)) == P_WINDOWS) { #ifdef __WIN32__ /* Runs DSZ or equivalent */ char cmde[256]; int ok_send = 0; sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); sprintf (cmde, "sb -k -g %s", pvoie->ch_temp); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, nom_yapp ()); yptr = yptr->next; ok_send = 1; break; /* 1 file with YModem */ } /* Execute la commande en tache de fond */ ok = 0; if (ok_send) { int val = 1; pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); sta_drv (voiecur, SUSPCMD, &val); sleep (1); if (run_rzsz (voiecur, cmde) == 0) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); /* pvoie->seq = 1; */ ch_niv3 (XS_EXTERN); ok = 1; } } #else /* Runs DSZ or equivalent */ char cmde[256]; int ok_send = 0; wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on sb -k", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, nom_yapp ()); yptr = yptr->next; ok_send = 1; break; /* 1 file with YModem */ } /* Execute la commande en tache de fond */ if (ok_send) { char env[256]; closecom_windows (p_port[no_port (voiecur)].ccom); pvoie->sta.ack = 0; win_execute (cmde); ch_niv3 (XS_EXTERN); ok = 1; } else ok = 0; #endif } #endif #ifdef __FBBDOS__ ok = ymodem_tx (voiecur); #endif } else ok = 0; break; case 3: /* ZModem */ if (ymodem_files ()) { #ifdef __linux__ if (BIOS (no_port (voiecur)) == P_LINUX) { /* Runs DSZ or equivalent */ char cmde[1024]; int ok_send = 0; sprintf (cmde, "fbb_zm sz "); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, back2slash (nom_yapp ())); yptr = yptr->next; ok_send = 1; } /* Execute la commande en tache de fond */ ok = 0; if (ok_send) { pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); sleep (1); if (run_rzsz (voiecur, cmde)) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); /* pvoie->seq = 1; */ ch_niv3 (XS_EXTERN); ok = 1; } } } #endif #ifdef __WINDOWS__ if (BIOS (no_port (voiecur)) == P_WINDOWS) { #ifdef __WIN32__ /* Runs DSZ or equivalent */ char cmde[1024]; int val; int ok_send = 0; sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); sprintf (cmde, "sz -g %s", pvoie->ch_temp); yptr = svoie[voiecur]->ytete; while (yptr) { strcat (cmde, " "); indd = yptr->filename; strcat (cmde, nom_yapp ()); yptr = yptr->next; ok_send = 1; } /* Execute la commande en tache de fond */ ok = 0; if (ok_send) { pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); val = 1; sta_drv (voiecur, SUSPCMD, &val); sleep (1); if (run_rzsz (voiecur, cmde) == 0) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); /* pvoie->seq = 1; */ ch_niv3 (XS_EXTERN); ok = 1; } } #else /* Runs DSZ or equivalent */ char cmde[256]; char env[128]; char fil[128]; int ok_send = 0; FILE *fptr; sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); sprintf (env, "%sDSZFIL.%d", MBIN, voiecur); wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on sz -b -m -rr @%s", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud, env); yptr = svoie[voiecur]->ytete; fptr = fopen (env, "wt"); if (fptr == NULL) { ok = 0; break; } while (yptr) { /* strcat(cmde, " "); indd = yptr->filename; strcat(cmde, nom_yapp()); */ indd = yptr->filename; fputs (nom_yapp (), fptr); fputc ('\n', fptr); yptr = yptr->next, ok_send = 1; } fclose (fptr); /* Execute la commande en tache de fond */ if (ok_send) { closecom_windows (p_port[no_port (voiecur)].ccom); pvoie->sta.ack = 0; win_execute (cmde); ch_niv3 (XS_EXTERN); ok = 1; } else ok = 0; #endif } #endif #ifdef __FBBDOS__ { zmodem_init (); ok = 1; } #endif } else ok = 0; break; } break; case ZS_FILE: switch (ztyp_header (&f)) { case ZRINIT: zmodem_tx (voiecur); break; case ZCOMM: zmodem_init (); break; case ZRQINIT: break; default: ch_niv3 (XM_ABORT); xmodem (); ok = 0; break; } break; case XS_SEND: #ifdef __FBBDOS__ if (senddata (1)) { ch_niv3 (XS_QUEUE); } #endif break; case XS_WAIT: break; case XS_QUEUE: break; case XS_END: xmodem_off (voiecur); set_binary (voiecur, 0); aff_header (voiecur); pvoie->time_trans = time (NULL) - pvoie->time_trans; pvoie->finf.download += (int) (pvoie->size_trans / 1024L); if ((pvoie->type_yapp == 2) || (pvoie->type_yapp == 3)) { yptr = svoie[voiecur]->ytete; while ((yptr) && (yptr->ok)) yptr = yptr->next; if (pvoie->type_yapp == 3) pvoie->size_trans = pvoie->enrcur; yptr->time_trans = pvoie->time_trans; yptr->size_trans = pvoie->size_trans; if (yptr) { yptr->ok = 1; yptr = yptr->next; } if (yptr) { switch (pvoie->type_yapp) { case 2: ch_niv3 (XS_INIT); ok = ymodem_tx (voiecur); break; case 3: ok = zmodem_tx (voiecur); break; } } else { libere_ymodem (voiecur, 1); retour_appel (); ok = 0; } } else { display_perf (voiecur); retour_appel (); ok = 0; } break; case XR_EXTERN: /* Infos pour statistiques */ pvoie->time_trans = time (NULL) - pvoie->time_trans; #ifdef __linux__ /* Attend le vidage de la queue */ set_binary (voiecur, 0); ioctl (p_com[(int)p_port[no_port (voiecur)].ccom].comfd, TCFLSH, 2); /* Reinitialise le port */ init_modem (no_port (voiecur)); clear_inbuf (voiecur); #else /* Reeinitialisation du modem */ #ifdef __WIN32__ { int val = 0; sta_drv (voiecur, SUSPCMD, &val); } #else init_modem (no_port (voiecur)); #endif #endif /* Appel du filtre... */ if (test_temp (voiecur)) { rename_temp (voiecur, pvoie->sr_fic); wr_dir (pvoie->sr_fic, pvoie->sta.indicatif.call); pvoie->time_trans = time (NULL) - pvoie->time_trans; } aff_header (voiecur); display_dsz_perf (voiecur); retour_appel (); break; case XR_INIT: ok = xmodem_rx (voiecur); break; case XR_LABL: while ((*indd) && (!ISPRINT (*indd))) ++indd; w_label (pvoie->sr_fic, sup_ln (indd)); n_cpy (LABEL_NOM - 1, pvoie->label, sup_ln (indd)); texte (T_YAP + 1); aff_etat ('E'); send_buf (voiecur); while (!modem_vide (voiecur)) ; #ifdef __linux__ if (BIOS (no_port (voiecur)) == P_LINUX) { char cmde[256]; char temp[256]; temp_name (voiecur, temp); sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBINDIR, voiecur); switch (pvoie->type_yapp) { case 0: case 1: sprintf (cmde, "fbb_zm rx %s", temp); break; case 2: sprintf (cmde, "fbb_zm rb %s", temp); break; case 3: sprintf (cmde, "fbb_zm rz %s", temp); break; } pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); sleep (1); if (run_rzsz (voiecur, cmde)) { pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); ch_niv3 (XR_EXTERN); ok = 1; } else retour_dos (); } #endif #ifdef __WINDOWS__ if (BIOS (no_port (voiecur)) == P_WINDOWS) { #ifdef __WIN32__ char cmde[256]; char temp[256]; int ok_send = 0; temp_name (voiecur, temp); sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); switch (pvoie->type_yapp) { case 0: case 1: wsprintf (cmde, "rx %s -g %s", temp, pvoie->ch_temp); break; case 2: wsprintf (cmde, "rb %s -g %s", temp, pvoie->ch_temp); break; case 3: wsprintf (cmde, "rz %s -g %s", temp, pvoie->ch_temp); break; } /* Execute la commande en tache de fond */ pvoie->sta.ack = 0; /* Attend le vidage de la queue */ while (!modem_vide (voiecur)); { int val = 1; sta_drv (voiecur, SUSPCMD, &val); sleep (1); if (run_rzsz (voiecur, cmde) == 0) { /* pvoie->xferok = 1; pvoie->size_trans = 0L; pvoie->time_trans = 0L; prog_more (voiecur); */ /* pvoie->seq = 1; */ ch_niv3 (XR_EXTERN); } } #else char cmde[256]; char temp[256]; int ok_send = 0; temp_name (voiecur, temp); sprintf (pvoie->ch_temp, "%sDSZLOG.%d", MBIN, voiecur); switch (pvoie->type_yapp) { case 0: case 1: wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on rx %s", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud, temp); break; case 2: wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on rb %s", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud, temp); break; case 3: wsprintf (cmde, "DSZ.PIF %s %x %d speed %ld handshake on rz %s", pvoie->ch_temp, p_com[com].cbase, p_com[com].irq, p_com[com].baud, temp); break; } /* Execute la commande en tache de fond */ closecom_windows (p_port[no_port (voiecur)].ccom); pvoie->sta.ack = 0; win_execute (cmde); ch_niv3 (XR_EXTERN); #endif } #endif #ifdef __FBBDOS__ { sleep_ (1); set_binary (voiecur, 1); pvoie->xferok = 0; prog_more (voiecur); xmodem_rx_on (voiecur); ch_niv3 (XR_RECV); } #endif break; case XR_RECV: pvoie->size_trans += (long) nb_trait; pvoie->enrcur += (long) nb_trait; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue (sizeof (obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; ptr = data; while (nb_trait--) { ++pvoie->memoc; *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue (sizeof (obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } msgtemp->nb_car = ncars; if (pvoie->memoc > MAXMEM) { ok = write_mess_temp (O_BINARY, voiecur); } if (ok) { break; } /* Si erreur continue sur XR_END ! */ case XR_END: write_mess_temp (O_BINARY, voiecur); xmodem_off (voiecur); set_binary (voiecur, 0); if (test_temp (voiecur)) { rename_temp (voiecur, pvoie->sr_fic); wr_dir (pvoie->sr_fic, pvoie->sta.indicatif.call); pvoie->time_trans = time (NULL) - pvoie->time_trans; display_perf (voiecur); } else del_temp (voiecur); aff_header (voiecur); retour_appel (); ok = 0; break; case XM_ABORT: clear_outbuf (voiecur); xmodem_off (voiecur); set_binary (voiecur, 0); if (!pvoie->xferok) del_temp (voiecur); aff_header (voiecur); pvoie->finf.download += (int) (pvoie->size_trans / 1024L); retour_appel (); ok = 0; break; } #ifndef __WINDOWS__ aff_xmodem (ok); #endif } void modem (void) { switch (pvoie->niv2) { case 0: accueil_modem (); break; case 1: indic_modem (); break; case 2: passwd_modem (); break; case 3: passwd_change (); break; case 4: xmodem (); break; default: fbb_error (ERR_NIVEAU, "MODEM", pvoie->niv2); break; } } fbb-7.0.10/src/trajec.c0000644000175000017500000003530113613360505011460 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE TRAJECTOGRAPHIE */ #include /* * Constantes de la trajectographie satellite */ #ifndef PI #define PI 3.1415926535 #endif #define P0 0.017453292519 #define CC 2.997925e5 #define R0 6378.16 /* Rayon terrestre a l'equateur */ #define F 0.00335289187 #define F2 0.001676445935 /* f/2 */ #define G0 7.5369793e13 #define G1 1.0027379093 #define EPSILON 1e-8 /* parametres satellite */ static double i0; /* inclinaison plan orbite sur plan equateur */ static double a0; static double a8; static double a9; static double c1; static double c11; static double c12; static double c21; static double c22; static double c31; static double c32; static double c7; static double c8; static double c9; static double e0; static double e1; static double e2; static double e8; static double e9; static double f1; static double f9; static double g2; static double g3; static double h9; static double jjdeb; static double jjref; static double k; static double k0; static double k_prec; static double l5; static double l9; static double m0; static double m8; static double m9; static double n0; static double n8; static double o0; static double pas_var; static double q0; static double q3; static double r5; static double r8; static double r_doppler; static double s1; static double s7; static double s8; static double s9; static double t9; static double v1; static double w0; static double w5; static double w9; static double x9; static double x_sat; static double y9; static double y_sat; static double z9; static double z_sat; static double julien (double, int, int, int, int, int); static int arondi (double); static long julien_to_pc (double); static void calc1_trajec (void); static void calcul_page_trajec (int); static void calpas (void); static void entete_sat (char *); static void ligne_sat (int, int, int, int, double, long, long, int, int, int); static void load_param_satel (int entete); static void load_param_station (void); static void orbite_sat (double date_sat, long no); static void precal_trajec (void); static void resimp_trajec (void); static void satpos (void); static void satsta (void); static int arondi (double val) { if (val > 0.0) return ((int) (val + 0.5)); else return ((int) (val - 0.5)); } static double julien (double d3, int n3, int y3, int h3, int m3, int s3) { double j8; if (n3 == 0) n3 = 1; if (n3 < 3) { --y3; n3 += 12; } if (y3 < 80) y3 += 2000; else if (y3 < 100) y3 += 1900; j8 = floor ((double) y3 / 100.); j8 = floor (j8 / 4.) - j8 + floor (365.25 * (double) y3) + floor (30.6001 * (double) (n3 + 1)) + floor (d3) + 1720997.; j8 += (d3 - floor (d3) + (3600. * (double) h3 + 60. * (double) m3 + (double) s3) / 86400. + 2e-6); return (j8); } static long julien_to_pc (double jj) { /* Conversion jour julien en date systeme */ long tps_jul; tps_jul = (long) ((jj - 2440588.) * 86400.); return (tps_jul); } long date_to_pc (int d3, int n3, int y3, int h3, int m3, int s3) { return (julien_to_pc (julien ((double) d3, n3, y3, h3, m3, s3))); } /* * CALCULS TRAJECTOGRAPHIE */ static void init_trajec (void) { /* r6, r4 = sauvegardes des 2 dernieres distances pour calcul doppler */ pvoie->r6 = 0.0; pvoie->r4 = 0.0; pvoie->t_trajec = 0.0; } static void precal_trajec (void) { /* en entree : pvoie->tdeb, e0, i0, m0, k0 * en sortie : constantes g2, e2, e1, s1, c1, q0 * k_prec, pas_var */ double t2, r2; double y4; y4 = (double) (pvoie->tdeb.annee - 1); t2 = floor (y4 / 400.0) - floor (y4 / 100.0) + floor (365.25 * y4); t2 = (t2 - 693595.5) / 36525.0; r2 = 6.6460656 + 2400.051262 * t2 + 0.00002581 * t2 * t2; g2 = (r2 - (24.0 * (y4 - 1899.0))) / 24.0; e2 = 1.0 - e0 * e0; e1 = sqrt (e2); s1 = sin (i0 * P0); c1 = cos (i0 * P0); q0 = m0 / 360.0 + (double) k0; k_prec = 0L; /* orbite precedente pour affichage message de changement d'orbite */ pas_var = t9; /* pas de calcul variable en fonction de la visibilite */ } static void calc1_trajec (void) { /* en entree : n0, jjdeb, jjref, q3, e2, o0, c1, s1, k * en sortie : n8 = mouvement moyen corrige * a8 = demi grand axe corrige * o8 = raan corrige * m8, m9 = phase * c11, c12, c21, c22, c31, c32 = coef matrice passage * repere plan orbite a repere inertie celeste * c7, s7 = coef passage repere inertie celeste * a repere terrestre */ double u8, k2, o8, w8, s0, c0, s2, c2, gg7, q, temp; u8 = jjdeb + pvoie->t_trajec - jjref; n8 = n0 + q3 * u8; a8 = pow ((G0 / (n8 * n8)), 1.0 / 3.0); k2 = (9.95 * pow ((R0 / a8), 3.5) * u8) / (e2 * e2); o8 = o0 - k2 * c1; s0 = sin (o8 * P0); c0 = cos (o8 * P0); w8 = w0 + k2 * (2.5 * c1 * c1 - 0.5); s2 = sin (w8 * P0); c2 = cos (w8 * P0); c11 = c2 * c0 - s2 * s0 * c1; c12 = -s2 * c0 - c2 * s0 * c1; c21 = c2 * s0 + s2 * c0 * c1; c22 = c2 * c0 * c1 - s2 * s0; c31 = s2 * s1; c32 = c2 * s1; gg7 = (g3 + u8) * G1 + g2; /* calcul temps sideral */ gg7 = modf (gg7, &temp) * PI * 2.0; s7 = -sin (gg7); c7 = cos (gg7); /* calcul de la phase */ q = q0 + n8 * u8; k = (long) q; if (q < 0.) k--; m9 = (int) ((q - (double) k) * 256.0 + 0.5); m8 = (q - (double) k) * PI * 2.0; } static void satpos (void) { /* en entree : m8, e0, a8, e1 * en sortie : x_sat, y_sat, z_sat, r8 */ double e, s4, c4, r3, am5, x0, y0, x1, y1, z1; /* e = solution equation de Kepler. */ e = m8 + sin (m8) * e0 + 0.5 * e0 * e0 * sin (2.0 * m8); do { /* putchar('#') ; */ s4 = sin (e); c4 = cos (e); r3 = 1.0 - e0 * c4; am5 = e - e0 * s4 - m8; e -= am5 / r3; } while (fabs (am5) > EPSILON); /* Position satellite ds plan orbite */ x0 = a8 * (c4 - e0); y0 = a8 * e1 * s4; r8 = a8 * r3; /* Position du satellite ds repere inertie celeste */ x1 = x0 * c11 + y0 * c12; y1 = x0 * c21 + y0 * c22; z1 = x0 * c31 + y0 * c32; /* Position satellite ds repere terrestre */ x_sat = x1 * c7 - y1 * s7; y_sat = x1 * s7 + y1 * c7; z_sat = z1; } static void satsta (void) { /* en entree : x_sat, y_sat, z_sat, x9, y9, z9 * pas_var * f1, v1, pvoie->r4, pvoie->r6 * en sortie : r_doppler, pvoie->r4, pvoie->r6, f9 * r5, e9, a9, l5, w5 */ double x5, y5, z5, x8, y8, z8, s5, c5, b5; x5 = x_sat - x9; y5 = y_sat - y9; z5 = z_sat - z9; r5 = sqrt (x5 * x5 + y5 * y5 + z5 * z5); /* distance du satellite */ /* parametres doppler */ if (pvoie->t_trajec > t9) r_doppler = (pvoie->r4 - 4.0 * pvoie->r6 + 3.0 * r5) / pas_var / 172800.0; else r_doppler = 0.0; pvoie->r4 = pvoie->r6; pvoie->r6 = r5; f9 = -f1 * 1e6 * r_doppler / CC - 1000.0 * v1; /* Position satellite ds repere station */ x8 = z5 * c9 - x5 * c8 * s9 - y5 * s8 * s9; y8 = y5 * c8 - x5 * s8; z8 = x5 * c8 * c9 + y5 * s8 * c9 + z5 * s9; /* Calcul elevation et azimut antenne */ s5 = z8 / r5; c5 = sqrt (1.0 - s5 * s5); e9 = atan (s5 / c5) / P0; /* elevation */ w5 = -atan2 (y_sat, x_sat) / P0; /* longitude projection du satellite */ if (w5 < 0.0) w5 += 360.0; a9 = atan2 (y8, x8) / P0; /* azimut */ if (a9 < 0.0) a9 += 360.0; b5 = z_sat / r8; l5 = b5 / sqrt (1.0 - b5 * b5); l5 = atan (l5) / P0; /* latitude projection du satellite */ } static void resimp_trajec (void) { /* impression des resultats trajecto */ int min, h, m; long dist, alt; double i_part, dp; min = arondi (modf (jjdeb + pvoie->t_trajec, &i_part) * 1440.0); m = min % 60; h = min / 60; dp = f9 / 1000.0; alt = (long) (r8 - R0 + 0.5); dist = (long) (r5 + 0.5); ligne_sat (h, m, arondi (a9), arondi (e9), dp, dist, alt, arondi (w5), arondi (l5), m9); } static void calpas (void) { /* en entree : e9 - e8 < 0 * en sortie : pas_var (pas augmente si satellite non visible) */ if ((e9 - e8) < -60.0) pas_var = t9 * 4.0; else if (r_doppler >= 0.) pas_var = t9 * 6.0; else if ((e9 - e8) < -30.0) pas_var = t9 * 2.0; else pas_var = t9; } static void calcul_page_trajec (int entete) { char s[81]; int cpt_lig = 0; int nb_lig = 0; pvoie->lignes = -1; load_param_satel (entete); load_param_station (); precal_trajec (); nb_lig = pvoie->finf.nbl; if (nb_lig > MAXLIGNES) nb_lig = MAXLIGNES; if (entete) nb_lig -= 5; else nb_lig -= 1; if (nb_lig <= 4) nb_lig = 4; /* Boucle de calcul */ do { calc1_trajec (); satpos (); satsta (); sprintf (s, "Traj : %s", strheure (julien_to_pc (jjdeb + pvoie->t_trajec))); aff_chaine (W_DEFL, 69, 3, s); if (e9 >= e8) { /* changement d'orbite ? */ if (k != k_prec) { orbite_sat (jjdeb + pvoie->t_trajec, k); k_prec = k; cpt_lig++; } /* satellite en visibilite */ resimp_trajec (); cpt_lig++; pas_var = t9; } else { /* satellite non visible */ if (t9 < 0.007) calpas (); /* pas de calcul < 10mn */ } pvoie->t_trajec += pas_var; if (trait_time > 15) { outln ("No visibility ...", 17); break; } } while (cpt_lig < nb_lig); aff_chaine (W_DEFL, 69, 3, " "); } static void ligne_sat (int h, int m, int az, int el, double dp, long dist, long alt, int lon, int lat, int ph) { sprintf (varx[0], "%02d", h); sprintf (varx[1], "%02d", m); sprintf (varx[2], "%3d", az); sprintf (varx[3], "%3d", el); sprintf (varx[4], "%4.1f", dp); sprintf (varx[5], "%5ld", dist); sprintf (varx[6], "%5ld", alt); sprintf (varx[7], "%3d", lon); sprintf (varx[8], "%3d", lat); sprintf (varx[9], "%3d", ph); texte (T_TRJ + 8); } static void entete_sat (char *satellite) { if (*(pvoie->finf.qra) == '?') var_cpy (0, qra_locator); else var_cpy (0, pvoie->finf.qra); var_cpy (1, satellite); texte (T_TRJ + 3); texte (T_TRJ + 4); texte (T_TRJ + 5); texte (T_TRJ + 6); } static void orbite_sat (double date_sat, long no) { ptmes->date = julien_to_pc (date_sat); sprintf (varx[0], "%5ld", no); texte (T_TRJ + 7); } void trajecto (void) { char c; int i, jour; FILE *fptr; switch (pvoie->niv3) { case 0: if ((i = selection_sat ()) == -1) break; fptr = ouvre_sat (); pvoie->enrcur = (long) sizeof (satel) * (long) i; fflush (fptr); if ((i < 0) || (pvoie->enrcur >= filelength (fileno (fptr)))) { ferme (fptr, 23); texte (T_ERR + 0); menu_sat (); } else { ferme (fptr, 24); texte (T_TRJ + 9); maj_niv (pvoie->niv1, pvoie->niv2, 2); } break; case 2: if (test_date (indd)) { sscanf (indd, "%d %d %d", &jour, &(pvoie->tdeb.mois), &(pvoie->tdeb.annee)); pvoie->tdeb.jour = (double) jour; if (pvoie->tdeb.annee < 80) pvoie->tdeb.annee += 2000; else if (pvoie->tdeb.annee < 100) pvoie->tdeb.annee += 1900; texte (T_TRJ + 10); maj_niv (pvoie->niv1, pvoie->niv2, 3); } else { texte (T_ERR + 0); texte (T_TRJ + 9); } break; case 3: if (test_heure (indd)) { sscanf (indd, "%d %d", &(pvoie->tdeb.heure), &(pvoie->tdeb.mn)); texte (T_TRJ + 11); /* prog_more(voiecur) ; */ aff_etat ('T'); pvoie->tdeb.sec = 0; if (min_ok (voiecur)) { aff_etat ('E'); send_buf (voiecur); } init_trajec (); calcul_page_trajec (1); texte (T_TRT + 11); maj_niv (pvoie->niv1, pvoie->niv2, 4); } else { texte (T_ERR + 0); texte (T_TRJ + 10); } break; case 4: c = toupper (*indd); if ((c == 'A') || (c == Non)) { incindd (); maj_niv (pvoie->niv1, 0, 0); menu_trajec (); } else { calcul_page_trajec (0); texte (T_TRT + 11); } break; default: fbb_error (ERR_NIVEAU, "COMP-TRAJ", pvoie->niv3); break; } } void menu_trajec (void) { int error = 0; char com[80]; limite_commande (); sup_ln (indd); while (*indd && (!ISGRAPH (*indd))) indd++; strn_cpy (70, com, indd); switch (toupper (*indd)) { case 'T': maj_niv (6, 1, 0); incindd (); trajecto (); break; case 'P': maj_niv (6, 2, 0); incindd (); param_satel (); break; case 'C': maj_niv (6, 3, 0); incindd (); carac_satel (); break; case 'M': if (droits (MODLABEL)) { maj_niv (6, 9, 0); incindd (); modif_satel (); } else { error = 1; } break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; case 'F': maj_niv (0, 1, 0); incindd (); choix (); break; case '\0': prompt (pvoie->finf.flags, pvoie->niv1); break; default: if (!defaut ()) error = 1; break; } if (error) { cmd_err (indd); } } static void load_param_satel (int entete) { /* recupere caracteristiques satellite ds fichier * en sortie : i0, o0, e0, w0, a0, n0, q3, k0, f1, v1, * t9, g3, jjref, jjdeb */ satel bufsat; lit_sat (&bufsat); i0 = bufsat.i0; o0 = bufsat.o0; e0 = bufsat.e0; w0 = bufsat.w0; m0 = bufsat.m0; a0 = bufsat.a0; n0 = bufsat.n0; q3 = bufsat.q3; k0 = bufsat.k0; f1 = bufsat.f1; v1 = bufsat.v1; t9 = ((double) bufsat.pas) / 1440.0; if (a0 != 0.0) n0 = sqrt (G0 / (a0 * a0 * a0)); else if (n0 != 0.0) a0 = pow ((G0 / (n0 * n0)), 1. / 3.); /* date references orbitales */ g3 = bufsat.d3; jjref = julien (g3, 0, bufsat.y3, 0, 0, 0); /* date debut de calcul */ jjdeb = julien (pvoie->tdeb.jour, pvoie->tdeb.mois, pvoie->tdeb.annee, pvoie->tdeb.heure, pvoie->tdeb.mn, pvoie->tdeb.sec); if (entete) entete_sat (bufsat.dd); } static void load_param_station (void) { /* en sortie : l9, w9, e8, s9, c9, s8, c8, x9, y9, z9 */ double ll8, r9, l8; /* recuperer QRA locator ds fichier */ /* l9 = 43.657 ; w9 = -1.505 ; */ if (*(pvoie->finf.qra) == '?') lonlat (qra_locator, &w9, &l9); else lonlat (pvoie->finf.qra, &w9, &l9); h9 = 180.0; /* Altitude */ e8 = -5.0; /* Elevation minimale */ /* coord. station ds repere terrestre */ ll8 = l9 * P0; s9 = sin (ll8); c9 = cos (ll8); s8 = sin (-w9 * P0); c8 = cos (w9 * P0); r9 = R0 * (1.0 - F2 + F2 * cos (2.0 * ll8)) + h9 / 1000.0; l8 = atan ((1.0 - F) * (1.0 - F) * s9 / c9); x9 = r9 * cos (l8) * c8; y9 = r9 * cos (l8) * s8; z9 = r9 * sin (l8); } fbb-7.0.10/src/wp_mess.c0000644000175000017500000001017513613360505011667 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Generation des messages WP vers le reseau. * * Les routes a generer sont definies dans INIT.SRV * */ #include static int copy_lines (int fd_orig, int fd_dest) { #define TAIBUF 5000 int nb_lus; char c; char *buffer; buffer = m_alloue (TAIBUF); nb_lus = read (fd_orig, buffer, TAIBUF); if (nb_lus > 0) write (fd_dest, buffer, nb_lus); if (nb_lus == TAIBUF) { /* Termine la ligne en cours */ do { if (read (fd_orig, &c, 1) > 0) { write (fd_dest, &c, 1); ++nb_lus; } else break; } while (c != '\n'); } m_libere (buffer, TAIBUF); return (nb_lus); } void send_wp_mess (void) { int fd_orig; int fd_dest; int sav_voie = voiecur; int sav_lang = vlang; int mess; char route[80]; char *ptr; char *scan; FILE *fptr; #ifndef R_OK #define R_OK 004 #define W_OK 002 #endif if (access (d_disque ("WP\\MESS.WP"), R_OK | W_OK) == -1) return; if (voiecur == MWARNING) return; /* Deja en warning */ if (*wp_line == '\0') { unlink (d_disque ("WP\\MESS.WP")); return; } if ((fd_orig = open (d_disque ("WP\\MESS.WP"), O_RDONLY | O_BINARY)) == EOF) { return; } /* On ouvre le fichier MAIL.IN */ fptr = fappend (MAILIN, "b"); if (fptr == NULL) return; selvoie (MWARNING); if (FOR (svoie[sav_voie]->mode)) pvoie->mode |= F_FOR; status (voiecur); mess = 0; for (;;) { #if defined(__WINDOWS__) || defined(__linux__) char txt[80]; #endif int nb; int fd; /* Boucle sur des messages de 5K Max */ if ((fd_dest = open ("TEMP.WP", O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE)) == EOF) { close (fd_orig); break; } nb = copy_lines (fd_orig, fd_dest); close (fd_dest); #if defined(__WINDOWS__) || defined(__linux__) wsprintf (txt, "Preparing Message #%d", ++mess); InfoMessage (-1, txt, "WP-Messages"); #endif if (nb <= 0) { close (fd_orig); break; } scan = wp_line; while ((*scan) && !(ISGRAPH (*scan))) ++scan; ptr = route; while ((*scan) && (ISGRAPH (*scan))) *ptr++ = *scan++; *ptr++ = '\0'; /* On ouvre le fichier tout neuf pour le copier ... */ fd = open ("TEMP.WP", O_RDONLY | O_BINARY); while ((fd != -1) && (*route)) { #if defined(__WINDOWS__) || defined(__linux__) wsprintf (txt, "Creating Message #%d (%s)", mess, route); InfoMessage (-1, txt, NULL); #endif /* Genere le message via route ... */ fprintf (fptr, "#\r\nS%c WP @ %s < %s\r\nWP Update\r\n", find (bbs_via (route)) ? 'P' : 'B', route, mycall); fflush (fptr); /* On remet a zero pour la nouvelle copie ... */ lseek (fd, 0L, SEEK_SET); fflush (fptr); copy_fic (fd, fileno (fptr), NULL); fflush (fptr); fprintf (fptr, "\r\n/EX\r\n"); fflush (fptr); while ((*scan) && !(ISGRAPH (*scan))) ++scan; ptr = route; while ((*scan) && (ISGRAPH (*scan))) *ptr++ = *scan++; *ptr++ = '\0'; } close (fd); } /* On ferme le MAIL.IN */ fclose (fptr); #if defined(__WINDOWS__) || defined(__linux__) InfoMessage (-1, "Delete MESS.WP file", NULL); #endif unlink (d_disque ("WP\\MESS.WP")); unlink ("TEMP.WP"); selvoie (sav_voie); vlang = sav_lang; #if defined(__WINDOWS__) || defined(__linux__) InfoMessage (-1, NULL, NULL); #endif } fbb-7.0.10/src/console.c0000644000175000017500000007415513615603431011664 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Gestion de la console */ #include static int dde_cnx = 0; static int dde_trait = 0; int connect_console (void) { Svoie *vptr = svoie[CONSOLE]; if (vptr->sta.connect) { #ifdef ENGLISH cprintf ("Can't connect ! Console channel is busy. \r\n"); #else cprintf ("Connexion Impossible. Voie Console occup‚e.\r\n"); #endif return (0); } init_etat (); selvoie (CONSOLE); /* F2 = Connexion */ if (arret) vptr->dde_marche = TRUE; else vptr->dde_marche = FALSE; vptr->timout = time_n; init_timout (CONSOLE); /* lastaff = -1 ; */ vptr->aut_linked = 1; vptr->private_dir = 0; vptr->read_only = 0; vptr->vdisk = 2; vptr->log = 1; vptr->deconnect = FALSE; vptr->tstat = vptr->debut = time (NULL); maj_niv (0, 0, 0); vptr->tmach = 0L; vptr->nb_err = vptr->seq = vptr->stop = vptr->sr_mem = 0; vptr->maj_ok = 0; vptr->rev_param = 0; vptr->ch_mon = vptr->cross_connect = -1; vptr->msg_held = 0; vptr->binary = vptr->conf = 0; vptr->mess_recu = vptr->xferok = 1; vptr->mbl = 1; vptr->entmes.numero = 0L; vptr->entmes.theme = 0; strn_cpy (6, vptr->sta.indicatif.call, cons_call.call); vptr->sta.indicatif.num = cons_call.num; vptr->r_tete = NULL; vptr->mbl_ext = 1; vptr->prot_fwd = FWD_MBL; vptr->nb_egal = 0; *vptr->passwd = '\0'; console_on (); aff_event (CONSOLE, 1); vptr->sta.stat = vptr->sta.connect = 16; curseur (); clear_inbuf (CONSOLE); connexion (voiecur); new_om = nouveau (voiecur); /* pvoie->finf.nbl = 16 ; */ /* vptr->mode = vptr->finf.flags ; */ vptr->mode = 0; vptr->l_mess = 0L; vptr->l_yapp = 0L; if (fbb_fwd) { vptr->mode |= F_NFW; if (bin_fwd) vptr->mode |= F_BIN; } /* mbl[CONSOLE] = TRUE ; */ /* cprintf("Connecte\r\n") ; */ change_droits (voiecur); strcpy (vptr->dos_path, "\\"); aff_nbsta (); fbb_log (CONSOLE, 'C', "@ CONSOL"); dde_cnx = 1; return (TRUE); } void console_inbuf (char *data, int len) { in_buf (CONSOLE, data, len); dde_trait = 1; } void justifie (uchar *buffer) { uchar ligne[83]; uchar *ptr, *ptri, *ptro; int nb_sp = 0; int nb_mot = 1; int nb_car = 0; int k, sp_int, sp_rst, i_sp, j_sp, k_sp, ds_mot, nb_int; df ("justifie", 2); ptri = buffer; ptro = ligne; while ((*ptri) && (*ptri == ' ')) { ++nb_car; *ptro++ = *ptri++; } if (*ptri) { ptr = ptri; ds_mot = TRUE; while (*ptr) { ++nb_car; if (*ptr == ' ') { ++nb_sp; if (ds_mot) { ds_mot = FALSE; nb_mot++; } } else ds_mot = TRUE; ++ptr; } if (nb_mot > 1) { nb_int = nb_mot - 1; /* nb_sp += (80 - nb_car) ; */ nb_sp += (78 - nb_car); sp_int = nb_sp / nb_int; sp_rst = nb_sp % nb_int; if (sp_rst > (nb_int / 2)) { k_sp = FALSE; sp_rst = nb_int - sp_rst; i_sp = (sp_rst % 2) ? nb_int / (sp_rst + 1) : nb_int / sp_rst; } else { k_sp = TRUE; if (sp_rst) i_sp = (sp_rst % 2) ? nb_int / (sp_rst + 1) : nb_int / sp_rst; else i_sp = 0; } j_sp = 0; while (*ptri) { if (*ptri == '\r') break; if ((just) && (*ptri == ' ')) { for (k = 0; k < sp_int; k++) *ptro++ = ' '; while (*++ptri == ' ') ; if (k_sp) { if (sp_rst) { if (++j_sp == i_sp) { *ptro++ = ' '; j_sp = 0; sp_rst--; } } } else { if (sp_rst) { if (++j_sp != i_sp) { *ptro++ = ' '; } else { j_sp = 0; sp_rst--; } } else { *ptro++ = ' '; } } } else *ptro++ = *ptri++; } *ptro = '\0'; if (!just) { nb_car = strlen (ligne); while (nb_car++ < 78) { } } /* *ptro++ = '\r'; */ *ptro = '\0'; ptr = ligne; while ((*buffer++ = *ptr++) != '\0'); } } ff (); } int kb_vide (void) { return 1; } void curseur (void) { } void connect_fen (void) { } void winputs (int voie, int attr, char *ptr) { int val; int header; if (attr == -1) { attr = W_CHNI; header = 1; } else header = 0; val = (attr & 8) ? 255 : 127; window_write (voie, ptr, strlen (ptr), attr, header); } void put_nr (uchar *texte, int attr, int nbcar) { uchar chaine[400]; uchar *ptr = chaine; uchar *scan = texte; uchar ch; int i, nb, pcode, txt = 0; if (nbcar > 256) nbcar = 256; texte[nbcar] = '\0'; if ((*scan != 0xff) && (*scan != 0xfe)) { strcpy (ptr, "(NRom: "); ptr += 7; for (i = 0; i < 6; i++) *ptr++ = (*scan++ >> 1); while (*(ptr - 1) == ' ') --ptr; *ptr++ = '-'; ch = (*scan++ >> 1) | 0x30; if (ch > '9') { *ptr++ = '1'; ch -= 10; } *ptr++ = ch; *ptr++ = ' '; for (i = 0; i < 6; i++) *ptr++ = (*scan++ >> 1); while (*(ptr - 1) == ' ') --ptr; *ptr++ = '-'; ch = (*scan++ >> 1) | 0x30; if (ch > '9') { *ptr++ = '1'; ch -= 10; } *ptr++ = ch; *ptr++ = ' '; itoa ((int) (*scan++), ptr, 10); while (*ptr) { ++ptr; } *ptr++ = ' '; itoa ((int) (*scan++), ptr, 10); while (*ptr) { ++ptr; } *ptr++ = ' '; itoa ((int) (*scan++), ptr, 10); while (*ptr) { ++ptr; } *ptr++ = ' '; scan += 2; pcode = (int) (*scan++) & 0xf; switch (pcode) { case 0: *ptr++ = 'I'; *ptr++ = 'P'; txt = 20; break; case 1: *ptr++ = 'C'; *ptr++ = ' '; ++scan; for (i = 0; i < 6; i++) *ptr++ = (*scan++ >> 1); while (*(ptr - 1) == ' ') --ptr; *ptr++ = '-'; ch = (*scan++ >> 1) | 0x30; if (ch > '9') { *ptr++ = '1'; ch -= 10; } *ptr++ = ch; *ptr++ = ' '; for (i = 0; i < 6; i++) *ptr++ = (*scan++ >> 1); while (*(ptr - 1) == ' ') --ptr; *ptr++ = '-'; ch = (*scan++ >> 1) | 0x30; if (ch > '9') { *ptr++ = '1'; ch -= 10; } *ptr++ = ch; txt = 0; break; case 2: *ptr++ = 'C'; *ptr++ = ' '; *ptr++ = 'A'; *ptr++ = 'K'; txt = 0; break; case 3: *ptr++ = 'D'; txt = 0; break; case 4: *ptr++ = 'D'; *ptr++ = ' '; *ptr++ = 'A'; *ptr++ = 'K'; txt = 0; break; case 5: *ptr++ = 'I'; txt = 20; break; case 6: *ptr++ = 'I'; *ptr++ = ' '; *ptr++ = 'A'; *ptr++ = 'K'; txt = 0; break; default: return; } *ptr++ = ')'; *ptr = '\0'; put_ui (chaine, attr, strlen (chaine)); if (txt > 0) { scan = texte + txt; put_ui (scan, attr, nbcar - txt); } } else { scan = texte + 7; nbcar -= 7; nb = 0; ptr = chaine; while (nbcar > 0) { for (i = 0; i < 6; i++) *ptr++ = (*scan++ >> 1); *ptr++ = '-'; ch = (*scan++ >> 1) | 0x30; if (ch > '9') { *ptr++ = '1'; ch -= 10; } else *ptr++ = ' '; *ptr++ = ch; *ptr++ = ':'; for (i = 0; i < 6; i++) *ptr++ = *scan++; *ptr++ = ' '; *ptr++ = '-'; *ptr++ = '>'; *ptr++ = ' '; for (i = 0; i < 6; i++) *ptr++ = (*scan++ >> 1); *ptr++ = '-'; ch = (*scan++ >> 1) | 0x30; if (ch > '9') { *ptr++ = '1'; ch -= 10; } else *ptr++ = ' '; *ptr++ = ch; *ptr++ = ' '; sprintf (ptr, "%3d ", (int) (*scan++)); /* itoa((int)(*scan++), ptr, 10) ; */ while (*ptr) ++ptr; if (++nb == 2) { *ptr = '\0'; put_ui (chaine, attr, strlen (chaine)); ptr = chaine; /* *ptr++ = '\r' ; */ nb = 0; } else { *ptr++ = ' '; *ptr++ = ' '; *ptr++ = ' '; } nbcar -= 21; } } } int put_ui (uchar *texte, int attr, int nb) { uchar buf[600]; uchar *ptr = buf; uchar c; int pos = 0; deb_io (); /* Commence toujours par un cr */ c = '\r'; ++nb; while (nb--) { /* Le dernier CR n'est pas pris en compte */ if ((nb == 0) && (c == '\r')) break; if (c == '\r') { *ptr++ = c; *ptr = '\0'; window_write (MMONITOR, buf, strlen (buf), attr, 0); ptr = buf; pos = 0; } else { if (++pos == 80) { *ptr++ = '\r'; *ptr = '\0'; window_write (MMONITOR, buf, strlen (buf), attr, 0); ptr = buf; pos = 0; } if (c >= ' ') { *ptr++ = c; } else { *ptr++ = c + '@'; } } c = *texte++; } *ptr = '\0'; window_write (MMONITOR, buf, strlen (buf), attr, 0); return (1); } int attend_caractere (int secondes) { return (0); } int forwarding_bbs (int nobbs) { int port; Forward *pfwd; for (port = 0; port < NBPORT; port++) { if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { if (pfwd->no_bbs == nobbs) return (1); pfwd = pfwd->suite; } } } return (0); } static int is_nb(char *ptr) { int val = isdigit (*ptr); while (*ptr) { if (!ISGRAPH (*ptr)) break; if (!isdigit(*ptr)) val = 0; ++ptr; } return val; } int val_fwd (char *bbs, int *port_fwd, int reverse) { Forward *pfwd; int i, port, noport; int nobbs; strupr (sup_ln (bbs)); /* if ((isdigit (*bbs)) && (!ISGRAPH (*(bbs + 1)))) */ if (is_nb(bbs)) { /* *port_fwd = noport = *bbs - '0'; */ *port_fwd = noport = atoi(bbs); if (noport == 0) { /* Lance le forward sur tous les ports */ *bbs = '\0'; for (port = 0; port < NBPORT; port++) { if (p_port[port].pvalid) { for (i = 0; i < NBMASK; i++) p_port[port].fwd[i] = '\0'; pfwd = p_port[port].listfwd; while (pfwd) { if ((pfwd->forward == 0) && (ch_voie (port, 0) != -1)) { *pfwd->fwdbbs = '\0'; pfwd->forward = -1; pfwd->fwdpos = 0; pfwd->fin_fwd = pfwd->cptif = pfwd->fwdlig = 0; pfwd->reverse = reverse; } pfwd = pfwd->suite; } } } } else if (noport > 0) { /* Selectionne un port */ *bbs = '\0'; if (p_port[noport].pvalid) { for (i = 0; i < NBMASK; i++) p_port[noport].fwd[i] = '\0'; pfwd = p_port[noport].listfwd; while (pfwd) { if ((pfwd->forward == 0) && (ch_voie (noport, 0) != -1)) { *pfwd->fwdbbs = '\0'; pfwd->forward = -1; pfwd->fwdpos = 0; pfwd->fin_fwd = pfwd->cptif = pfwd->fwdlig = 0; pfwd->reverse = reverse; } pfwd = pfwd->suite; } } } } else { nobbs = num_bbs (bbs); if (nobbs) { /* Selectionne une BBS */ if ((chercher_voie (bbs) == -1) && !forwarding_bbs (nobbs)) { if ((port = what_port (nobbs)) != -1) { *port_fwd = port; pfwd = p_port[port].listfwd; while (pfwd) { if ((pfwd->forward == 0) && (ch_voie (port, 0) != -1)) { strn_cpy (6, pfwd->fwdbbs, bbs); clr_bit_fwd (p_port[port].fwd, nobbs); pfwd->forward = -1; pfwd->fwdpos = 0; pfwd->fin_fwd = pfwd->cptif = pfwd->fwdlig = 0; pfwd->reverse = reverse; break; } pfwd = pfwd->suite; } if (pfwd == NULL) noport = -1; else noport = port; } else noport = -2; } else noport = -4; } else noport = -3; } return (noport); } int traite_console () { df ("traite_console", 0); if (dde_cnx) { dde_cnx = 0; ff (); return (1); } if (dde_trait) { dde_trait = 0; ff (); return (1); } ff (); return (0); } void free_use (void) { FbbMem (0); } int aff_etat (int lettre) { int prec; char s[20]; df ("aff_etat", 1); prec = let_prec; if (lettre != let_prec) { let_prec = lettre; switch (lettre) { #ifdef ENGLISH case 'A': sprintf (s, "Idle "); break; case 'B': sprintf (s, "Beacon "); break; case 'C': sprintf (s, "Cron "); break; case 'D': sprintf (s, "Disconn"); break; case 'E': sprintf (s, "Sending"); break; case 'F': sprintf (s, "Forward"); break; case 'G': sprintf (s, "F_send "); break; case 'I': sprintf (s, "Import "); break; case 'J': sprintf (s, "Export "); break; case 'K': sprintf (s, "WaitAck"); break; case 'L': sprintf (s, "Reading"); break; case 'M': sprintf (s, "Unproto"); break; case 'N': sprintf (s, "Inbuf "); break; case 'O': sprintf (s, ">%-6ld", ptmes->numero); let_prec = 'A'; break; case 'R': sprintf (s, "Receive"); break; case 'S': sprintf (s, "Saving "); break; case 'T': sprintf (s, "Process"); break; case 'W': sprintf (s, "H-Route"); break; case 'X': sprintf (s, "WP-Upd "); break; case 'Y': sprintf (s, "Kernel "); break; case 'Z': sprintf (s, "W-Share"); break; #else case 'A': sprintf (s, "Attend "); break; case 'B': sprintf (s, "Balise "); break; case 'C': sprintf (s, "Cron "); break; case 'D': sprintf (s, "D‚conn."); break; case 'E': sprintf (s, "Envoie "); break; case 'F': sprintf (s, "Forward"); break; case 'G': sprintf (s, "F_env "); break; case 'I': sprintf (s, "Import "); break; case 'J': sprintf (s, "Export "); break; case 'K': sprintf (s, "Att.Ack"); break; case 'L': sprintf (s, "LitTnc "); break; case 'M': sprintf (s, "Monitor"); break; case 'N': sprintf (s, "Inbuf "); break; case 'O': sprintf (s, ">%-6ld", ptmes->numero); let_prec = 'A'; break; case 'R': sprintf (s, "Recoit "); break; case 'S': sprintf (s, "Sauve "); break; case 'T': sprintf (s, "Traite "); break; case 'W': sprintf (s, "H-Route"); break; case 'X': sprintf (s, "MAJ-WP "); break; case 'Y': sprintf (s, "Kernel "); break; case 'Z': sprintf (s, "W-Share"); break; #endif } win_status (s); } ff (); return (prec); } void aff_msg_cons () { unsigned num_indic; ind_noeud *noeud; int priv = -1; int hold = -1; noeud = insnoeud (cons_call.call, &num_indic); if (noeud->nbnew != msg_cons) priv = msg_cons = noeud->nbnew; if (nb_hold != hold_cons) hold = hold_cons = nb_hold; win_msg_cons (priv, hold); } enum meminfo_row { meminfo_main = 0, meminfo_swap }; enum meminfo_col { meminfo_total = 0, meminfo_used, meminfo_free, meminfo_shared, meminfo_buffers, meminfo_cached }; /* Code from linuxnode */ #define MEMINFO_FILE "/proc/meminfo" static char buf[1000]; #define MAX_ROW 3 /* these are a little liberal for flexibility */ #define MAX_COL 7 unsigned **meminfo (void) { static unsigned *row[MAX_ROW + 1]; /* row pointers */ static unsigned num[MAX_ROW * MAX_COL]; /* number storage */ char *p; int i, j, k, l; static int n, fd = -1; if (fd == -1 && (fd = open (MEMINFO_FILE, O_RDONLY)) == -1) { /* node_perror(FILE, errno); */ close (fd); return 0; } lseek (fd, 0L, SEEK_SET); if ((n = read (fd, buf, sizeof buf - 1)) < 0) { close (fd); fd = -1; return 0; } buf[n] = '\0'; if (!row[0]) /* init ptrs 1st time through */ for (i = 0; i < MAX_ROW; i++) /* std column major order: */ row[i] = num + MAX_COL * i; p = buf; for (i = 0; i < MAX_ROW; i++) /* zero unassigned fields */ for (j = 0; j < MAX_COL; j++) row[i][j] = 0; if (!strncmp("MemTotal:", p, 8)) { /* printf("Asuming 2.6 Kernel\n"); */ while (*p && !isdigit(*p)) p++; l = sscanf(p, "%u%n", &row[meminfo_main][meminfo_total], &k); p += k; while (*p && !strncmp("MemFree:", p, 8)) p++; while (*p && !isdigit(*p)) p++; l = sscanf(p, "%u%n", &row[meminfo_main][meminfo_free], &k); p += k; while (*p && !strncmp("Buffers:", p, 8)) p++; while (*p && !isdigit(*p)) p++; l = sscanf(p, "%u%n", &row[meminfo_main][meminfo_buffers], &k); p += k; while (*p && !strncmp("Cached:", p, 7)) p++; while (*p && !isdigit(*p)) p++; l = sscanf(p, "%u%n", &row[meminfo_main][meminfo_cached], &k); p += k; while (*p && !strncmp("SwapFree:", p, 9)) p++; while (*p && !isdigit(*p)) p++; l = sscanf(p, "%u%n", &row[meminfo_swap][meminfo_free], &k); p += k; return row; } for (i = 0; i < MAX_ROW && *p; i++) { /* loop over rows */ while (*p && !isdigit (*p)) p++; /* skip chars until a digit */ for (j = 0; j < MAX_COL && *p; j++) { /* scanf column-by-column */ l = sscanf (p, "%u%n", row[i] + j, &k); p += k; /* step over used buffer */ if (*p == '\n' || l < 1) /* end of line/buffer */ break; } } return row; /* NULL return ==> error */ } void free_mem (void) { unsigned **mem; if (!(mem = meminfo ()) || mem[meminfo_main][meminfo_total] == 0) { /* cannot normalize mem usage */ tot_mem = 0L; } else { tot_mem = mem[meminfo_main][meminfo_free] + mem[meminfo_main][meminfo_buffers] + mem[meminfo_total][meminfo_cached] + mem[meminfo_swap][meminfo_free]; } FbbMem (0); } void aff_forward (void) { fbb_list (FALSE); } int aff_nbsta (void) { return (fbb_list (FALSE)); } char *stat_voie (int voie) { static char s[15]; switch (svoie[voie]->sta.stat) { case 0: strcpy (s, "Disconne"); break; case 1: strcpy (s, "Link Set"); break; case 2: strcpy (s, "Fram Rej"); break; case 3: strcpy (s, "Disc Req"); break; case 4: strcpy (s, "Transfer"); break; case 5: strcpy (s, "FRej Snd"); break; case 6: if (p_port[no_port (voie)].typort == TYP_KAM) sprintf (s, "Retry %-2d", svoie[voie]->sta.ret + 1); else sprintf (s, "Retry %-2d", svoie[voie]->sta.ret); break; case 7: strcpy (s, "Dev Busy"); break; case 8: strcpy (s, "RdevBusy"); break; case 9: strcpy (s, "BdevBusy"); break; case 10: strcpy (s, "WAck Dbs"); break; case 11: strcpy (s, "WAckRbsy"); break; case 12: strcpy (s, "WAckBbsy"); break; case 13: strcpy (s, "RFrmDbsy"); break; case 14: strcpy (s, "RFrmRbsy"); break; case 15: strcpy (s, "RFrmBbsy"); break; case 16: strcpy (s, "Console "); break; case 17: strcpy (s, "Ch Busy "); break; default: strcpy (s, "Error st"); break; } return (s); } void status (int voie) { char buf[255]; char call[80]; char ret[80]; Svoie *ptvoie = svoie[voie]; if (operationnel) { if ((v_aff < 0) || (voie == v_aff)) { if (voie > 1) { sprintf (ret, "(%03d)", ptvoie->sta.mem); sprintf (buf, "Buf %03d/%03d %s %02d-%02d-%02d %s", ptvoie->sta.ack, ptvoie->maxbuf, ret, ptvoie->niv1, ptvoie->niv2, ptvoie->niv3, stat_voie (voie)); #ifdef ENGLISH sprintf (call, "Ch %02d %s-%d", virt_canal (voie), ptvoie->sta.indicatif.call, ptvoie->sta.indicatif.num); #else sprintf (call, "Vo %02d %s-%d", virt_canal (voie), ptvoie->sta.indicatif.call, ptvoie->sta.indicatif.num); #endif FbbStatus (call, buf); } free_mem (); } user_status (voie); } svoie[voie]->ch_status = 0; } int aff_yapp (int voie) { return 1; } char *yapp_str (int voie, char *s) { #define YAPPLEN 44 #define MAX_AFF 12 static char stdesc[MAX_AFF][11] = { "SendInit ", "SendInitRt", "SendHeader", "SendData ", "SendEof ", "SendEOT ", "RcvWait ", "RcvHeader ", "RcvData ", "SndABORT ", "WaitAbtAck", "RcdABORT " }; static char *yapp_name[2] = {"Yapp", "YapC"}; Svoie *pv = svoie[voie]; int i; int retour = 0; int niv = pv->niv2; long offset = pv->enrcur; *s = '\0'; if (!operationnel) return (0); if (offset < 0L) offset = 0L; *s = '\0'; if (v_aff < 0) { if ((svoie[voie]->sta.connect) && (svoie[voie]->niv1 == N_YAPP)) { if ((niv > 0) && (niv < MAX_AFF)) { sprintf (s, "%s:%s %s %ld/%ld", yapp_name[pv->type_yapp], stdesc[pv->niv2], pv->appendf, offset, pv->tailm); retour = 1; } } if (retour == 0) { for (i = 0; i < NBVOIES; i++) { if ((svoie[i]->sta.connect) && (svoie[i]->niv1 == N_YAPP)) { if ((niv > 0) && (niv < MAX_AFF)) { pv = svoie[i]; sprintf (s, "%s:%s %s %ld/%ld", yapp_name[pv->type_yapp], stdesc[pv->niv2], pv->appendf, offset, pv->tailm); break; } } } } } else if (voie == v_aff) { if ((svoie[voie]->sta.connect) && (svoie[voie]->niv1 == N_YAPP)) { if ((niv > 0) && (niv < MAX_AFF)) { sprintf (s, "%s:%s %s %ld/%ld", yapp_name[pv->type_yapp], stdesc[pv->niv2], pv->appendf, offset, pv->tailm); retour = 1; } } } return (s); } void aff_ind_console (void) { char s[80]; sprintf (s, "Console : %6s-%-2d\n", cons_call.call, cons_call.num); aff_chaine (DEF, 25, 1, s); } void affich_logo (int att) { char chaine[80]; #ifdef ENGLISH sprintf (chaine, "MULTICONNECT BBS F6FBB V%s", version ()); #else sprintf (chaine, "SERVEUR MULTIVOIES F6FBB V%s", version ()); #endif aff_chaine (att, 55 - strlen (version ()), 1, chaine); } void aff_date (void) { char buffer[300]; char cdate[19]; long temps; struct tm *sdate; #ifdef ENGLISH char jour[] = "SunMonTueWedThuFriSat"; #else char jour[] = "DimLunMarMerJeuVenSam"; #endif temps = time (NULL); sdate = localtime (&temps); #ifdef ENGLISH sprintf (cdate, " %02d-%02d-%02d %02d:%02d", sdate->tm_year %100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min); #else sprintf (cdate, " %02d/%02d/%02d %02d:%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year %100, sdate->tm_hour, sdate->tm_min); #endif memcpy (cdate, jour + (sdate->tm_wday * 3), 3); if (com_error) sprintf (buffer, "%s %02d", cdate, com_error); else sprintf (buffer, "%s", cdate); aff_chaine (DEF, 1, 1, buffer); } void maj_options (void) { FILE *fptr; if ((fptr = fopen (d_disque ("OPTIONS.SYS"), "wb")) != NULL) { fwrite (&bip, sizeof (short), 1, fptr); fwrite (&ok_tell, sizeof (short), 1, fptr); fwrite (&ok_aff, sizeof (short), 1, fptr); fwrite (&separe, sizeof (short), 1, fptr); fwrite (&doub_fen, sizeof (short), 1, fptr); fwrite (&gate, sizeof (short), 1, fptr); fwrite (&just, sizeof (short), 1, fptr); fwrite (&p_forward, sizeof (short), 1, fptr); fwrite (&sed, sizeof (short), 1, fptr); fwrite (&aff_inexport, sizeof (short), 1, fptr); fwrite (&aff_popsmtp, sizeof (short), 1, fptr); fclose (fptr); } maj_menu_options (); } int ind_console (int type, char *chaine) /* Type : 0 = decimal, 1 = hexa */ { int c = 0; char *ptr = chaine; while (isalnum (*ptr)) ++ptr; if (*ptr) { *ptr++ = '\0'; while ((*ptr) && (!isxdigit (*ptr))) ++ptr; } if (find (chaine)) { strcpy (cons_call.call, chaine); if (*ptr) { if (type) sscanf (ptr, "%x", &c); else sscanf (ptr, "%d", &c); if ((c < 0) || (c > 15)) return (0); } cons_call.num = c; return (1); } return (0); } void house_keeping (void) { //long caltemps; save_fic = 1; set_busy (); //time (&caltemps); //stop_min = minute (caltemps); type_sortie = 3; } #if 0 int read_wp (unsigned record, Wp * wp) { return (0); } int write_wp (unsigned record, Wp * wp) { return (0); } unsigned search_wp_record (lcall icall, int what, unsigned first_record) { return (0xffff); } #endif void console_off (void) { CloseFbbWindow (0); } void console_on (void) { } void FbbRequestUserList (void) { bloc_indic *bptr; unsigned offset; int nb = 0; char buffer[8]; /* Envoie les indicatifs dans la ListBox */ bptr = racine; offset = 0; while (bptr) { if (*(bptr->st_ind[offset].indic) == '\0') break; if (bptr->st_ind[offset].coord != 0xffff) { if (bptr->st_ind[offset].val) { n_cpy (6, buffer, bptr->st_ind[offset].indic); AddUserList (buffer); } } if (++offset == T_BLOC_INFO) { offset = 0; bptr = bptr->suiv; } } /* Envoie les langues dans la ListBox */ for (nb = 0; nb < maxlang; nb++) { AddUserLang (nomlang + nb * LG_LANG); } } int GetUserInfos (char *callsign, info * frec) { ind_noeud *noeud; FILE *fptr; unsigned num_indic; noeud = insnoeud (callsign, &num_indic); if (noeud->coord == 0xffff) { return (0); } fptr = ouvre_nomenc (); fseek (fptr, (long) noeud->coord * sizeof (info), 0); fread (frec, sizeof (info), 1, fptr); ferme (fptr, 39); return (1); } int SetUserInfos (char *callsign, info * frec) { int voie; ind_noeud *noeud; FILE *fptr; unsigned num_indic; /* Met a jour l'utilisateur eventuellement connecte */ for (voie = 0; voie < NBVOIES; ++voie) { if (svoie[voie]->sta.connect && indcmp (svoie[voie]->sta.indicatif.call, callsign)) { svoie[voie]->finf = *frec; } } /* Met a jour le record de l'utilisateur */ noeud = insnoeud (callsign, &num_indic); if (noeud->coord == 0xffff) { return (0); } fptr = ouvre_nomenc (); fseek (fptr, (long) noeud->coord * sizeof (info), 0); fwrite (frec, sizeof (info), 1, fptr); ferme (fptr, 39); return (1); } void FbbRequestMessageList (void) { char buf[40]; unsigned offset; bloc_mess *bptr = tete_dir; ouvre_dir (); /* pvoie->typlist = 0; */ if (bptr) { /* Goto the end of the list */ while (bptr->suiv) bptr = bptr->suiv; /* Scans the list */ offset = T_BLOC_MESS; while (bptr) { --offset; if (bptr->st_mess[offset].noenr) AddMessageList (ltoa (bptr->st_mess[offset].nmess, buf, 10)); if (offset == 0) { bptr = prec_dir (bptr); offset = T_BLOC_MESS; } } } ferme_dir (); } int GetMsgInfos (bullist * plig, long numero) { mess_noeud *mptr; mptr = findmess (numero); if (mptr == NULL) return 0; ouvre_dir (); read_dir (mptr->noenr, plig); ferme_dir (); return (1); } int SetMsgInfo (bullist * plig, long numero) { mess_noeud *mptr; mptr = findmess (numero); if (mptr == NULL) return 0; ouvre_dir (); write_dir (mptr->noenr, plig); ferme_dir (); return (1); } char *MessPath (void) { return (MESSDIR); } void fwd_encours (void) { int i, priv, bull, kb; atfwd *nbmess; char ifwd[NBBBS][7]; char maxfwd[NBBBS + 1]; char typfwd[NBBBS + 1]; char typdat[NBBBS + 1]; ch_bbs (1, ifwd); fwd_value (maxfwd, typfwd, typdat); for (i = 0; i < NBBBS; i++) { nbmess = attend_fwd (i + 1, maxfwd[i + 1], 0, typfwd[i + 1], typdat[i + 1]); if (nbmess > 0) { priv = nbmess->nbpriv; bull = nbmess->nbbul; kb = nbmess->nbkb; } else priv = bull = kb = 0; AddPendingLine (ifwd[i], priv, bull, kb); } } void compress_display (int type, long value, long numero) { CompressPosition (type, (int) value, numero); } void maintenance (void) { int i; int suite; int port, voie, flag, strm; char txt[80]; char chaine[300]; FILE *fpinit; df ("maintenance", 0); InfoMessage (-1, "Halting communication", "Halt"); operationnel = FALSE; for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { wsprintf (txt, "Halting port %d", port); InfoMessage (-1, txt, NULL); selcanal (port); switch (p_port[port].typort) { case TYP_DED: case TYP_HST: vide (port, 0); /* Supprime le dernier ACK de sonde */ tnc_commande (port, "Y0", PORTCMD); break; case TYP_PK: tnc_commande (port, "UR1", PORTCMD); break; case TYP_MOD: /* modem_stop(port) ; */ break; case TYP_KAM: tnc_commande (port, "USERS 0/0", PORTCMD); break; case TYP_BPQ: for (voie = 1; voie < NBVOIES; voie++) { if (svoie[voie]->affport.port == port) { strm = no_canal (voie); flag = 6; cprintf ("Devalidating stream %d\r\n", strm); sta_drv (voie, SETFLG, (void *) &flag); } } break; } for (voie = 1; voie < NBVOIES; voie++) { if ((svoie[voie]->affport.port == port) && (svoie[voie]->sta.connect)) { deconnexion (voie, 1); #ifdef __linux__ #ifdef ENGLISH cprintf ("Disconnecting Port %d Channel %d\n", port, virt_canal (voie)); #else cprintf ("Deconnection du Port %d Voie %d \n", port, virt_canal (voie)); #endif #else #ifdef ENGLISH cprintf ("Disconnecting Port %d Channel %d\r\n", port, virt_canal (voie)); #else cprintf ("Deconnection du Port %d Voie %d \r\n", port, virt_canal (voie)); #endif #endif } } if (!BPQ (port)) { sprintf (chaine, "MAINT%d.SYS", port); if ((fpinit = fopen (c_disque (chaine), "r")) != NULL) { while (fgets (chaine, 256, fpinit)) { if (*chaine == '#') continue; sup_ln (chaine); if (*chaine) tnc_commande (port, chaine, PORTCMD); } fclose (fpinit); } switch (p_port[port].typort) { case TYP_DED: case TYP_HST: suite = 0; if (DRSI (port)) { for (i = port + 1; i < NBPORT; i++) { if (DRSI (i)) suite = 1; } } if (suite == 0) { cls_drv (port); } break; case TYP_PK: tnc_commande (port, "HON", PORTCMD); break; case TYP_KAM: break; } } } } closecom (); InfoMessage (-1, NULL, NULL); sprintf (chaine, "Q *** BBS Quit (%s)", version()); port_log (0, 0, 'S', chaine); /* port_log (0, 0, 'S', "Q *** BBS Quit");*/ ferme_log (); ff (); } void set_busy (void) { int port, voie, flag, strm; InfoMessage (-1, "Stopping connections", "Halt"); for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { selcanal (port); switch (p_port[port].typort) { case TYP_DED: case TYP_HST: tnc_commande (port, "Y0", PORTCMD); break; case TYP_PK: tnc_commande (port, "UR1", PORTCMD); break; case TYP_MOD: for (voie = 0; voie < NBVOIES; voie++) { if ((no_port (voie) == port) && (!svoie[voie]->sta.connect)) { tnc_commande (port, "ATH0=0", PORTCMD); } } break; case TYP_KAM: tnc_commande (port, "USERS 0/0", PORTCMD); break; case TYP_BPQ: for (voie = 1; voie < NBVOIES; voie++) { if (no_port (voie) == port) { flag = 0; strm = no_canal (voie); cprintf ("Devalidating stream %d (%02x)\r\n", strm, flag); sta_drv (voie, SETFLG, (void *) &flag); } } break; case TYP_SCK: case TYP_TCP: case TYP_ETH: for (voie = 1; voie < NBVOIES; voie++) { if (no_port (voie) == port) { sta_drv (voie, SETBUSY, NULL); } } break; } } } InfoMessage (-1, "Connections stopped", NULL); InfoMessage (-1, NULL, NULL); } fbb-7.0.10/src/autobin.c0000644000175000017500000001624213613360505011654 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module transfert de fichiers binaires. protocole AUTOBIN. */ #if defined(__WINDOWS__) || defined(__linux__) char *abin_str (int voie, char *s) { #define XMODLEN 44 static char stdesc[8][11] = { "SendInit ", "SendInit ", "SendData ", "SendEof ", " ", "WaitRecv ", "RecvData ", "RecvEof " }; char taille[40]; int niv = svoie[voie]->niv3; *s = '\0'; if ((niv >= 0) && (niv < 10)) { if (svoie[voie]->tailm) { sprintf (taille, "/%ld", svoie[voie]->tailm); } else { *taille = '\0'; } sprintf (s, "ABin:%s %s %ld%s", stdesc[niv], svoie[voie]->appendf, svoie[voie]->enrcur, taille); } return s; } static void aff_bin (int ok) { } #else static void aff_bin (int ok) { #define XMODLEN 44 static char stdesc[8][11] = { "SendInit ", "SendInit ", "SendData ", "SendEof ", " ", "WaitRecv ", "RecvData ", "RecvEof " }; char s[80]; char taille[40]; int n; int niv = pvoie->niv3; *s = '\0'; if (ok) { if ((niv >= 0) && (niv < 10)) { if (pvoie->tailm) { sprintf (taille, "/%ld", pvoie->tailm); } else { *taille = '\0'; } sprintf (s, "ABin:%s %s %ld%s", stdesc[niv], pvoie->appendf, pvoie->enrcur, taille); } } for (n = strlen (s); n < XMODLEN; n++) s[n] = ' '; s[XMODLEN] = '\0'; aff_chaine (W_DEFL, 17, 3, s); } #endif static void compute_CRC (short ch, short *crc) { short hibit; short shift; for (shift = 0x80; shift; shift >>= 1) { hibit = *crc & 0x8000; *crc <<= 1; *crc |= (ch & shift ? 1 : 0); if (hibit) *crc ^= 0x1021; } } static void wrbuf (void) { int i; int ncars; int nbcar = nb_trait; uchar *uptr; obuf *msgtemp; char *ptcur; char *ptr; uptr = data; for (i = 0; i < nbcar; i++) { compute_CRC ((short) *uptr, (short *) &pvoie->checksum); uptr++; } pvoie->enrcur += (long) nbcar; pvoie->size_trans += (long) nbcar; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue (sizeof (obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; ptr = data; while (nbcar--) { ++pvoie->memoc; *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue (sizeof (obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } msgtemp->nb_car = ncars; if (pvoie->memoc > MAXMEM) { write_mess_temp (O_BINARY, voiecur); } } void bin_transfer (void) { char s[80]; struct stat bufstat; var_cpy (0, "AUTOBIN"); switch (pvoie->niv3) { case 0: strtok (indd, " \r"); if ((indd = strtok (NULL, " \r")) == NULL) { yapp_message (T_ERR + 20); retour_appel (); break; } if ((voiecur == CONSOLE) || ((!P_YAPP (voiecur)) && (!SYS (pvoie->finf.flags)))) { yapp_message (T_YAP + 2); retour_appel (); break; } if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) != -1) && ((bufstat.st_mode & S_IFREG) != 0)) { if (pvoie->kiss != -2) texte (T_YAP + 0); pvoie->tailm = pvoie->enrcur = 0L; pvoie->size_trans = 0L; pvoie->xferok = 1; pvoie->type_yapp = 4; pvoie->tailm = file_size (pvoie->sr_fic); sprintf (s, "#BIN#%ld", pvoie->tailm); outln (s, strlen (s)); aff_bin (1); ch_niv3 (1); } else { /* ok = 0; */ yapp_message (T_ERR + 11); retour_appel (); } break; case 1: if (strnicmp (indd, "#OK#", 4) == 0) { ch_niv3 (2); pvoie->size_trans = 0L; pvoie->time_trans = 0L; pvoie->checksum = 0; set_binary (voiecur, 1); bin_transfer (); } else { aff_bin (0); retour_appel (); } break; case 2: pvoie->lignes = -1; if (strnicmp (indd, "#ABORT#", 7) == 0) { set_binary (voiecur, 0); clear_outbuf (voiecur); retour_dos (); aff_bin (0); break; } if (senddata (1) == 1) { aff_etat ('E'); send_buf (voiecur); set_binary (voiecur, 0); ch_niv3 (3); } aff_bin (1); break; case 3: sprintf (s, "BIN-TX OK #%u ", 0xffff & pvoie->checksum); outln (s, strlen (s)); pvoie->finf.download += (int) (pvoie->size_trans / 1024L); retour_dos (); aff_bin (0); break; case 4: strtok (indd, " \r"); if ((indd = strtok (NULL, " \r")) == NULL) { yapp_message (T_ERR + 20); retour_appel (); break; } if ((voiecur == CONSOLE) || ((!P_YAPP (voiecur)) && (!SYS (pvoie->finf.flags)))) { yapp_message (T_YAP + 2); /* ok = 0; */ retour_appel (); break; } if (read_only ()) retour_appel (); else { int fd; if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) == -1)) { /*fd = creat (pvoie->sr_fic, S_IREAD | S_IWRITE); */ fd = open (pvoie->sr_fic, O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE); if (fd > 0) { close (fd); unlink (pvoie->sr_fic); pvoie->tailm = pvoie->enrcur = 0L; texte (T_YAP + 1); ch_niv3 (5); aff_bin (1); } else { /* ok = 0; */ yapp_message (T_ERR + 30); retour_appel (); } } else { /* ok = 0; */ yapp_message (T_ERR + 23); retour_appel (); } } break; case 5: if (strnicmp (indd, "#BIN#", 5) == 0) { outln ("#OK#", 4); aff_etat ('E'); send_buf (voiecur); del_temp (voiecur); new_label (); pvoie->tailm = atol (indd + 5); pvoie->enrcur = 0L; pvoie->checksum = 0; pvoie->size_trans = 0L; pvoie->time_trans = time (NULL); set_binary (voiecur, 1); pvoie->xferok = 0; pvoie->type_yapp = 4; ch_niv3 (6); aff_bin (1); } else { retour_appel (); aff_bin (0); } break; case 6: wrbuf (); aff_bin (1); if (pvoie->enrcur == pvoie->tailm) { pvoie->xferok = 2; write_mess_temp (O_BINARY, voiecur); if (test_temp (voiecur)) { /* Le fichier est mis en place */ rename_temp (voiecur, pvoie->sr_fic); wr_dir (pvoie->sr_fic, pvoie->sta.indicatif.call); } set_binary (voiecur, 0); sprintf (s, "BIN-RX OK #%u ", 0xffff & pvoie->checksum); outln (s, strlen (s)); ch_niv3 (7); aff_bin (1); } break; case 7: retour_appel (); aff_bin (0); break; } } fbb-7.0.10/src/dos_dir.c0000644000175000017500000003722013613360505011635 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #ifdef __linux__ #include #endif static int dir_time (char *); static long parcours (char, char *); int is_dir (char *chaine) { #ifdef __linux__ struct stat st; int ret; if ((strlen (chaine) > 2) && (chaine[1] == ':')) chaine += 2; ret = stat (back2slash (chaine), &st); if (ret == -1) return (0); return (S_ISDIR (st.st_mode)); #endif #if defined(__FBBDOS__) || defined (__WINDOWS__) int hand; struct dfree dtable; /* Teste la racine car NOVELL ne reconnait pas C:\ comme repertoire !!! */ if ((isalpha (chaine[0])) && (chaine[1] == ':') && (chaine[2] == '\\') && (!chaine[3])) { getdfree (toupper (chaine[0]) - '@', &dtable); if (dtable.df_sclus == 0xffff) { /* Disque non valide ? */ return (0); } else return (1); } /* Fin du rajout NOVELL */ if (access (chaine, 0) == 0) { hand = open (chaine, O_RDONLY); /* Repertoire ou fichier ? */ if (hand == -1) { return (1); } else { close (hand); return (0); } } return (0); #endif } void prompt_dos (void) { char *scan; char *ptr = local_path (pvoie->dos_path); if ((scan = strchr (ptr, ':')) != NULL) ptr = scan + 1; var_cpy (0, ptr); texte (T_DOS + 0); maj_niv (9, 0, 0); } static int dir_time (char *indic) { int lg = strlen (indic); int pos; int c[3]; for (pos = 0; pos < 3; c[pos++] = '\0') ; pos = 0; while (lg--) { if (isalpha (indic[lg])) c[pos++] = (int) (indic[lg] - 'A'); if (pos == 3) break; } return (c[0] | (c[1] << 5) | (c[2] << 10)); } void wr_dir (char *fichier, char *indic) { #if defined(__FBBDOS__) || defined(__WINDOWS__) int fd; int dt = dir_time (indic); long temps = time (NULL); struct tm *sdate; struct ftime dirtime; sdate = localtime (&temps); dirtime.ft_year = sdate->tm_year %100; dirtime.ft_day = sdate->tm_mday; dirtime.ft_month = sdate->tm_mon + 1; dirtime.ft_hour = dt >> 11; dirtime.ft_min = (dt >> 5) & 0x3f; dirtime.ft_tsec = dt & 0x1f; if ((fd = open (fichier, O_RDONLY)) != -1) { setftime (fd, &dirtime); close (fd); } #endif #ifdef __linux__ struct utimbuf buf; long temps = time (NULL); struct tm *sdate; /* int dt = dir_time (indic); int heure = dt >> 11; int minute = (dt >> 5) & 0x3f; int seconde = (dt & 0x1f) << 1; */ sdate = localtime (&temps); /* sdate->tm_hour = heure; sdate->tm_min = minute; sdate->tm_sec = seconde; */ buf.actime = buf.modtime = mktime (sdate); if (utime (back2slash (fichier), &buf) != 0) perror ("utime"); #endif } int aut_dir (char *fichier, char *indic) { if (droits (SUPFIC)) { return (1); } else { #if defined(__FBBDOS__) || defined(__WINDOWS__) union { struct ftime dirtime; struct { int time; int date; } dtime; } utime; int fd; if ((fd = open (fichier, O_RDONLY)) == -1) return (1); getftime (fd, &(utime.dirtime)); close (fd); return (utime.dtime.time == dir_time (indic)); #endif #ifdef __linux__ int fd; struct stat buf; time_t temps; struct tm *sdate; int dt; if ((fd = open (fichier, O_RDONLY)) == -1) return (1); fstat (fd, &buf); temps = buf.st_mtime; close (fd); sdate = localtime (&temps); dt = (sdate->tm_hour << 11) + (sdate->tm_min << 5) + (sdate->tm_sec >> 1); return (dt == dir_time (indic)); #endif } } static int protected_dir(char *file) { int protected = 0; char nomfich[256]; FILE *fptr; char *ptr, *scan; char ligne[81]; #ifdef __FBBDOS__ if ((fptr = fopen (c_disque ("prot_d.sys"), "r")) == NULL) #endif #ifdef __WINDOWS__ if ((fptr = fopen (c_disque ("prot_w.sys"), "r")) == NULL) #endif #ifdef __linux__ if ((fptr = fopen (c_disque ("prot_l.sys"), "r")) == NULL) #endif { fptr = fopen (c_disque ("protect.sys"), "r"); } if (fptr) { while (fgets (ligne, 80, fptr)) { ptr = scan = ligne; while ((*scan) && (!ISGRAPH (*scan))) ++scan; while (ISGRAPH (*scan)) *ptr++ = *scan++; *ptr = '\0'; if (*ligne == '#' || *ligne == '\0') continue; strcpy (nomfich, tot_path (file, pvoie->dos_path)); #ifdef __linux__ ptr = strrchr (nomfich, '/'); if (ptr == nomfich) strcpy (nomfich, "/"); #else ptr = strrchr (nomfich, '\\'); if (ptr == nomfich) strcpy (nomfich, "\\"); else *ptr = '\0'; #endif #ifdef __linux__ ptr = ligne; scan = nomfich; if (ptr[1] != ':' && nomfich[1] == ':') scan += 2; #else ptr = slash2back(ligne); scan = nomfich; #endif if (strncmpi (ptr, scan, strlen(ptr)) == 0) { protected = 1; break; } } ferme (fptr, 77); } return protected; } int aut_ecr (char *fichier, int check_dir) { int supp = TRUE; char *ptr, *scan; char nomfich[256]; if (droits (ACCESDOS) && droits (SUPFIC) && (*fichier == '+')) { if (*fichier == '+') { /* Deletes the '+' character */ ptr = scan = fichier; ++scan; while ((*ptr++ = *scan++) != '\0') ; } } else { if (check_dir) supp = !protected_dir(fichier); if ((supp) && (!droits (ACCESDOS))) { strcpy (nomfich, tot_path (fichier, pvoie->dos_path)); supp = aut_dir (nomfich, pvoie->sta.indicatif.call); } } if (!supp) { strcpy (pvoie->appendf, fichier); texte (T_ERR + 23); } return (supp); } /* static int exist(char*file) { return (access(local_path(tot_path(file, pvoie->dos_path)), 0) == 0) ; } */ void remove_dir (void) { char *ptr; get_nextparam(); if ((ptr = get_nextparam()) == NULL) { texte (T_ERR + 25); } else { if (tst_point (ptr)) { if (aut_ecr (ch_slash (ptr), 1)) { var_cpy (0, ptr); #ifdef __linux__ if (fbb_rmdir (tot_path (ptr, pvoie->dos_path)) == 0) #else if (rmdir (tot_path (ptr, pvoie->dos_path)) == 0) #endif texte (T_DOS + 1); else texte (T_ERR + 24); } } } prompt_dos (); } void make_dir (void) { char *ptr, *path; get_nextparam(); if ((ptr = get_nextparam()) == NULL) { texte (T_ERR + 25); } else { #ifdef __linux__ path = tot_path (ptr, pvoie->dos_path); if (fbb_mkdir (path, 0777) != 0) { var_cpy (0, ptr); texte (T_ERR + 26); } else { wr_dir (path, pvoie->sta.indicatif.call); } #endif #if defined(__FBBDOS__) || defined(__WINDOWS__) ch_slash (ptr); if (mkdir (tot_path (ptr, pvoie->dos_path)) != 0) { var_cpy (0, ptr); texte (T_ERR + 26); } #endif } prompt_dos (); } static void teste_file_name (char *ptr) { /* int ok; int lg = 0; int max = 8; char *ptro = ptr; while (*ptr) { ok = 1; if (*ptr == '.') { lg = 0; max = 3; } else if (*ptr == '\\') { lg = 0; max = 8; } else if (++lg > max) { ok = 0; } if (ok) *ptro++ = *ptr; ++ptr; } *ptro = '\0'; */ } void change_dir (void) { int nb; char local_dir[256], *ptr, *scan, *cur_dir; strcpy (local_dir, pvoie->dos_path); get_nextparam(); if ((ptr = get_nextparam()) == NULL) { nb = strlen (local_dir); if (nb > 1) { --nb; local_dir[nb] = '\0'; } outln (local_dir, nb); } else { #ifdef __linux__ teste_file_name (ptr); if (*ptr == '/') #else ch_slash (ptr); teste_file_name (ptr); if (*ptr == '\\') #endif { if (tst_point (ptr)) { strcpy (local_dir, ptr); if (strlen (local_dir) > 1) #ifdef __linux__ strcat (local_dir, "/"); #else strcat (local_dir, "\\"); #endif } } else { #ifdef __linux__ if ((scan = strtok (ptr, "\n")) != NULL) #else if ((scan = strtok (ptr, "\\\r")) != NULL) #endif { do { if (strcmp (scan, ".") == 0) continue; if (strncmp (scan, "..", 2) == 0) { #ifdef __linux__ cur_dir = strrchr (local_dir, '\\'); #else cur_dir = strrchr (local_dir, "\\"); #endif if (cur_dir != local_dir) { do { *cur_dir-- = '\0'; } #ifdef __linux__ while (*cur_dir != '\\'); #else while (*cur_dir != "\\"); #endif } } else if (*scan != '~') { strcat (local_dir, scan); #ifdef __linux__ strcat (local_dir, "/"); #else strcat (local_dir, "\\"); #endif } } #ifdef __linux__ while ((scan = strtok (NULL, "\n")) != NULL); #else while ((scan = strtok (NULL, "\\\r")) != NULL); #endif } } if (strlen (local_dir) > 255) texte (T_ERR + 28); else { char ldir[256]; char *ptr; strcpy(ldir, tot_path ("\0", local_dir)); ptr = long_filename(NULL, ldir); if (is_dir (local_path (ptr)) > 0) strcpy (pvoie->dos_path, ptr + strlen(ptr) - strlen(local_dir)); else texte (T_ERR + 29); } } prompt_dos (); } char *dir_date (int date) { int jour, mois, annee; static char ch_date[11]; jour = date & 0x1f; mois = (date >> 5) & 0x0f; annee = ((date >> 9) & 0x3f); sprintf (ch_date, "%02d-%02d-%02d", jour, mois, annee % 100); return (ch_date); } int dir_suite (char *masque) { int n; char chaine[257]; char temp[257]; if (masque) { strcpy (temp, tot_path (ch_slash (masque), pvoie->dos_path)); n = strlen (temp); if ((n > 3) && (temp[n - 1] == '\\')) temp[n - 1] = '\0'; if (is_dir (temp)) { if ((strlen (masque) == 3) && (masque[2] == '\\')) masque[2] = '\0'; #ifdef __linux__ sprintf (chaine, "%s/*", masque); #else sprintf (chaine, "%s/*.*", masque); #endif masque = chaine; } if (findfirst (tot_path (ch_slash (masque), pvoie->dos_path), &(pvoie->dirblk), FA_DIREC)) { texte (T_DOS + 2); return (FALSE); } if (*pvoie->dirblk.ff_name == '.') { findnext (&(pvoie->dirblk)); if (findnext (&(pvoie->dirblk))) { texte (T_DOS + 2); return (FALSE); } } var_cpy (3, pvoie->dirblk.ff_name); var_cpy (2, dir_date (pvoie->dirblk.ff_fdate)); *varx[0] = '\0'; *varx[4] = *varx[5] = *varx[6] = *varx[7] = '\0'; if ((pvoie->dirblk.ff_attrib & FA_DIREC) != 0) { var_cpy (1, " "); } else { long size = pvoie->dirblk.ff_fsize; if (size > (99999 * 1024)) sprintf (varx[1], "%5ld M", size / (1024 * 1024)); else if (size > 999999) sprintf (varx[1], "%5ld K", size / 1024); else sprintf (varx[1], "%7ld", size); } /* if (findnext (&(pvoie->dirblk))) { *varx[4] = *varx[5] = *varx[6] = *varx[7] = '\0'; texte (T_DOS + 3); return (FALSE); } sprintf (varx[4], "%-13s", pvoie->dirblk.ff_name); var_cpy (6, dir_date (pvoie->dirblk.ff_fdate)); *varx[7] = '\0'; if ((pvoie->dirblk.ff_attrib & FA_DIREC) != 0) { var_cpy (5, " "); } else { sprintf (varx[5], "%7ld", pvoie->dirblk.ff_fsize); }*/ texte (T_DOS + 3); } while (1) { if (findnext (&(pvoie->dirblk))) return (FALSE); /* sprintf (varx[0], "%-13s", pvoie->dirblk.ff_name); */ var_cpy (3, pvoie->dirblk.ff_name); var_cpy (2, dir_date (pvoie->dirblk.ff_fdate)); *varx[0] = '\0'; *varx[4] = *varx[5] = *varx[6] = *varx[7] = '\0'; if ((pvoie->dirblk.ff_attrib & FA_DIREC) != 0) { var_cpy (1, " "); } else { long size = pvoie->dirblk.ff_fsize; if (size > (99999 * 1024)) sprintf (varx[1], "%5ld M", size / (1024 * 1024)); else if (size > 999999) sprintf (varx[1], "%5ld K", size / 1024); else sprintf (varx[1], "%7ld", size); } /* if (findnext (&(pvoie->dirblk))) { *varx[4] = *varx[5] = *varx[6] = *varx[7] = '\0'; texte (T_DOS + 3); return (FALSE); } sprintf (varx[4], "%-13s", pvoie->dirblk.ff_name); var_cpy (6, dir_date (pvoie->dirblk.ff_fdate)); *varx[7] = '\0'; if ((pvoie->dirblk.ff_attrib & FA_DIREC) != 0) { var_cpy (5, " "); } else { sprintf (varx[5], "%7ld", pvoie->dirblk.ff_fsize); }*/ texte (T_DOS + 3); } /* return(TRUE) ; */ } void retour_dir (char vdisk) { int disk; if (vdisk == 8) disk = (pvoie->finf.priv[1] == ':') ? pvoie->finf.priv[0] - '@' : getdisk () + 1; else if ((voiecur == CONSOLE) || (pvoie->niv1 == N_YAPP)) disk = vdisk + 1; else #ifdef __linux__ disk = vdisk + 1; #else disk = PATH[vdisk][0] - '@'; #endif ultoa (free_disk (disk) * 1024UL, varx[0], 10); texte (T_DOS + 11); retour_dos (); } void dir (void) { char vdisk; char *ptr; #ifdef __linux__ char temp[] = "X:*"; #else char temp[] = "X:*.*"; #endif get_nextparam(); pvoie->noenr_menu = 0L; ptr = get_nextparam(); if (ptr == NULL) { temp[0] = (pvoie->vdisk == 8) ? 'P' : pvoie->vdisk + 'A'; ptr = temp; } vdisk = pvoie->vdisk; if ((*(ptr + 1) == ':') && (*(ptr + 2) == '\0')) { temp[0] = *ptr; vdisk = *ptr - 'A'; if (vdisk == 15) vdisk = 8; ptr = temp; } if (!tst_point (ptr)) retour_dos (); else if (dir_suite (ptr)) { texte (T_TRT + 11); maj_niv (9, 1, 1); } else retour_dir (vdisk); } void list (void) { char vdisk; char *ptr; #ifdef __linux__ char temp[] = "X:*"; #else char temp[] = "X:*.*"; #endif get_nextparam(); ptr = get_nextparam(); if (ptr == NULL) { temp[0] = (pvoie->vdisk == 8) ? 'P' : pvoie->vdisk + 'A'; ptr = temp; } vdisk = pvoie->vdisk; if ((*(ptr + 1) == ':') && (*(ptr + 2) == '\0')) { temp[0] = *ptr; vdisk = *ptr - 'A'; if (vdisk == 13) vdisk = 8; ptr = temp; } #if 0 if ((ptr = strtok (NULL, " \r")) == NULL) { ptr = temp; } liste_label (); if (!tst_point (ptr)) retour_dos (); if (dir_yapp (ptr)) { texte (T_TRT + 11); ch_niv3 (1); } else { pvoie->noenr_menu = 0L; libere_label (voiecur); retour_dir (); } #endif if (tst_point (ptr)) { dir_yapp (ptr); retour_dir (vdisk); } else retour_dos (); } static long parcours (char vdisk, char *path) { struct ffblk ffblk; long total = 0L; long local = 0L; char rech[80]; char temp[128]; int done = 1; int pos; strcpy (rech, path); #ifdef __linux__ strcat (rech, "*"); #else strcat (rech, "*.*"); #endif if (voiecur == CONSOLE) pos = 0; else { char *ptr = PATH[(int)vdisk]; pos = strlen (ptr) - 1; if (ptr[1] == ':') pos -= 2; } done = findfirst (rech, &ffblk, FA_DIREC); while (!done) { if (*ffblk.ff_name != '.') { #ifdef __linux__ if ((ffblk.ff_attrib & FA_DIREC) && ((ffblk.ff_attrib & FA_LINK) == 0)) #else if (ffblk.ff_attrib & FA_DIREC) #endif { strcpy (temp, path); strcat (temp, ffblk.ff_name); strcat (temp, "\\"); if (strncmp (temp + 1, ":\\PROC\\", 7) != 0) { total += parcours (vdisk, temp); } } else { local += ffblk.ff_fsize; } } done = findnext (&ffblk); } total += local; sprintf (temp, "%8ld KB %8ld KB %s", (total + 1023)/1024, (local + 1023)/1024, path + pos); outln (temp, strlen (temp)); return (total); } void du (void) { char vdisk; char *ptr; char temp[] = "X:"; char path[256]; get_nextparam(); ptr = get_nextparam(); if (ptr == NULL) { temp[0] = (pvoie->vdisk == 8) ? 'P' : pvoie->vdisk + 'A'; ptr = temp; } vdisk = pvoie->vdisk; if ((*(ptr + 1) == ':') && (*(ptr + 2) == '\0')) { temp[0] = *ptr; vdisk = *ptr - 'A'; if (vdisk == 13) vdisk = 8; ptr = temp; } if (tst_point (ptr)) { strcpy (path, tot_path (ch_slash (ptr), pvoie->dos_path)); parcours (vdisk, path); retour_dir (vdisk); } else retour_dos (); } fbb-7.0.10/src/exec_pg.c0000644000175000017500000003301313613360505011620 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Execution de programmes pour l'utilisateur * */ static void dir_pg (void); static void pg_commande (void); static void load_pg (void); static int nbpg = 0; #ifdef __linux__ #undef open #include #include #include #include cmdlist *tete_cmd = NULL; static int pty_open (int *pty, struct winsize *winsize) { int pid; int i; char line[20]; int c; int tty, devtty; for (c = 'p'; c <= 's'; c++) { for (i = 0; i < 16; i++) { sprintf (line, "/dev/pty%c%x", c, i); *pty = open (line, O_RDWR | O_NOCTTY); if (*pty >= 0) break; } if (*pty >= 0) break; } if (*pty < 0) { fprintf (stderr, "Out of pty\n"); return -1; } ioctl (*pty, TIOCEXCL, NULL); if ((pid = fork ()) != 0) return pid; /* child */ close (*pty); signal (SIGHUP, SIG_DFL); line[5] = 't'; tty = open (line, O_RDWR); if (tty < 0) { fprintf (stderr, "Cannot open slave side\n"); close (*pty); return -1; } (void) chown (line, getuid (), getgid ()); (void) chmod (line, 0600); setsid (); /* will break terminal affiliation */ ioctl (tty, TIOCSCTTY, (char *) 0); if (setuid (getuid ()) < 0 || setgroups(0, NULL) < 0 || setgid (getgid ()) < 0) { perror ("cannot set UID/GID"); exit (1); } devtty = open ("/dev/tty", O_RDWR); if (devtty < 0) { perror ("cannot open /dev/tty"); exit (1); } ioctl (devtty, TIOCSWINSZ, winsize); close (tty); dup2 (devtty, 0); dup2 (devtty, 1); dup2 (devtty, 2); return 0; } int is_cmd (int voie) { struct timeval to; fd_set fds_read; if (svoie[voie]->niv1 == N_MBL && svoie[voie]->niv2 == 20 && svoie[voie]->niv3 > 0) { FD_ZERO (&fds_read); FD_SET (svoie[voie]->niv3, &fds_read); to.tv_sec = 0; to.tv_usec = 0; return (select (svoie[voie]->niv3 + 1, &fds_read, NULL, NULL, &to) > 0); } return 0; } void exec_cmd (cmdlist * cptr) { if (pvoie->niv3 == 0) { int pid, ac; struct winsize win = {24, 80, 0, 0}; char *av[20]; if (cptr == NULL) return; /* Create the child process */ pid = pty_open (&pvoie->niv3, &win); if (pid == 0) { /* child */ struct termios termios; char *line; memset ((char *) &termios, 0, sizeof (termios)); ioctl (0, TIOCSCTTY, (char *) 0); termios.c_iflag = ICRNL | IXOFF; termios.c_oflag = OPOST | ONLCR; termios.c_cflag = CS8 | CREAD /*| CLOCAL */ ; termios.c_lflag = ISIG | ICANON; termios.c_cc[VINTR] = 127; termios.c_cc[VQUIT] = 28; termios.c_cc[VERASE] = 8; termios.c_cc[VKILL] = 24; termios.c_cc[VEOF] = 4; cfsetispeed (&termios, B38400); cfsetospeed (&termios, B38400); tcsetattr (0, TCSANOW, &termios); /* Transform the command line to list of arguments */ sup_ln (indd); while (*indd && (!isspace (*indd))) ++indd; line = calloc (1, strlen (cptr->action) + strlen (indd) + 2); strcpy (line, cptr->action); strcat (line, indd); ac = 0; av[ac] = strtok (line, " \t\n\r"); while (av[ac]) av[++ac] = strtok (NULL, " \t\n"); /* envc = 0; envp[envc] = (char *) malloc (30); sprintf (envp[envc++], "AXCALL=%s", call); envp[envc] = (char *) malloc (30); sprintf (envp[envc++], "PROTOCOL=%s", protocol); envp[envc] = (char *) malloc (30); sprintf (envp[envc++], "TERM=linux"); envp[envc] = NULL; */ execvp (av[0], av); /* should never go there */ exit (1); } } else { /* read/write the child process */ if (*indd) write (pvoie->niv3, indd, strlen (indd)); if (is_cmd (voiecur)) { char buf[250]; int cnt; cnt = read (pvoie->niv3, buf, sizeof (buf)); if (cnt <= 0) { /* End of connection */ close (pvoie->niv3); pvoie->niv3 = 0; retour_mbl (); return; } out (buf, cnt); } } } #endif void exec_pg (void) { int n_sauve; int ret; char s[256]; char *ptr = NULL; FILE *fptr; if (pvoie->niv3 == 0) { /* if ... incindd(); */ teste_espace (); sup_ln (indd); if (*indd) { ptr = pvoie->appendf; while (ISGRAPH (*indd)) *ptr++ = *indd++; *ptr = '\0'; if (!tst_point (pvoie->appendf)) { retour_mbl (); return; } while_space (); } else { dir_pg (); retour_mbl (); return; } } indd[80] = '\0'; if (pvoie->ncur->coord != 0xffff) { /* Ecrit le record de l'utilisateur en fichier */ fptr = ouvre_nomenc (); fseek (fptr, pvoie->ncur->coord * ((long) sizeof (info)), 0); fwrite ((char *) &(pvoie->finf), (int) sizeof (info), 1, fptr); ferme (fptr, 18); } #ifdef __WINDOWS__ #define PG_BUF 32000 char *ptr = m_alloue (PG_BUF); if (ptr == NULL) return; memset (ptr, '\0', PG_BUF); #ifdef __WIN32__ sprintf (s, "PG32\\%s %s-%d %d %u %d %s", pvoie->appendf, pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv3, pvoie->finf.flags, pvoie->ncur->coord, indd); #else sprintf (s, "PG\\%s %s-%d %d %u %d %s", pvoie->appendf, pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv3, pvoie->finf.flags, pvoie->ncur->coord, indd); #endif ret = filter (s, ptr, PG_BUF, NULL, NULL); ptr[PG_BUF - 1] = '\0'; if (*ptr) out (ptr, strlen (ptr)); m_libere (ptr, PG_BUF); #endif #ifdef __linux__ char deroute[80]; char *pptr = s; sprintf (deroute, "%sEXECUTE.xxx", MBINDIR); sprintf (s, "./%s %s-%d %d %u %d %s", strlwr (pvoie->appendf), pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv3, pvoie->finf.flags, pvoie->ncur->coord, indd); ret = call_nbdos (&pptr, 1, REPORT_MODE, deroute, PGDIR, NULL); if (ret != -1) { outfich (deroute); } unlink (deroute); #endif /* #ifdef __FBBDOS__ sprintf (s, "PG\\%s %s-%d %d %u %d %s", pvoie->appendf, pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv3, pvoie->finf.flags, pvoie->ncur->coord, indd); ret = send_dos (4, s, NULL); #endif */ if (pvoie->ncur->coord != 0xffff) { /* Relit le record de l'utilisateur du fichier */ fptr = ouvre_nomenc (); fseek (fptr, pvoie->ncur->coord * ((long) sizeof (info)), 0); fread ((char *) &(pvoie->finf), (int) sizeof (info), 1, fptr); ferme (fptr, 18); } switch (ret) { case 0: init_hold (); retour_mbl (); break; case 1: ++pvoie->niv3; break; case 2: pvoie->deconnect = 6; break; case 3: pg_commande (); break; case 4: n_sauve = ++pvoie->niv3; init_hold (); pg_commande (); maj_niv (N_MBL, 17, n_sauve); break; case 5: break; case -1: clear_outbuf (voiecur); strcpy (varx[0], pvoie->appendf); texte (T_ERR + 1); retour_mbl (); break; default: retour_mbl (); break; } } static void dir_pg (void) { int num = 0; char str[80]; char *ptr; #ifdef __WINDOWS__ #ifdef __WIN32__ if (findfirst ("PG32\\*.*", &(pvoie->dirblk), FA_DIREC)) #else if (findfirst ("PG\\*.*", &(pvoie->dirblk), FA_DIREC)) #endif { texte (T_DOS + 2); return; } #endif #ifdef __FBBDOS__ if (findfirst ("PG\\*.*", &(pvoie->dirblk), FA_DIREC)) { texte (T_DOS + 2); return; } #endif #ifdef __linux__ { cmdlist *clist = tete_cmd; while (clist) { if (num == 4) { cr (); num = 0; } sprintf (str, "%-10s", clist->cmd); out (str, 10); clist = clist->next; } if (num != 0) cr (); } num = 0; sprintf(str, "%s*", PGDIR); if (findfirst (str, &(pvoie->dirblk), FA_DIREC)) { texte (T_DOS + 2); return; } #endif if (*pvoie->dirblk.ff_name == '.') { findnext (&(pvoie->dirblk)); if (findnext (&(pvoie->dirblk))) { texte (T_DOS + 2); return; } } while (1) { if ((pvoie->dirblk.ff_attrib & FA_DIREC) == 0) { if (num == 4) { cr (); num = 0; } ptr = strrchr (pvoie->dirblk.ff_name, '.'); if (ptr) *ptr = '\0'; sprintf (str, "%-10s", pvoie->dirblk.ff_name); out (str, 10); ++num; } if (findnext (&(pvoie->dirblk))) break; } if (num != 0) cr (); } static void pg_commande (void) { obuf *optr; char *ptr, *tptr; int ncars, nbcars, nocars; int maxcar = DATABUF; if ((optr = pvoie->outptr) != NULL) { ncars = 0; tptr = data; nbcars = optr->nb_car; nocars = optr->no_car; ptr = optr->buffer + nocars; while (1) { if (nbcars == nocars) { pvoie->outptr = optr->suiv; m_libere (optr, sizeof (obuf)); pvoie->memoc -= 250; if ((optr = pvoie->outptr) != NULL) { nbcars = optr->nb_car; nocars = 0; ptr = optr->buffer; } else { /* cprintf(" Vide ") ; */ break; } } *tptr++ = *ptr; ++nocars; if (++ncars == maxcar) { optr->no_car = nocars; break; } ++ptr; } *tptr = '\0'; maj_niv (N_MBL, 0, 0); in_buf (voiecur, data, strlen (data)); while (pvoie->inbuf.nblig) traite_voie (voiecur); } } int appel_pg (char *nom) { pglist *lptr = tete_pg; #ifdef __linux__ cmdlist *cptr = tete_cmd; strupr (nom); while (cptr) { if (strcmp (nom, cptr->cmd) == 0) { maj_niv (N_MBL, 20, 0); --indd; exec_cmd (cptr); return (1); } cptr = cptr->next; } #else strupr (nom); #endif while (lptr) { if (strcmp (nom, lptr->nom_pg) == 0) { maj_niv (N_MBL, 17, 0); --indd; exec_pg (); return (1); } lptr = lptr->suiv; } return (0); } #ifdef __linux__ static void load_cmd (void) { FILE *fptr; char line[256]; char cmd[256]; char action[256]; cmdlist *cptr; fptr = fopen (c_disque ("commands.sys"), "r"); if (fptr == NULL) return; while (fgets (line, sizeof (line), fptr)) { int nb = sscanf (line, "%s %[^\n]", cmd, action); if (nb < 2 || *cmd == '#') continue; cptr = malloc (sizeof (cmdlist)); if (cptr == NULL) return; strupr (cmd); n_cpy (sizeof (cptr->cmd) - 1, cptr->cmd, cmd); cptr->action = strdup (action); cptr->next = tete_cmd; tete_cmd = cptr; ++nbpg; { char text[80]; sprintf (text, "%d: CMD %s", nbpg, cptr->cmd); InitText (text); } } fclose (fptr); } #endif static void load_pg (void) { char str[80]; char *ptr; pglist *lptr = tete_pg; struct ffblk dirblk; #if defined(__WINDOWS__) || defined(__FBBDOS__) #ifdef __WIN32__ if (findfirst ("PG32\\*.*", &dirblk, FA_DIREC)) #else if (findfirst ("PG\\*.*", &dirblk, FA_DIREC)) #endif { return; } #endif #if defined(__linux__) sprintf(str, "%s*", PGDIR); if (findfirst (str, &dirblk, FA_DIREC)) { return; } #endif if (*pvoie->dirblk.ff_name == '.') { findnext (&dirblk); if (findnext (&dirblk)) { return; } } ptr = strchr (dirblk.ff_name, '.'); if (ptr) *ptr = '\0'; if ((dirblk.ff_attrib & FA_DIREC) == 0) { if (lptr) { lptr->suiv = (pglist *) m_alloue (sizeof (pglist)); lptr = lptr->suiv; } else { tete_pg = lptr = (pglist *) m_alloue (sizeof (pglist)); } lptr->suiv = NULL; strn_cpy (8, lptr->nom_pg, dirblk.ff_name); #if defined(__WINDOWS__) || defined(__linux__) ++nbpg; { char text[80]; sprintf (text, "%d: PG %s", nbpg, lptr->nom_pg); InitText (text); } #endif } while (findnext (&dirblk) == 0) { ptr = strchr (dirblk.ff_name, '.'); if (ptr) *ptr = '\0'; if ((dirblk.ff_attrib & FA_DIREC) == 0) { if (lptr) { lptr->suiv = (pglist *) m_alloue (sizeof (pglist)); lptr = lptr->suiv; } else { tete_pg = lptr = (pglist *) m_alloue (sizeof (pglist)); } lptr->suiv = NULL; strn_cpy (8, lptr->nom_pg, dirblk.ff_name); #if defined(__WINDOWS__) || defined(__linux__) ++nbpg; { char text[80]; sprintf (text, "%d: PG %s", nbpg, lptr->nom_pg); InitText (text); } #endif } } #ifdef __linux__ /* Loads the commands of system/commands.sys */ load_cmd (); #endif } void end_pg (void) { pglist *lptr; #ifdef __linux__ cmdlist *cptr; int voie; for (voie = 0; voie < NBVOIES; voie++) { /* Close open ttys */ if (svoie[voie]->niv1 == N_MBL && svoie[voie]->niv2 == 20 && svoie[voie]->niv3 > 0) { printf ("Closing tty %d\n", svoie[voie]->niv3); close (svoie[voie]->niv3); } } while (tete_cmd) { cptr = tete_cmd; tete_cmd = cptr->next; m_libere (cptr->action, strlen (cptr->action) + 1); m_libere (cptr, sizeof (cmdlist)); } #endif while (tete_pg) { lptr = tete_pg; tete_pg = tete_pg->suiv; m_libere (lptr, sizeof (pglist)); } } void affich_pg (int tp) { #ifdef __linux__ load_pg (); #endif #ifdef __WINDOWS__ load_pg (); #endif #ifdef __FBBDOS__ fen *fen_ptr; pglist *lptr; int size, nb_pg = 0; load_pg (); lptr = tete_pg; while (lptr) { ++nb_pg; lptr = lptr->suiv; } if (nb_pg == 0) return; size = (nb_pg > 19 * 7) ? 19 : 1 + nb_pg / 7; lptr = tete_pg; deb_io (); nb_pg = 0; fen_ptr = open_win (10, 2, 76, 4 + size, INIT, "PG"); while (lptr) { cprintf ("%-8s ", lptr->nom_pg); lptr = lptr->suiv; } attend_caractere (tp); close_win (fen_ptr); fin_io (); #endif } fbb-7.0.10/src/serv.c0000644000175000017500000004300513615603431011167 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * * SERV.C : Programme principal */ #define FBB_MAIN #define MAIN #ifdef __MSDOS__ #define PUBLIC #endif #include #include char *os (void) { #ifdef __FBBDOS__ static char *my_os = "MsDos"; #endif #ifdef __WINDOWS__ static char *my_os = "Windows"; #endif #ifdef __linux__ static char *my_os = "Linux"; #endif return (my_os); } #if defined(__WINDOWS__) || defined(__linux__) tp_ems t_ems[NB_EMS] = { {"MSG", EMS_MSG}, {"BID", EMS_BID}, {"HIE", EMS_HRT}, {"FWD", EMS_FWD}, {"REJ", EMS_REJ}, {"WPG", EMS_WPG}, {"SCR", 0}, }; static int out_file (int, char *); unsigned short xendien ( unsigned short xe1 ) { unsigned short xe2; xe2 = ( xe1 & 0x00FF ) << 8 ; xe2 |= ( xe1 & 0xFF00 ) >> 8 ; return xe2 ; } unsigned long xendienl ( unsigned long xe1 ) { unsigned long xe2; xe2 = ( xe1 & 0x000000FF ) << 24 ; xe2 |= ( xe1 & 0x0000FF00 ) << 8 ; xe2 |= ( xe1 & 0x00FF0000 ) >> 8 ; xe2 |= ( xe1 & 0xFF000000 ) >> 24 ; return xe2 ; } void sortie_prg (void) { static int done = 0; if (done) return; done = 1; if (*BBS_DW) { #if defined(__WINDOWS__) || defined(__FBBDOS__) send_dos (5, BBS_DW, NULL); #endif #ifdef __linux__ char *pptr = BBS_DW; call_nbdos (&pptr, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #endif } write_heard (); /* #ifdef __WIN32__ EndThread(); #endif */ if (operationnel >= 0) { operationnel = FALSE; flush_wp_cache (); dde_wp_serv = 0; ferme_log (); #ifdef TRACE close_trace (); #endif } /* Dealloue les listes chainees */ end_pg (); /* Dealloue la chaine des PG */ end_watchdog (); end_messages (); end_admin (); end_textes (); /* end_ports (); */ end_arbre (); end_bbs (); end_parts (); end_hold (); end_themes (); end_swap (); end_beacon (); end_wp (); end_lzhuf (); end_fwd (); /* end_voies (); */ end_modem (); end_exms (); } #endif /* __WINDOWS__ */ #ifdef __FBBDOS__ /********* Test overflow ********** long maxrec; ********** Fin du test ***********/ #define BREAK tp_ems t_ems[NB_EMS] = { {"MSG", EMS_MSG}, {"BID", EMS_BID}, {"HIE", EMS_HRT}, {"FWD", EMS_FWD}, {"REJ", EMS_REJ}, {"WPG", EMS_WPG}, {"SCR", EMS_SCR}, }; /* extern unsigned _stklen = 17408; / 16384 ; / 12000 */ extern unsigned _stklen = 32768; /* 16384 ; / 12000 */ static char nom_programme[80]; static void init_mem (void); static int out_file (int, char *); /* Routine appelee avant le _exit -> directive pragma */ void sortie_prg (void) { static int done = 0; if (done) return; done = 1; if (*BBS_DW) send_dos (5, BBS_DW, NULL); write_heard (); if (operationnel >= 0) { operationnel = FALSE; flush_wp_cache (); dde_wp_serv = 0; ferme_log (); #ifdef TRACE close_trace (); #endif libere_xems (); remet_vecteurs (); } cprintf ("Exiting %d ...", type_sortie); sleep (2); sleep (2); if (!EGA) /* outportb(0x3d9, 0x0) */ ; else ega_close (); close_win (fen_dos); /* Dealloue les listes chainees */ end_pg (); /* Dealloue la chaine des PG */ end_watchdog (); end_messages (); end_admin (); end_textes (); end_ports (); end_arbre (); end_bbs (); end_parts (); end_hold (); end_themes (); end_swap (); end_beacon (); end_wp (); end_lzhuf (); end_fwd (); end_voies (); end_modem (); end_exms (); end_dll (); /* remet_dos(); */ /* Fortify_OutputAllMemory(); Fortify_DumpAllMemory(0); Fortify_LeaveScope(); */ } #ifdef __FBBDOS__ #pragma exit sortie_prg #endif main (int ac, char **av) { int voie; /* ind_noeud null_cur; daemon_mode = 0; strcpy(null_cur.indic, "NULL"); */ accept_connection = FALSE; Fortify_EnterScope (); Fortify_CheckAllMemory (); init_semaine (); /* #if FBB_DEBUG */ init_debug (_CS); /* #endif */ operationnel = -1; df ("main", 3); /* debut_fonction("main", 3, MK_FP(_SS, _BP)); */ #ifdef BREAK break_stop (); #endif strcpy (nom_programme, av[0]); vlang = -1; init_mem (); if ((ac < 2) || (strcmp (av[1], "-t") != 0)) boot_prg (); #ifdef __MSDOS__ fprintf (stderr, "\nMSDOS defined main() INITIALISATION\n"); initialisations (); #endif #ifndef BREAK dprintf ("Break off !\r\n"); #endif /* chmod(nom_programme, S_IREAD); */ /*cprintf("Voie = %d\r\n", sizeof(Svoie)); */ /*cprintf("Port = %d\r\n", sizeof(defport)); */ /*cprintf("Fwd = %d\r\n", sizeof(Forward)); */ /*sleep_(5); */ operationnel = 1; display_screen (); for (voie = 1; voie < NBVOIES; voie++) programm_indic (voie); accept_connection = TRUE; kernel (); ff (); return (0); } static void init_mem (void) { #ifndef __DPMI16__ FILE *fp; int i; char ligne[256]; char *ptr = ligne; char *scan; if ((fp = fopen ("INIT.SRV", "r")) == NULL) { #ifdef ENGLISH cprintf ("Cannot open file INIT.SRV \r\n\a"); #else cprintf ("Erreur ouverture fichier INIT.SRV\r\n\a"); #endif curon (); exit (0); } i = 0; while (fgets (ligne, 250, fp)) { ptr = sup_ln (ligne); if (*ligne == '#') continue; i++; if (i == 36) { int ems = atoi (ptr); /* in_exms = 0; */ if (ems < 0 || ems > 2) ems = 0; strtok (ptr, " ,\t"); if (ems == 2) { while (scan = strtok (NULL, " ,\t")) { strupr (scan); if (strcmp ("OVR", scan) == 0) { if (_OvrInitExt (0L, 0L) == 0) { cprintf ("XMS driver initialized\r\n"); /* sleep(5); */ } else { cprintf ("XMS driver not found\r\n"); curon (); exit (1); } } } } break; } } ferme (fp, 57); #endif } void break_stop (void) { bdos (0x33, 0x00, 0x31); /* Driver transparent */ setcbrk (0); /* breaks inhibes */ } void break_ok (void) { bdos (0x33, 0x00, 0x30); /* Driver non transparent */ setcbrk (1); /* breaks valides */ } #endif /* __FBBDOS__ */ void sleep_ (unsigned sec) { #ifdef __WINDOWS__ WinSleep (sec); #endif #ifdef __FBBDOS__ long temps; long tempo; temps = btime (); for (;;) { tempo = btime (); if (tempo < temps) break; if (tempo > (temps + (long) (sec * 18))) break; } /* tempo = sec * 18 ; while (tempo) ; */ /* attend_caractere(sec); */ #endif } void clear_inbuf (int voie) { lbuf *bptr; while (svoie[voie]->inbuf.tete) { bptr = svoie[voie]->inbuf.tete->suite; svoie[voie]->memoc -= svoie[voie]->inbuf.tete->lgbuf; m_libere ((char *) svoie[voie]->inbuf.tete->buffer, svoie[voie]->inbuf.tete->lgbuf); m_libere ((char *) svoie[voie]->inbuf.tete, sizeof (lbuf)); svoie[voie]->inbuf.tete = bptr; } svoie[voie]->inbuf.nblig = svoie[voie]->inbuf.nbcar = svoie[voie]->inbuf.nocar = 0; svoie[voie]->inbuf.curr = NULL; svoie[voie]->inbuf.ptr = NULL; } void init_timout (int voie) { time_att[voie] = svoie[voie]->timout; } void init_langue (int voie) { int v, cpt, lutil, luse, lang; nlang = svoie[voie]->finf.lang; if (nlang >= maxlang) nlang = 0; vlang = -1; for (cpt = 0; cpt < NBLANG; cpt++) { if (langue[cpt]->numlang == nlang) { vlang = cpt; break; } } if (vlang == -1) { /* swapp de la langue la moins utilisee */ lutil = MAXVOIES; for (lang = 0; lang < NBLANG; lang++) { if (langue[lang]->numlang == -1) { vlang = lang; break; } luse = 0; for (v = 0; v < NBVOIES; v++) { if ((voie != v) && (svoie[v]->sta.connect) && (svoie[v]->finf.lang == lang)) ++luse; } if (luse < lutil) { lutil = luse; vlang = lang; } } swap_langue (vlang, nlang); } Oui = *(langue[vlang]->plang[OUI - 1]); Non = *(langue[vlang]->plang[NON - 1]); } int nbl_page (int voie) { int lig; if (voie == CONSOLE) #ifdef __WINDOWS__ lig = get_win_lig (CONSOLE) - 1; #elsif __FBBDOS__ lig = (doub_fen) ? separe - (M_LIG + 2) : h_screen - console - (M_LIG + 1); #else lig = svoie[voie]->finf.nbl - 1; #endif else lig = svoie[voie]->finf.nbl - 1; return (lig); } void prog_more (int voie) { if (!(PAG (svoie[voie]->finf.flags)) || (FOR (svoie[voie]->mode)) || ((voie_forward (voie)) && (voie != CONSOLE)) || ((voie == CONSOLE) && (print)) || (svoie[voie]->binary) || (POP ( no_port(voie)))) { svoie[voie]->lignes = -1; } else { svoie[voie]->lignes = nbl_page (voie); } svoie[voie]->stop = 0; } /* Substitue les variables : */ /* mode = 1 : $W = \r */ /* mode = 2 : $W = \n */ /* mode = 3 : $W = \r\n */ static char *expand_txt (int mode, char *texte) /* Fin de ligne = Return */ { static char sbuffer[600]; char *ptr; char c; int var = 0; int nb = 0; ptr = NULL; while (1) { if (nb > 590) break; if (var) { if (*ptr) { sbuffer[nb] = *ptr++; nb++; } else var = 0; } else { if ((c = *texte++) == '\0') break; if (c == '$') { if ((c = *texte++) == '\0') break; if (c == 'W') { /* Fin de ligne */ switch (mode) { case 1: sbuffer[nb++] = '\r'; break; case 2: sbuffer[nb++] = '\n'; break; case 3: sbuffer[nb++] = '\r'; sbuffer[nb++] = '\n'; break; } } else { ptr = variable (c); var = 1; } } else if (c == '%') { if ((c = *texte++) == '\0') break; ptr = alt_variable (c); var = 1; } else { sbuffer[nb] = c; nb++; } } } sbuffer[nb] = '\0'; return (sbuffer); } char *expand (char *texte) /* Fin de ligne = LF */ { return (expand_txt (2, texte)); } char *var_txt (char *texte) /* Fin de ligne = Return */ { return (expand_txt (1, texte)); } char *var_crlf (char *texte) /* Fin de ligne = Return/LineFeed */ { return (expand_txt (3, texte)); } int outfich (char *nomfich) { /* Sortie avec variables */ return (out_file (1, nomfich)); } int outfichs (char *nomfich) { /* Sortie sans variables */ return (out_file (0, nomfich)); } int out_file (int var, char *nomfich) { int nb; char sbuffer[300]; FILE *fptr; if ((fptr = fopen (nomfich, "rt")) != NULL) { while (fgets (sbuffer, 255, fptr)) { nb = strlen (sbuffer); if (var) out (sbuffer, nb); else outs (sbuffer, nb); } ferme (fptr, 48); return (TRUE); } return (FALSE); } char *who (char *ptr) { int i = 0, j; char s[80]; char freq[80]; for (i = 2; i < NBVOIES; i++) { if (svoie[i]->sta.connect) { j = 0; sprintf (freq, "(%s)", p_port[no_port (i)].freq); sprintf (s, "Ch. %-2d %9s : %6s-%-2d - %s\r", virt_canal (i), freq, svoie[i]->sta.indicatif.call, svoie[i]->sta.indicatif.num, strdate (svoie[i]->debut)); if (ptr) { strcpy (ptr, s); ptr += strlen (s); } else outs (s, strlen (s)); if (*(svoie[i]->sta.relais[j].call)) { sprintf (s, " via : %6s-%-2d", svoie[i]->sta.relais[j].call, svoie[i]->sta.relais[j].num); if (ptr) { strcpy (ptr, s); ptr += strlen (s); } else outs (s, strlen (s)); ++j; while (*(svoie[i]->sta.relais[j].call)) { if (j == 4) { if (ptr) { strcpy (ptr, "\r "); ptr += 9; } else outs ("\n ", 9); } sprintf (s, " %6s-%-2d", svoie[i]->sta.relais[j].call, svoie[i]->sta.relais[j].num); if (ptr) { strcpy (ptr, s); ptr += strlen (s); } else outs (s, strlen (s)); ++j; } if (ptr) { *ptr++ = '\r'; *ptr = '\0'; } else outsln (" ", 1); } } } return (ptr); } void maj_niv (int nivo1, int nivo2, int nivo3) { long caltemps; if (pvoie->niv1 != nivo1) { stemps[pvoie->niv1] += (time (&caltemps) - pvoie->tstat); pvoie->tstat = caltemps; } pvoie->niv1 = nivo1; pvoie->niv2 = nivo2; pvoie->niv3 = nivo3; status (voiecur); } int num_voie (char *indic_recherche) { int i; for (i = 0; i < NBVOIES; ++i) if (svoie[i]->sta.connect && indcmp (svoie[i]->sta.indicatif.call, indic_recherche)) return (i); return (-1); } int texte (int no) { int nl = 0; char *ptr; if (langue == NULL) return (nl); ptr = langue[vlang]->plang[no - 1]; /* cprintf("Texte : <%s>\r\n", ptr) ; */ if ((no > 0) && (no <= NBTEXT)) out (ptr, strlen (ptr)); while (*ptr) { if ((*ptr == '$') && (*(ptr + 1) == 'W')) ++nl; ++ptr; } return (nl); } int incindd (void) { if (*indd) { do { ++indd; } while ((*indd) && (*indd != '\n') && (!ISGRAPH (*indd))); } return (*indd); } void selvoie (int voie) { /* static int cv = -1; */ /* static Svoie curr; */ df ("selvoie", 1); /* if (voie != CONSOLE) selcanal(no_port(voie)) ; */ if (((voie >= 0) && (voie < NBVOIES)) || (voie == MWARNING)) { pvoie = svoie[voie]; voiecur = voie; ptmes = &(pvoie->entmes); } else fbb_error (ERR_CANAL, "Select channel", voie); ff (); } void deconnexion (int voie, int type) { if (voie == CONSOLE) { /* dprintf("deconnexion console\n"); */ if (pvoie->cross_connect != -1) { int save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); selvoie (save_voie); fin_tnc (); } svoie[voie]->sta.connect = 0; console_off (); maj_niv (0, 0, 0); aff_nbsta (); curseur (); if (svoie[voie]->l_yapp) { svoie[voie]->finf.lastyap = svoie[voie]->l_yapp; svoie[voie]->l_yapp = 0L; } if (svoie[voie]->curfwd) { svoie[voie]->curfwd->forward = -1; svoie[voie]->curfwd->no_bbs = 0; svoie[voie]->curfwd = NULL; } majinfo (voie, 2); #ifdef __FBBDOS__ clear_insert (); #endif libere_zones_allouees (voie); /* Vide les eventuelles listes */ aff_forward (); del_temp (voie); del_copy (voie); /* printf("Fin deconnexion console\n"); */ } else if (voie == INEXPORT) { svoie[voie]->sta.connect = 0; /* #ifdef __linux__ close(p_com[voie].comfd); p_com[voie].comfd = -1; / * libere le port * / #endif */ aff_event (voie, 2); maj_niv (0, 0, 0); aff_nbsta (); if (svoie[voie]->curfwd) { svoie[voie]->curfwd->forward = -1; svoie[voie]->curfwd->no_bbs = 0; svoie[voie]->curfwd = NULL; } /* majinfo(voie, 2); */ /* clear_insert(); */ libere_zones_allouees (voie); /* Vide les eventuelles listes */ aff_forward (); del_temp (voie); del_copy (voie); } else { dec (voie, type); } } void en_navant_toute (void) { } /* * Type = 0 : toutes les voies actives * 1 : pas la console * 2 : toutes les voies sauf la console */ int actif (int type) { int i, nb = 0; int val = (type == 2) ? 0 : 1; for (i = 1; i < NBVOIES; i++) { if (svoie[i]->sta.connect > val) nb++; } if ((type == 0) && (svoie[CONSOLE]->sta.connect)) nb++; return (nb); } char *d_disque (char *chaine) { static char s[256]; char *ptr; strcpy (s, DATADIR); ptr = s + strlen (s); while (*chaine) { *ptr++ = tolower (*chaine); ++chaine; } *ptr = '\0'; #ifdef __linux__ strcpy(s, back2slash(s)); #endif return (sup_ln (s)); } char *c_disque (char *chaine) { static char s[256]; char *ptr; strcpy (s, CONFDIR); ptr = s + strlen (s); while (*chaine) { *ptr++ = tolower (*chaine); ++chaine; } *ptr = '\0'; #ifdef __linux__ strcpy(s, back2slash(s)); #endif return (sup_ln (s)); } void test_disque (void) { #if defined(__WINDOWS__) || defined(__FBBDOS__) char texte[300]; unsigned long mfree; mfree = free_disk (0); #ifdef ENGLISH cprintf ("Disk space available : %ld \r\n\n", mfree); #else cprintf ("Espace disque disponible : %ld\r\n\n", mfree); #endif if (mfree < 1000L) { #ifdef ENGLISH sprintf (texte, "Warning ! Disk space available on disk %c: = %ld bytes. \r", getdisk () + 'A', mfree * 1024UL); #else sprintf (texte, "Attention ! Stockage disponible sur le disque %c: = %ld octets.\r", getdisk () + 'A', mfree * 1024UL); #endif cprintf (texte); if (w_mask & W_DISK) { #ifdef ENGLISH mess_warning (admin, "*** WARNING : DISK *** ", texte); #else mess_warning (admin, "*** ATTENTION DISQUE ***", texte); #endif } } #endif } int find (char *s) { char *t = s; int n = 0; int dernier = 0, chiffre = 0, lettre = 0; /* Pour valider 50MHz */ if (isdigit (s[0]) && isdigit (s[1])) return (FALSE); while (*t) { /*** Test rajoute ***/ if (!isalnum (*t)) return (FALSE); *t = toupper (*t); dernier = (isdigit (*t)); if (isdigit (*t)) ++chiffre; else ++lettre; ++t; ++n; } /* *t = '\0' ; */ if (strcmp ("SYSOP", s) == 0) return (TRUE); if (strcmp ("WP", s) == 0) return (TRUE); if (std_header & 4096) { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir au moins un chiffre * doit contenir au moins une lettre */ if ((n < 3) || (n > 6) || (chiffre < 1) || (lettre < 1)) return (FALSE); } else { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir 1 ou 2 chiffres * et finir par une lettre. */ if ((n < 3) || (n > 6) || (chiffre < 1) || (chiffre > 2) || dernier) return (FALSE); } return (TRUE); } fbb-7.0.10/src/nouvfwd.c0000644000175000017500000010462013613360505011701 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE NOUVFWD.C */ #include #include #define FDEBUG 0 static char checksum (char *); static void bin_hdr (char *, long); static void env_proposition (void); static void mode_binaire (int); static void mode_ascii (int); static void pas_de_message (void); static void recoit_titre (void); static void r_n_fwd (void); static void teste_suite (void); static int bloc_message (int); static int get_nouv_fwd (void); static int rcv_fb (int); static int rcv_fs (int); static int s_n_fwd (void); static int snd_fb (int); static int snd_fs (int); /* pvoie->temp2 = TRUE si je suis appelant */ #if defined(__WINDOWS__) || defined(__linux__) char *ffwd_str (int voie, char *s) { #define XMODLEN 44 static char stdesc[10][11] = { "Snd Prop ", "Wait FS/FF", "Wait Prop ", "Wait Msg ", "Rcv Msg ", "Snd Title ", "Snd Msg " }; char taille[40]; char nummes[40]; char offset[40]; int niv2 = svoie[voie]->niv2; int niv3 = svoie[voie]->niv3; *s = '\0'; if (niv2 == 5 && niv3 >= 0 && niv3 < 7) { if (svoie[voie]->tailm) sprintf (taille, "/%ld", svoie[voie]->tailm); else *taille = '\0'; if ((niv3 == 3) || (niv3 == 4)) sprintf (nummes, "#%d ", svoie[voie]->ind_mess + 1); else *nummes = '\0'; if ((niv3 == 4) || (niv3 == 6)) sprintf (offset, "%ld", svoie[voie]->enrcur); else *offset = '\0'; sprintf (s, "FbbFwd:%s %s%s%s", stdesc[niv3], nummes, offset, taille); } return (s); } #endif void new_fwd (void) { df ("new_fwd", 0); switch (pvoie->niv3) { case 0: env_proposition (); break; case 1: if (s_n_fwd ()) pvoie->ind_mess = -1; break; case 2: r_n_fwd (); break; case 3: while (pvoie->fb_mess[pvoie->ind_mess].type == '\0') { if (++pvoie->ind_mess >= 5) { teste_suite (); return; } } recoit_titre (); ch_niv3 (4); break; case 4: if (get_nouv_fwd ()) teste_suite (); break; case 5: env_message (); break; case 6: if (bin_message (pvoie->t_read) == 0) { ch_niv3 (5); tst_warning (ptmes); env_message (); } break; } ff (); } static void pactor_ident (void) { char buf[80]; char *noflag = "*N*"; if (!P_TOR (voiecur)) return; sprintf (buf, "; %d:%s de %s", actif (1), pvoie->sta.indicatif.call, mycall); if (noflag[1] != 'N') outln (buf, strlen (buf)); } static void env_proposition (void) { int nb; df ("env_proposition", 0); pvoie->enrcur = 0L; pvoie->tailm = 0L; if ((nb = snd_fb (voiecur)) != 0) { pvoie->ind_mess = nb; ch_niv3 (1); } else { if (pvoie->ind_mess == -2) { outln ("FQ", 2); pvoie->deconnect = 6; } else { pas_de_message (); } } ff (); } static void mess_cancel (char *texte) { int nb = strlen (texte); uchar buf[257]; buf[0] = CAN; buf[1] = nb; strcpy (buf + 2, texte); outs (buf, nb + 2); } void env_message (void) { char temp[128]; /* long mess_size; */ long nmess; int ratio; struct stat st; pvoie->seq = 0; for (;;) { if (pvoie->t_read) { nmess = pvoie->t_read->nmess; if (pvoie->binary) { /* Binaire */ if (pvoie->t_read->verb) { if (compress_mess (ch_record (NULL, nmess, '\0'))) { deb_io (); aff_header (voiecur); stat (mess_name (MBINDIR, nmess, temp), &st); ratio = 100 - (int) (((st.st_size - 6) * 100) / (ptmes->taille + 75)); if (ratio < 0) ratio = 0; #ifdef ENGLISH sprintf (temp, "Send compressed #%ld (%d%%) \r\n", nmess, ratio); #else sprintf (temp, "Envoie #%ld compress‚ (%d%%)\r\n", nmess, ratio); #endif winputs (voiecur, W_SNDT, temp); fin_io (); pvoie->enrcur = 0L; pvoie->tailm = st.st_size - 6; if (bin_message (pvoie->t_read)) { ch_niv3 (6); return; } else { /* Le message a ete envoye ... On attend */ pvoie->seq = 1; return; } } else { ch_niv3 (6); return; } } else { /* erreur ! */ sprintf (temp, "Msg #%ld does not exist !\r", nmess); mess_cancel (temp); pvoie->t_read = pvoie->t_read->suite; } } else { /* Ascii */ if (pvoie->t_read->verb) { if (bin_message (pvoie->t_read)) { ch_niv3 (6); return; } } else { sprintf (temp, "Msg #%ld does not exist !\r", nmess); outln (temp, strlen (temp)); pvoie->t_read = pvoie->t_read->suite; } } } else { pvoie->sr_mem = 0; mode_ascii (voiecur); ch_niv3 (2); return; } } } void mode_binaire (int voie) { df ("mode_binaire", 1); if (svoie[voie]->binary == 0) { time_yapp[voie] = -1; set_binary (voie, 1); /* Les BS ne sont pas autorises en binaire ... */ set_bs (voiecur, FALSE); } ff (); } void mode_ascii (int voie) { df ("mode_ascii", 1); if (svoie[voie]->binary) { set_binary (voie, 0); } ff (); } void recoit_titre (void) { df ("recoit_titre", 0); #if FDEBUG if (!svoie[CONSOLE]->connect) cprintf ("Temp1 : %d\n", pvoie->ind_mess); #endif *(ptmes) = pvoie->fb_mess[pvoie->ind_mess]; *(pvoie->appendf) = '\0'; *(pvoie->mess_bid) = '\0'; ptmes->theme = 0; ptmes->numero = 0L; ptmes->bin = 0; pvoie->chck = 0; pvoie->m_ack = 0; pvoie->messdate = time (NULL); pvoie->mess_num = -1; pvoie->enrcur = 0L; pvoie->tailm = 0L; swapp_bbs (ptmes); if ((*ptmes->bbsv == '\0') && (ptmes->type == 'P')) pvoie->m_ack = 1; if ((*ptmes->bbsv == '\0') && (ptmes->type == 'A')) ptmes->type = 'P'; ptmes->status = 'N'; if (*ptmes->bbsv) { if (((ptmes->type != 'P') && (ptmes->type != 'T') && (ptmes->type != 'A')) || (strcmp (ptmes->desti, "SYSOP") == 0)) { ptmes->status = '$'; } } reacheminement (); if (pvoie->binary) { char *ptr; if (ptype != HD) { err_new_fwd (0, 0); ff (); return; } indd = data + 2; ptr = indd; while (*ptr++); sscanf (ptr, "%ld", &pvoie->noenr_menu); if (pvoie->noenr_menu) old_part (pvoie->sta.indicatif.call, ptmes->bid); else part_file (pvoie->sta.indicatif.call, ptmes->bid); } else pvoie->noenr_menu = 0L; rcv_titre (); ptmes->taille = pvoie->noenr_menu; ff (); } int write_temp_bin (int voie, int all) { int fd; obuf *msgtemp; bullist *pbul = &svoie[voie]->entmes; df ("write_temp_bin", 1); if (svoie[voie]->msgtete == NULL) { ff (); return (1); } fd = open (svoie[voie]->sr_fic, O_WRONLY | O_APPEND | O_BINARY); if (fd != -1) { while ((msgtemp = svoie[voie]->msgtete) != NULL) { if ((!all) && (msgtemp->suiv == NULL)) break; if (write (fd, msgtemp->buffer, msgtemp->nb_car) != msgtemp->nb_car) { char buffer[128]; sprintf (buffer, "write_temp_bin : write %s", svoie[voie]->sr_fic); write_error (buffer); } svoie[voie]->memoc -= msgtemp->nb_car; svoie[voie]->msgtete = msgtemp->suiv; m_libere ((char *) msgtemp, sizeof (*msgtemp)); } close (fd); } else { char buffer[128]; sprintf (buffer, "write_temp_bin : open %s", svoie[voie]->sr_fic); write_error (buffer); } mod_part (svoie[voie]->sta.indicatif.call, pbul->taille, pbul->bid); ff (); return (1); } static int get_mess_bin (char clog, char *ptr, int nbcar) { int ncars, nb; obuf *msgtemp; char *ptcur; df ("get_mess_bin", 5); for (nb = 0; nb < nbcar; nb++) pvoie->chck += ptr[nb]; pvoie->enrcur += nbcar; nb = 0; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue (sizeof (obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; while (nbcar--) { ++pvoie->memoc; ++(ptmes->taille); *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue (sizeof (obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } msgtemp->nb_car = ncars; if (pvoie->memoc >= MAXMEM) { write_temp_bin (voiecur, FALSE); } nb = clog; /* Bidon ! */ ff (); return (0); } static int check_phase (ushort crc, long lg) { FILE *fptr; ushort tcrc; long tlg; if ((fptr = fopen (pvoie->sr_fic, "rb")) != NULL) { fseek (fptr, 20L, 0); if ((fread (&tcrc, sizeof (tcrc), 1, fptr)) && (fread (&tlg, sizeof (lg), 1, fptr))) { if (moto) { tcrc = xendien (tcrc); tlg = xendienl (tlg); } if ((tlg == lg) && (tcrc == crc)) { fclose (fptr); return (1); } } fclose (fptr); } return (0); } int get_nouv_fwd (void) { int nb; int nbcar; ushort crc; long lg; long numess; if (pvoie->deconnect) return (0); if (pvoie->binary) { switch (ptype) { case DT: nbcar = (data[1]) ? data[1] & 0xff : 256; if ((pvoie->noenr_menu) && (nbcar >= 6)) { for (nb = 2; nb < 8; nb++) pvoie->chck += data[nb]; memcpy (&crc, data + 2, sizeof (crc)); memcpy (&lg, data + 4, sizeof (lg)); if (moto) { crc = xendien (crc); lg = xendienl (lg); } if (!check_phase (crc, lg)) { del_part (voiecur, ptmes->bid); libere (voiecur); err_new_fwd (1, 14); return (0); } else { df ("DT_1", 0); get_mess_bin ('W', data + 8, nbcar - 6); ff (); } pvoie->noenr_menu = 0L; } else { df ("DT_2", 0); get_mess_bin ('W', data + 2, nbcar); ff (); } return (0); case ET: /* Fin du message */ df ("ET", 0); if (!write_temp_bin (voiecur, TRUE)) { ff (); return (0); } ff (); pvoie->chck += data[1]; if (pvoie->chck) { del_part (voiecur, ptmes->bid); libere (voiecur); err_new_fwd (1, 1); return (0); } else { /* On prevoie le numero !! */ numess = nomess + 1; if ((numess % 0x10000L) == 0) numess = nomess + 2; ptmes->numero = numess; /* pdebug(" (%d) decompress %ld", voiecur, numess); */ dde_huf (voiecur, ptmes, DECODE); #ifdef HUFF_TASK while (pvoie->ask == 0L) { deb_io (); zero_tic (); fin_io (); } #endif del_part (voiecur, ptmes->bid); ptmes->taille = pvoie->ask; pvoie->ask = 0L; pvoie->enrcur = 0L; if (ptmes->taille == -1L) { /* Erreur dans le decodage */ return (err_new_fwd (0, 2)); } else { char asc_file[130]; int test; if (pvoie->header) strn_cpy (6, ptmes->bbsf, pvoie->sta.indicatif.call); else *(ptmes->bbsf) = '\0'; ptmes->datesd = pvoie->messdate; ptmes->date = ptmes->datech = time (NULL); if (deja_recu (ptmes, 1, &test) == 1) { char temp[256]; /* Already received on another channel */ sprintf (temp, "Bid %s already received. Message discarded\r\n", ptmes->bid); winputs (voiecur, W_RCVT, temp); } else { if (!is_held (mess_name (MESSDIR, ptmes->numero, asc_file))) { /* On affecte le numero officiellement ! */ ptmes->numero = 0L; numess = ptmes->numero = next_num (); /* On valide le message */ put_mess_fwd ('W'); tst_sysop (ptmes->desti, numess); tst_serveur (ptmes); tst_ack (ptmes); tst_warning (ptmes); } } return (1); } } default: err_new_fwd (0, 3); return (0); } } return (get_mess_fwd ('W', indd, nb_trait, 2)); } void teste_suite (void) { df ("teste_suite", 0); #if FDEBUG if (!svoie[CONSOLE]->connect) cprintf ("Dans teste suite : ind_mess %d temp2 %d\n", pvoie->ind_mess, pvoie->temp2); #endif if (save_fic) { ++pvoie->sta.ack; pvoie->deconnect = 6; ff (); return; } while (++pvoie->ind_mess < 5) { if (pvoie->fb_mess[pvoie->ind_mess].type) { ch_niv3 (3); ff (); return; } } mode_ascii (voiecur); if (!pvoie->temp2) { #if FDEBUG if (!svoie[CONSOLE]->connect) cprintf ("Appel_rev 1\n"); #endif if (appel_rev_fwd (0)) { ch_niv3 (0); env_proposition (); } else { pas_de_message (); } } else { if ((pvoie->ind_mess = snd_fb (voiecur)) != 0) { ch_niv3 (1); } else { pas_de_message (); } } ff (); } void pas_de_message (void) { pvoie->ind_mess = -2; init_rec_fwd (voiecur); outln ("FF", 2); ch_niv3 (2); #if FDEBUG if (!svoie[CONSOLE]->connect) cprintf ("Pas de message voie %d\n", voiecur); #endif } /* reception forward */ void r_n_fwd (void) { int c, nb; long noprec = 0L; int chck; char *ligne = indd; char s[256]; if (*indd == ';') return; if (*indd != 'F') { if ((*indd != '\r') && (*indd != '*')) { err_new_fwd (0, 13); } else { mode_ascii (voiecur); pvoie->deconnect = 3; } return; } ++indd; c = *indd; incindd (); if (pvoie->ind_mess < 0) { if (pvoie->ind_mess == -1) { /* Marque les messages envoyes */ /* Eviter la proposition de messages "=" a chaque bloc */ noprec = pvoie->fb_mess[0].numero; for (nb = 0; nb < MAX_FB; nb++) { if (pvoie->fb_mess[nb].type == '\0') continue; *(ptmes) = pvoie->fb_mess[nb]; sprintf (s, "F %ld V:%s [%ld]", ptmes->numero, pvoie->sta.indicatif.call, ptmes->taille); fbb_log (voiecur, 'M', s); mark_fwd (voiecur, 0); noprec = 0L; } } init_rec_fwd (voiecur); pvoie->ind_mess = 0; } switch (c) { case 'A': case 'B': /* Recoit FB */ pvoie->chck += checksum (ligne); rcv_fb (voiecur); break; case '>': /* Recoit F> */ if (!is_room ()) { err_new_fwd (1, 15); break; } if (isxdigit (*indd)) { sscanf (indd, "%x", &chck); pvoie->chck += chck; if (pvoie->chck) { err_new_fwd (1, 4); break; } } nb = snd_fs (voiecur); ch_niv3 (3); pvoie->ind_mess = 0; #if FDEBUG if (!svoie[CONSOLE]->connect) cprintf ("Accepte %d messages\n", nb); #endif if (nb == 0) new_fwd (); break; case 'F': /* Recoit FF */ if (pvoie->temp2 == TRUE) { pvoie->ind_mess = -2; if (noprec == mess_suiv (voiecur)) { outln ("FQ", 2); pvoie->deconnect = 6; } else { ch_niv3 (0); env_proposition (); } } else { #if FDEBUG if (!svoie[CONSOLE]->connect) cprintf ("Appel_rev 2\n"); #endif if ((appel_rev_fwd (0)) && (noprec != mess_suiv (voiecur))) { ch_niv3 (0); env_proposition (); } else { outln ("FQ", 2); pvoie->deconnect = 6; } } break; case 'Q': /* recoit FQ Demande deconnection ... */ /* pvoie->deconnect = 6; Wait for remote disconnection (Winlink2000) */ break; default: err_new_fwd (0, 12); break; } } /* envoi forward */ int s_n_fwd (void) { int c; if (*indd == ';') return (0); if ((*indd == '\r') || (*indd == '*')) { mode_ascii (voiecur); pvoie->deconnect = 3; return (0); } if (*indd++ != 'F') { err_new_fwd (0, 5); return (0); } sup_ln (indd); c = *indd; incindd (); switch (c) { case 'F': ch_niv3 (0); env_proposition (); break; case 'S': if (rcv_fs (voiecur)) { ch_niv3 (5); env_message (); } else { ch_niv3 (2); } break; default: err_new_fwd (0, 6); break; } return (1); } /* Proposition de messages FB */ int not_in_fb_mess (long numero, int voie) { int nb = 0; while ((nb < MAX_FB) && (svoie[voie]->fb_mess[nb].type)) { if (svoie[voie]->fb_mess[nb].numero == numero) return (FALSE); nb++; } return (TRUE); } void init_fb_mess (int voie) { int nb; for (nb = 0; nb < MAX_FB; nb++) svoie[voie]->fb_mess[nb].type = '\0'; } static char checksum (char *s) { char chck = 0; while (*s) { chck += *s; ++s; } return (chck); } int check_dupes (int voie, int nb, char *exped, int tst_priv) { int i; for (i = 0; i < nb; i++) { if (strcmp (svoie[voie]->fb_mess[i].exped, exped) == 0) { if ((tst_priv) || (!PRIVATE (svoie[voie]->fb_mess[i].type))) return 1; } } return (0); } int snd_fb (int voie) { int ok = 0, nb; int nb_dupes = 0; int chk_dupes; int no_more = 0; int tst_priv = 1; long max_tfwd = 1024L * (long) p_port[no_port (voie)].maxbloc; char chck = 0; long tail_tmess = 0L; char mode; char s[80]; char *bbs_v; nb = 0; chk_dupes = ((svoie[voie]->typfwd & FWD_DUPES) == 0); init_fb_mess (voie); pactor_ident (); while (nb < MAX_FB) { if (tail_tmess > max_tfwd) break; for (;;) { if (!mess_suiv (voie)) { if ((nb_dupes) && (chk_dupes)) { svoie[voie]->nb_egal -= nb_dupes; nb_dupes = 0; chk_dupes = 0; continue; } else { no_more = 1; break; } } if (chk_dupes) { if ((tst_priv) && (!PRIVATE (svoie[voie]->entmes.type))) { svoie[voie]->nb_egal -= nb_dupes; nb_dupes = 0; tst_priv = 0; continue; } if (svoie[voie]->nb_egal == (NB_DEL - 1)) { svoie[voie]->nb_egal -= nb_dupes; nb_dupes = 0; chk_dupes = 0; continue; } if (!check_dupes (voie, nb, svoie[voie]->entmes.exped, tst_priv)) break; svoie[voie]->mess_egal[(int)svoie[voie]->nb_egal] = svoie[voie]->entmes.numero; ++(svoie[voie]->nb_egal); ++nb_dupes; } else break; } if (no_more) break; if (std_header & 16) { if (*svoie[voie]->entmes.bbsv == '\0') { strcpy (svoie[voie]->entmes.bbsv, mypath); } } if (*(svoie[voie]->entmes.bbsv) == '\0') { strcpy (svoie[voie]->entmes.bbsv, svoie[voie]->sta.indicatif.call); } if ((*(svoie[voie]->entmes.exped)) && (*(svoie[voie]->entmes.bbsv)) && (*(svoie[voie]->entmes.desti)) && (*(svoie[voie]->entmes.bid)) && (ISGRAPH (svoie[voie]->entmes.type))) { svoie[voie]->fb_mess[nb] = svoie[voie]->entmes; if (HIE (svoie[voie]->mode)) bbs_v = svoie[voie]->entmes.bbsv; else bbs_v = bbs_via (svoie[voie]->entmes.bbsv); if (svoie[voie]->prot_fwd & FWD_BIN) mode = 'A'; else mode = 'B'; if ((svoie[voie]->entmes.type == 'A') && (!ACQ (svoie[voie]->mode))) svoie[voie]->entmes.type = 'P'; sprintf (s, "F%c %c %s %s %s %s %ld\r", mode, svoie[voie]->entmes.type, svoie[voie]->entmes.exped, bbs_v, svoie[voie]->entmes.desti, svoie[voie]->entmes.bid, svoie[voie]->entmes.taille); outs (s, strlen (s)); chck += checksum (s); tail_tmess += svoie[voie]->entmes.taille; ++ok; ++nb; } else mark_fwd (voie, 0); } if (ok) { sprintf (s, "F> %02X\r", (-chck) & 0xff); outs (s, strlen (s)); } svoie[voie]->nb_egal -= nb_dupes; return (ok); } /* message a envoyer ou a marquer FS */ int rcv_fs (int voie) { long pos; int c, no = 0, nb = 0; rd_list *ptemp = NULL; char wtexte[256]; sup_ln (indd); libere_tread (voie); while ((c = *indd++) != 0) { if (no >= 5) return (err_new_fwd (0, 7)); svoie[voie]->fb_mess[no].taille = 0L; svoie[voie]->entmes = svoie[voie]->fb_mess[no]; switch (c) { case 'E': #ifdef ENGLISH sprintf (wtexte, "Msg #%ld from %s to %s@%s Bid:%s\rSubject: %s\rFormat error \r", svoie[voie]->entmes.numero, svoie[voie]->entmes.exped, svoie[voie]->entmes.desti, svoie[voie]->entmes.bbsv, svoie[voie]->entmes.bid, svoie[voie]->entmes.titre); if (w_mask & W_ERROR) mess_warning (admin, "*** FORMAT ERROR *** ", wtexte); #else sprintf (wtexte, "Msg #%ld de %s pour %s@%s Bid:%s\rSujet: %s\rErreur de format\r", svoie[voie]->entmes.numero, svoie[voie]->entmes.exped, svoie[voie]->entmes.desti, svoie[voie]->entmes.bbsv, svoie[voie]->entmes.bid, svoie[voie]->entmes.titre); if (w_mask & W_ERROR) mess_warning (admin, "*** ERREUR FORMAT ***", wtexte); #endif mark_fwd (voie, 0); svoie[voie]->fb_mess[no].type = '\0'; break; case 'R': #ifdef ENGLISH sprintf (wtexte, "Msg #%ld from %s to %s@%s Bid:%s\rSubject: %s\rRejected by %s\r", svoie[voie]->entmes.numero, svoie[voie]->entmes.exped, svoie[voie]->entmes.desti, svoie[voie]->entmes.bbsv, svoie[voie]->entmes.bid, svoie[voie]->entmes.titre, svoie[voie]->sta.indicatif.call); if (w_mask & W_REJECT) mess_warning (admin, "*** REJECTED MAIL *** ", wtexte); #else sprintf (wtexte, "Msg #%ld de %s pour %s@%s Bid:%s\rSujet: %s\rRejete par %s \r", svoie[voie]->entmes.numero, svoie[voie]->entmes.exped, svoie[voie]->entmes.desti, svoie[voie]->entmes.bbsv, svoie[voie]->entmes.bid, svoie[voie]->entmes.titre, svoie[voie]->sta.indicatif.call); if (w_mask & W_REJECT) mess_warning (admin, "*** COURRIER REJETE ***", wtexte); #endif mark_fwd (voie, 'R'); svoie[voie]->fb_mess[no].type = '\0'; break; case 'H': #ifdef ENGLISH sprintf (wtexte, "Msg #%ld from %s to %s@%s Bid:%s\rSubject: %s\rHeld by %s \r", svoie[voie]->entmes.numero, svoie[voie]->entmes.exped, svoie[voie]->entmes.desti, svoie[voie]->entmes.bbsv, svoie[voie]->entmes.bid, svoie[voie]->entmes.titre, svoie[voie]->sta.indicatif.call); if (w_mask & W_HOLD) mess_warning (admin, "*** HELD MAIL *** ", wtexte); #else sprintf (wtexte, "Msg #%ld de %s pour %s@%s Bid:%s\rSujet: %s\rRetenu par %s\r", svoie[voie]->entmes.numero, svoie[voie]->entmes.exped, svoie[voie]->entmes.desti, svoie[voie]->entmes.bbsv, svoie[voie]->entmes.bid, svoie[voie]->entmes.titre, svoie[voie]->sta.indicatif.call); if (w_mask & W_HOLD) mess_warning (admin, "*** COURRIER RETENU ***", wtexte); #endif if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { ptemp = (rd_list *) m_alloue (sizeof (rd_list)); svoie[voie]->t_read = ptemp; } ptemp->suite = NULL; ptemp->nmess = svoie[voie]->fb_mess[no].numero; ptemp->pmess = &(svoie[voie]->fb_mess[no]); ptemp->verb = 1; ++nb; break; case 'N': case '-': mark_fwd (voie, 0); svoie[voie]->fb_mess[no].type = '\0'; break; case 'L': case '=': svoie[voie]->fb_mess[no].type = '\0'; svoie[voie]->mess_egal[(int)svoie[voie]->nb_egal] = svoie[voie]->fb_mess[no].numero; ++(svoie[voie]->nb_egal); break; case 'A': case '!': pos = 0; while (isdigit (*indd)) { pos *= 10; pos += *indd - '0'; ++indd; } svoie[voie]->fb_mess[no].taille = pos; case 'Y': case '+': if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { ptemp = (rd_list *) m_alloue (sizeof (rd_list)); svoie[voie]->t_read = ptemp; } ptemp->suite = NULL; ptemp->nmess = svoie[voie]->fb_mess[no].numero; ptemp->pmess = &(svoie[voie]->fb_mess[no]); ptemp->verb = 1; ++nb; break; default: return (err_new_fwd (0, 8)); } ++no; } if (no != pvoie->ind_mess) { return (err_new_fwd (0, 9)); } if (nb) { svoie[voie]->enrcur = 0L; if (svoie[voie]->prot_fwd & FWD_BIN) mode_binaire (voie); return (1); /* return(snd_mess(voie, 1)) ; */ } return (0); } /* marquage d'un message par son id */ void mark_fwd (int voie, char mode) { /**************** ESSAI ******************/ switch (mode) { case 'R': sup_fwd (svoie[voie]->entmes.numero, FALSE, svoie[voie]->bbsfwd); break; case '\0': if ((svoie[voie]->entmes.status == '$') || (multi_prive)) sup_fwd (svoie[voie]->entmes.numero, TRUE, svoie[voie]->bbsfwd); else sup_fwd (svoie[voie]->entmes.numero, TRUE, 0); break; } svoie[voie]->entmes.type = '\0'; } int addr_check (char *s) { char *str = s; int nb = 0; while (*s) { if (*s == '.') { if (std_header & 2) nb = -10; else nb = 0; } else { if (nb == 6) { if (!(FOR (pvoie->mode))) { n_cpy (40, varx[0], str); texte (T_ERR + 17); } return (0); } ++nb; } ++s; } return (1); } int is_bid (char *bid) { char *ptr = bid; strupr (bid); if ((strlen (bid)) > 12) return (0); if (*bid == ' ') return (1); while (*bid) { if (ISGRAPH (*bid)) { *ptr++ = *bid; } ++bid; } *ptr = '\0'; return (1); } /* Marque un BID propose comme forwarde en retour */ void mark_reverse_bid (bullist * fb_mess, int nb, int *t_res) { int i; int pos; FILE *fptr; int nobbs = 0; bidfwd fwbid; bullist bul; mess_noeud *lptr; nobbs = svoie[voiecur]->bbsfwd; for (i = 0; i < nb; i++) { if (t_res[i] != 1) continue; pos = search_bid (fb_mess[i].bid); /* TESTER SI LE MESSAGE EST A FORWARDER POUR LA DIRECTION !! */ if (pos) { fptr = fopen (d_disque ("WFBID.SYS"), "r+b"); if (fptr == NULL) return; fseek (fptr, (long) pos * sizeof (bidfwd), 0); fread (&fwbid, sizeof (fwbid), 1, fptr); fclose (fptr); if ((lptr = findmess (fwbid.numero)) != NULL) { ouvre_dir (); read_dir (lptr->noenr, &bul); /* Marque le message F s'il etait a forwarder vers nobbs */ if (already_forw (bul.fbbs, nobbs)) sup_fwd (fwbid.numero, 1, nobbs); ferme_dir (); } } } } static int is_invalid (char *champ, int nb, int mode) { int error = 0; char *str = champ; char last = '\0'; while (*champ) { last = *champ; if (--nb >= 0) { if (!ISGRAPH (*champ)) { error = 1; break; } switch (mode) { case 1: if ((*champ == '@') || (*champ == '.')) error = 1; break; case 2: if (*champ == '@') error = 1; break; } if (error) break; } champ++; } if ((mode == 2) && ((std_header & 2) == 0) && (last == '.')) error = 1; if (nb < 0) error = 2; if (error) { char s[80]; sprintf (s, "Error in field (%s)\r", str); aff_bas (voiecur, W_CNST, s, strlen (s)); } return (error); } int rcv_fb (int voie) { int nb, i; char exped[80]; char desti[80]; char bbsv[80]; char bid[80]; bullist *mptr = &(svoie[voie]->fb_mess[svoie[voie]->ind_mess]); if (svoie[voie]->ind_mess >= 5) err_new_fwd (0, 10); for (i = 0; i < NBMASK; i++) mptr->fbbs[i] = mptr->forw[i] = '\0'; indd[80] = '\0'; nb = sscanf (indd, "%c %79s %79s %79s %79s %ld", &(mptr->type), exped, bbsv, desti, bid, &(mptr->taille)); if ((is_invalid (exped, 6, 1)) || (is_invalid (bbsv, 31, 2)) || (is_invalid (desti, 6, 1)) || (is_invalid (bid, 12, 0)) || (!is_bid (bid)) || (nb < 6)) { mptr->type = '\0'; } else { strcpy (mptr->exped, exped); strcpy (mptr->desti, desti); strcpy (mptr->bbsv, bbsv); strcpy (mptr->bid, bid); } ++svoie[voie]->ind_mess; if (!addr_check (mptr->bbsv)) { mptr->type = '\0'; return (0); } return (1); } int snd_fs (int voie) { int nb, total = 0; char chaine[80]; char s[80]; int t_res[MAX_FB]; char *ptr = chaine; char *tptr; pvoie->tailm = 0L; *ptr++ = 'F'; *ptr++ = 'S'; *ptr++ = ' '; for (nb = 0; nb < MAX_FB; nb++) t_res[nb] = 0; deja_recu (svoie[voie]->fb_mess, svoie[voie]->ind_mess, t_res); if (pvoie->fbb == 2) part_recu (svoie[voie]->fb_mess, svoie[voie]->ind_mess, t_res); for (nb = 0; nb < svoie[voie]->ind_mess; nb++) { niveau = nb; svoie[voie]->entmes = svoie[voie]->fb_mess[nb]; if (svoie[voie]->entmes.type == '\0') { if (pvoie->fbb == 2) t_res[nb] = 6; else t_res[nb] = 2; } if ((svoie[voie]->rev_mode == 0) && (t_res[nb] == 0)) t_res[nb] = 2; switch (t_res[nb]) { case 0: if (svoie[voie]->fbb >= 2) *ptr++ = 'Y'; /* Pas encore recu */ else *ptr++ = '+'; /* Pas encore recu */ ++total; break; case 1: if (svoie[voie]->fbb >= 2) *ptr++ = 'N'; /* Pas encore recu */ else *ptr++ = '-'; /* Deja recu */ sprintf (s, "N B:%s V:%s", svoie[voie]->entmes.bid, svoie[voie]->sta.indicatif.call); fbb_log (voie, 'M', s); svoie[voie]->fb_mess[nb].type = '\0'; break; case 2: if (svoie[voie]->fbb >= 2) *ptr++ = 'L'; /* Pas encore recu */ else *ptr++ = '='; /* En cours de reception -> differe */ svoie[voie]->fb_mess[nb].type = '\0'; break; case 3: if (svoie[voie]->fbb >= 2) *ptr++ = 'A'; /* Pas encore recu */ else *ptr++ = '!'; /* En partie recu. Demande la fin */ sprintf (s, "%ld", svoie[voie]->fb_mess[nb].taille); tptr = s; while (*tptr) *ptr++ = *tptr++; ++total; break; case 4: *ptr++ = 'R'; /* Rejete */ sprintf (s, "J B:%s V:%s", svoie[voie]->entmes.bid, svoie[voie]->sta.indicatif.call); fbb_log (voie, 'M', s); svoie[voie]->fb_mess[nb].type = '\0'; break; case 5: *ptr++ = 'H'; /* Retenu */ sprintf (s, "H B:%s V:%s", svoie[voie]->entmes.bid, svoie[voie]->sta.indicatif.call); fbb_log (voie, 'M', s); ++total; break; case 6: *ptr++ = 'E'; /* Erreur */ svoie[voie]->fb_mess[nb].type = '\0'; break; } } for (nb = svoie[voie]->ind_mess; nb < MAX_FB; nb++) svoie[voie]->fb_mess[nb].type = '\0'; *ptr = '\0'; outln (chaine, strlen (chaine)); send_buf (voie); mark_reverse_bid (svoie[voie]->fb_mess, svoie[voie]->ind_mess, t_res); if ((total) && (svoie[voie]->prot_fwd & FWD_BIN)) mode_binaire (voie); return (total); } int err_new_fwd (int no, int code) { static char cause[][80] = { "Binary packet is not of header (HD) type in title.", "Checsum of message is wrong.", "Message could not be uncompressed (CRC Error).", "Received binary frame is not DATA (DT), not EOT (ET).", "Checsum of proposals is wrong.", "Answer to proposals must start with \"F\" or \"**\".", "Answer to proposals must be either \"FF\" not \"FS\".", "More than 5 answers (with \"+\", \"-\" or \"=\") to proposals.", "Answer to proposal is not \"+\", \"-\" or \"=\".", "The number of answers does not match the number of proposals.", "More than 5 proposals have been received.", "The number of fields in a proposal is wrong (6 fields).", "Command must be \"FA\", \"FB\", \"F>\", \"FF\" or \"FQ\".", "Line starting with a letter which is not \"F\" or \"*\".", "Binary file has been changed.", "Disk full.", "Unknown protocol error." }; static char chaine[2][24] = { "*** Protocol error: %s", "*** Checksum error (%s)" }; char temp[250]; df ("err_new_fwd", 2); mode_ascii (voiecur); if (code > 16) code = 16; sprintf (temp, chaine[no], cause[code]); outln (temp, strlen (temp)); aff_etat ('E'); send_buf (voiecur); pvoie->deconnect = 3; ff (); return (0); } void init_rec_fwd (int voie) { int nb; pvoie->chck = 0; for (nb = 0; nb < MAX_FB; nb++) svoie[voie]->fb_mess[nb].type = '\0'; } static int bloc_message (int voie) { int i, nb = 0; FILE *fptr; char chaine[258]; unsigned mode; char *ptr; rd_list *ptemp = svoie[voie]->t_read; mode = (svoie[voie]->binary) ? O_BINARY : O_TEXT; if ((fptr = ouvre_mess (mode, ptemp->nmess, '\0')) != NULL) { fseek (fptr, svoie[voie]->enrcur, 0); fflush (fptr); while ((nb = read (fileno (fptr), chaine + 2, 250)) > 0) // while ((nb = read (fileno (fptr), chaine + 2, 256)) > 0) { if (nb) { if (svoie[voie]->binary) { chaine[0] = STX; chaine[1] = (nb == 256) ? 0 : nb; ptr = chaine + 2; for (i = 0; i < nb; i++) svoie[voie]->chck += *ptr++; outs (chaine, nb + 2); ptemp->pmess->taille += (long) (nb + 2); } else { outs (chaine + 2, nb); } } if (pvoie->memoc >= MAXMEM) { svoie[voie]->enrcur = ftell (fptr); break; } } ferme (fptr, 45); } else { /* Incident : Le message a ete supprime sur un autre voie. deconnection !! */ pvoie->deconnect = 6; return (1); } if (nb == 0) { if (svoie[voie]->binary) sendeot (-svoie[voie]->chck); else ctrl_z (); svoie[voie]->t_read = ptemp->suite; m_libere (ptemp, sizeof (rd_list)); svoie[voie]->enrcur = 0L; svoie[voie]->tailm = 0L; } return (nb); } static void bin_hdr (char *header, long pos) { int nb = 2; uchar buf[257]; uchar *ptr = buf; *ptr++ = SOH; ++ptr; strcpy (ptr, header); while (*ptr++) ++nb; sprintf (ptr, "%6ld", pos); while (*ptr++) ++nb; buf[1] = nb; outs (buf, nb + 2); pvoie->chck = 0; } int bin_message (rd_list * ptemp) /* Envoie un message */ { int i, nb = 0; char chaine[258]; FILE *fptr; char *ptr; pvoie->seq = 0; pvoie->sr_mem = 1; if (pvoie->enrcur == 0L) { pvoie->entmes = *(ptemp->pmess); if (pvoie->binary) { if (pvoie->fbb == 2) { if (pvoie->entmes.taille) { bin_hdr (pvoie->entmes.titre, pvoie->entmes.taille); if ((fptr = ouvre_mess (O_BINARY, pvoie->entmes.numero, '\0')) != NULL) { fflush (fptr); nb = read (fileno (fptr), chaine + 2, 6); ferme (fptr, 45); pvoie->enrcur = pvoie->entmes.taille; if (nb) { if (pvoie->binary) { chaine[0] = STX; chaine[1] = nb; ptr = chaine + 2; for (i = 0; i < nb; i++) pvoie->chck += *ptr++; outs (chaine, nb + 2); } /* Remet le compteur d'octets envoyes a 0 */ pvoie->entmes.taille = 0L; } else return (err_new_fwd (0, 14)); } else return (err_new_fwd (0, 14)); } else { pvoie->enrcur = 0L; bin_hdr (pvoie->entmes.titre, pvoie->entmes.taille); } } else { pvoie->enrcur = 2L; bin_hdr (pvoie->entmes.titre, pvoie->entmes.taille); } } else { entete_fwd (voiecur); } } if (bloc_message (voiecur)) return (1); pvoie->sr_mem = 0; return (0); } /* Envoie les messages ASCII de la liste */ int snd_mess (int voie, int type) { char header[160]; rd_list *ptemp; svoie[voie]->seq = 0; svoie[voie]->sr_mem = 1; while ((ptemp = svoie[voie]->t_read) != NULL) { if (trait_time > MAXTACHE) { svoie[voie]->seq = 1; return (1); } if (svoie[voie]->enrcur == 0L) { svoie[voie]->entmes = *(ptemp->pmess); if (svoie[voie]->binary) { bin_hdr (svoie[voie]->entmes.titre, 0L); make_header (&(svoie[voie]->entmes), header); entete_mess_fwd (&(svoie[voie]->entmes), header); } else { if (type == 2) entete_envoi_fwd (voie); entete_fwd (voie); } } if (bloc_message (voie)) return (1); tst_warning (ptmes); } svoie[voie]->sr_mem = 0; return (0); } fbb-7.0.10/src/reqdir.c0000644000175000017500000001705213613360505011501 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * REQDIR.C Server example. * * Version 1.1 01/01/92 * Version 1.2 05/05/92 * Version 1.3 05/23/92 * * * This server answers to a message like this : * * SP REQDIR < FC1EBN * *.ZIP @ F6ABJ * Text is not necessary * /EX * * by a message like this * * SP FC1EBN @ F6ABJ < F6FBB * Req Dir : *.ZIP * FBB.ZIP etc..... * /EX * * ============================================ * The server must APPEND its answer to MAIL.IN * file to avoid destroying existing mail. * ============================================ * * The server receives from FBB software 1 argument : * * argv[1] = Name of the file including the message received from FBB software. * * As this server opens the INIT.SRV file, it must be in the same directory. * */ #include #include #include #include #include #include #include #include #define MAX_DISK 8 void send_dir (FILE * fptr, char *base_dir, char *dir, int disk, int avail_disk[]); char *back2slash (char *str) { static char buf[256]; char *ptr = buf; int nb = 0; if ((strlen (str) > 2) && (str[1] == ':')) str += 2; while (*str) { if (*str == '\\') *ptr = '/'; else if (isupper (*str)) *ptr = tolower (*str); else *ptr = *str; ++ptr; ++str; if (++nb == 255) break; } *ptr = '\0'; return (buf); } int main (int argc, char **argv) { int i; int disk = 2; int avail_disk[MAX_DISK]; FILE *fptr; char *ptr; char *dir; char buffer[128]; char sender[80]; char route[80]; char path[80]; char bbs_call[80]; char base_dir[80]; char mail_in[80]; if (argc != 2) exit (1); /* Check the arguments */ dir = path; fptr = fopen (back2slash (argv[1]), "r"); /* Open the received message */ if (fptr == NULL) exit (1); fgets (buffer, 80, fptr); /* Read the command line */ sscanf (buffer, "%*s %*s %*s %s\n", sender); *dir = *route = '\0'; fgets (buffer, 80, fptr); /* Read the subject */ i = 0; ptr = buffer; while (*ptr) { /* No spaces */ if (!isspace (*ptr)) { if (isupper (*ptr)) buffer[i] = tolower (*ptr); /* Capitalise */ ++i; } ++ptr; } buffer[i] = '\0'; sscanf (buffer, "%[^@]%s", dir, route); /* Scan dir and route */ fclose (fptr); /* All needed is read */ unlink (back2slash(argv[1])); if (dir[1] == ':') { /* Checks asked disk */ disk = toupper (dir[0]) - 'A'; dir += 2; } if ((*dir == '\\') || (*dir == '/')) ++dir; if (*dir == '\0') strcpy (dir, "*.*"); /* All files ? */ *base_dir = '\0'; if (read_fbb_conf(NULL) > 0) exit (1); ptr = find_fbb_conf("call", 0); if (ptr == NULL) exit (1); /* and users base directory */ sscanf (ptr, "%[0-9A-Za-z]", bbs_call); /* Callsign */ ptr = find_fbb_conf("fbbd", 0); if (ptr == NULL) ptr = def_fbb_conf("fbbd"); if (ptr == NULL) exit (1); /* and users base directory */ ptr = strtok (ptr, ", \n"); /* Users directory */ for (i = 0; i < MAX_DISK; i++) { /* selects asked disk path */ if ((i == disk) && (ptr) && (*ptr != '*')) strcpy (base_dir, ptr); avail_disk[i] = ((ptr) && (*ptr != '*')); ptr = strtok (NULL, ", \n"); } ptr = find_fbb_conf("impo", 0); if (ptr == NULL) ptr = def_fbb_conf("impo"); if (ptr == NULL) exit (1); /* and users base directory */ sscanf (ptr, "%s", mail_in); /* Mail in file */ /* Append the answer to mail in file */ if ((fptr = fopen (back2slash (mail_in), "a")) != NULL) { fprintf (fptr, "#\r\n"); /* Tell that this is a message from this BBS */ fprintf (fptr, "SP %s %s < %s\r\n", sender, route, bbs_call); /* Command line */ send_dir (fptr, base_dir, dir, disk, avail_disk); fprintf (fptr, "\r\n/EX\r\n"); fclose (fptr); } exit (0); } int points (char *ptr) /* Looks for a ".." sequence in the path */ { while (*ptr) { if ((*ptr == '.') && (*(ptr + 1) == '.')) return (1); ++ptr; } return (0); /* ".." not fond ! */ } char *strupr (char *str) { char *tmp = str; while (*tmp) { if (islower (*tmp)) *tmp = toupper (*tmp); ++tmp; } return str; } int is_dir (char *path) { struct stat st; if (stat (path, &st) != -1) return ((st.st_mode & S_IFDIR) != 0); return 0; } int strmatch (char *chaine, char *masque) { while (1) { switch (*masque) { case '\0': return (toupper (*masque) == toupper (*chaine)); case '&': if ((*chaine == '\0') || (*chaine == '.')) return (1); break; case '?': if (!isalnum (*chaine)) return (0); break; case '#': if ((*chaine != '#') && (!isdigit (*chaine))) return (0); break; case '@': if (!isalpha (*chaine)) return (0); break; case '=': if (!isgraph (*chaine)) return (0); break; case '*': while (*++masque == '*') ; if (*masque == '\0') return (1); while (!strmatch (chaine, masque)) if (*++chaine == '\0') return (0); break; default: if ((toupper (*chaine)) != (toupper (*masque))) return (0); break; } ++chaine; ++masque; } } void send_dir (FILE * fptr, char *base_dir, char *dir, int disk, int avail_disk[]) { int i; int found = 0; char *ptr; char path[256]; char filename[256]; char mask[10]; sprintf (path, "%s/%s", base_dir, dir); /* Complete path */ ptr = path; while (*ptr) { if (*ptr == '\\') *ptr = '/'; else if (isupper (*ptr)) *ptr = tolower (*ptr); ++ptr; } if (is_dir (path)) { strcpy (mask, "*"); strcat (dir, "\\*.*"); } else { ptr = strrchr (path, '/'); if (ptr) { *ptr++ = '\0'; strcpy (mask, ptr); if (*path == '\0') strcpy (path, "/"); } } if (strcmp (mask, "*.*") == 0) strcpy (mask, "*"); fprintf (fptr, "ReqDir %c:\\%s\r\n", disk + 'A', dir); /* Subject */ fprintf (fptr, "\r\nReqDir V 1.5 for LINUX (C) F6FBB 1996-2000\r\nVolume %c: - Path \\%s\r\n\r\n", disk + 'A', dir); /* Subject */ fprintf (fptr, "Available volumes: "); for (i = 0; i < MAX_DISK; i++) if (avail_disk[i]) fprintf (fptr, "%c: ", i + 'A'); fprintf (fptr, "\r\n\r\n"); if (*base_dir) { struct dirent *dirent; DIR *dir; struct stat st; dir = opendir (path); if (dir) { while ((dirent = readdir (dir)) != NULL) { if (*dirent->d_name != '.') { found = 1; sprintf (filename, "%s/%s", path, dirent->d_name); if (stat (filename, &st) == -1) continue; if (st.st_mode & S_IFDIR) fprintf (fptr, " %s\n", strupr (dirent->d_name)); else if (strmatch(dirent->d_name, mask)) fprintf (fptr, "%12ld %s\n", st.st_size, strupr (dirent->d_name)); } } } if (!found) fprintf (fptr, "No file !\r\n"); } else fprintf (fptr, "Volume %c: does not exist !\r\n", disk + 'A'); } fbb-7.0.10/src/initfwd.c0000644000175000017500000006257213613360505011666 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Initialisation du buffer forward. */ #include #define NBCAS 3 /*static int niveau;*/ static int etat_bloc; static int nbif[NBCAS]; static int erreur_cron (int); static int fwd_commande (char *); static int tst_ligne (int); static char *analyse (char *, int *, int *); static void bip_select (char *); static void error_file (char *); static void gate_select (char *); static void init_buf_fwd_ems (void); static void list_select (char *); static void port_select (char *); static void reset_fwd_pointeurs (void); static void talk_select (char *); static void yapp_select (char *); #define MAX_NIVEAU 4 #define REJECT_FILE "REJECT.SYS" typedef struct { FILE *fp; char name[80]; int nolig; } File; static File file[MAX_NIVEAU]; static void error_file (char *str) { char wtexte[256]; deb_io (); #ifdef ENGLISH if (operationnel) { sprintf (wtexte, "\r\nError in file %s line %d : %s\r\n\a", file[niveau].name, file[niveau].nolig, str); if (w_mask & W_FILE) mess_warning (admin, "*** FILE ERROR *** ", wtexte); } sprintf (wtexte, "Error in file %s line %d : %s", file[niveau].name, file[niveau].nolig, str); #else if (operationnel) { sprintf (wtexte, "\r\nErreur fichier %s ligne %d : %s\r\n\a", file[niveau].name, file[niveau].nolig, str); if (w_mask & W_FILE) mess_warning (admin, "*** ERREUR FICHIER ***", wtexte); } sprintf (wtexte, "Erreur fichier %s ligne %d : %s", file[niveau].name, file[niveau].nolig, str); #endif fin_io (); win_message (5, wtexte); } #ifdef __FBBDOS__ static char *forward_sys[2] = {"forw_d.sys", "forward.sys"}; #endif #ifdef __WINDOWS__ static char *forward_sys[2] = {"forw_w.sys", "forward.sys"}; #endif #ifdef __linux__ static char *forward_sys[2] = {"forw_l.sys", "forward.sys"}; #endif void test_buf_fwd (void) { int nb_include = 0; int c; int scane = 0; int choix; char com_buf[80]; struct stat st; niveau = 0; memset (file, 0, sizeof (File) * MAX_NIVEAU); file[niveau].nolig = 0; choix = 0; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); if (file[niveau].fp == NULL) choix = 1; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); strcpy (file[niveau].name, forward_sys[choix]); reset_fwd_pointeurs (); etat_bloc = nbif[0] = nbif[1] = 0; if (file[niveau].fp) { fstat (fileno (file[niveau].fp), &st); if (time_include[nb_include++] != st.st_mtime) ++scane; do { while (fgets (com_buf, 80, file[niveau].fp)) { ++file[niveau].nolig; sup_ln (com_buf); c = fwd_commande (com_buf); if (c != '<') continue; if (nb_include >= include_size) { ++scane; break; } else { if (++niveau >= MAX_NIVEAU) { --niveau; break; } file[niveau].nolig = 0; strcpy (file[niveau].name, com_buf); if ((file[niveau].fp = fopen (c_disque (file[niveau].name), "rt")) != NULL) { fstat (fileno (file[niveau].fp), &st); if (time_include[nb_include++] != st.st_mtime) ++scane; } else { char str[256]; sprintf (str, "Cannot find include file %s", file[niveau].name); error_file (str); --niveau; break; } } } fclose (file[niveau].fp); } while (niveau--); } if (scane == 0) return; #ifdef __WINDOWS__ scan_fwd (1); #else p_forward = 1; maj_options (); init_buf_fwd (); aff_nbsta (); #endif } static int tst_ligne (int c) { int retour = 0; int c_save = c; char str[256]; #if 1 static unsigned char etat[NBCAS][29] = { {2, 0, 0, 1, 5, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4}, /* Hors bloc */ {0, 1, 1, 1, 5, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 6, 7, 4}, /* Dans bloc */ {0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0} /* Not (!) */ }; #else static unsigned char etat[NBCAS][29] = { {2, 0, 0, 1, 5, 0, 0, 0, 3, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 4}, {0, 0, 1, 1, 5, 0, 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 6, 7, 4}, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} }; #endif if (c == '-') c = 26; else if (c == '!') c = 27; else if (c == '@') c = 28; else { if (islower (c)) c -= 'a'; else c -= 'A'; } switch (etat[etat_bloc][c]) { case 0: /* Erreur */ sprintf (str, "Unknown ommand %c", c_save); error_file (str); retour = 1; break; case 1: /* Commande OK */ if (etat_bloc == 2) etat_bloc = 1; break; case 2: /* Debut de bloc */ etat_bloc = 1; nbif[1] = 0; break; case 3: /* IF */ nbif[(etat_bloc > 0) ? 1 : 0]++; break; case 4: /* ELSE */ if (nbif[(etat_bloc > 0) ? 1 : 0] == 0) { error_file ("else without if"); retour = 1; } break; case 5: /* ENDIF */ if (nbif[(etat_bloc > 0) ? 1 : 0]-- == 0) { error_file ("endif without if"); retour = 1; } break; case 6: /* Fin de bloc */ if ((etat_bloc == 0) || (nbif[1] != 0)) { error_file ("end of a non-existing block"); retour = 1; } etat_bloc = 0; break; case 7: /* NOT */ etat_bloc = 2; break; } return retour; } void end_fwd (void) { if (time_include) { m_libere (time_include, include_size * sizeof (long)); time_include = NULL; } } static void init_buf_fwd_ems (void) { int nb_include; int c; int choix; char com_buf[80]; char ligne[80]; char *ptr, *fwd_ptr; unsigned nb_car = 1; struct stat st; nb_include = 1; reset_fwd_pointeurs (); seek_exms_string (FORWARD, 0L); etat_bloc = nbif[0] = nbif[1] = 0; niveau = 0; memset (file, 0, sizeof (File) * MAX_NIVEAU); file[niveau].nolig = 0; choix = 0; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); if (file[niveau].fp == NULL) { choix = 1; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); } strcpy (file[niveau].name, forward_sys[choix]); if (file[niveau].fp) { do { while (fgets (com_buf, 80, file[niveau].fp)) { ++file[niveau].nolig; sup_ln (com_buf); c = fwd_commande (com_buf); if ((c == '*') || (c == '#') || (c == '\0')) continue; if (c == '<') { ++nb_include; if (++niveau >= MAX_NIVEAU) { --niveau; error_file ("Too much include levels"); for (niveau = 1; niveau < MAX_NIVEAU; ++niveau) { if (file[niveau].fp) fclose (file[niveau].fp); } nb_car = 1; niveau = 0; break; } file[niveau].nolig = 0; strcpy (file[niveau].name, com_buf); if ((file[niveau].fp = fopen (c_disque (file[niveau].name), "rt")) == NULL) { char str[256]; sprintf (str, "Cannot find include file %s", file[niveau].name); error_file (str); for (niveau = 1; niveau < MAX_NIVEAU; ++niveau) { if (file[niveau].fp) fclose (file[niveau].fp); } nb_car = 1; niveau = 0; break; } continue; } if (tst_ligne (c)) { nb_car = 1; break; } if (c == '!') { c = fwd_commande (com_buf); if (tst_ligne (c)) { nb_car = 1; break; } ++nb_car; } nb_car += (strlen (com_buf) + 2); } fclose (file[niveau].fp); } while (niveau--); if (nbif[0] != 0) { error_file ("endif missing"); nb_car = 1; } } if (nb_include != include_size) { if (time_include) m_libere (time_include, include_size * sizeof (long)); include_size = nb_include; time_include = (long *) m_alloue (include_size * sizeof (long)); } if (nb_car > 1) { niveau = 0; nb_include = 0; file[niveau].nolig = 0; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); strcpy (file[niveau].name, forward_sys[choix]); if (file[niveau].fp) { fstat (fileno (file[niveau].fp), &st); time_include[nb_include++] = st.st_mtime; do { while (fgets (com_buf, 80, file[niveau].fp)) { fwd_ptr = ligne; sup_ln (com_buf); c = fwd_commande (com_buf); if ((c == '*') || (c == '#') || (c == '\0')) continue; #if defined(__WINDOWS__) || defined(__linux__) if (c == 'A') { InitText (com_buf); } #endif if (c == '<') { ++niveau; file[niveau].nolig = 0; strcpy (file[niveau].name, com_buf); file[niveau].fp = fopen (c_disque (file[niveau].name), "rt"); if (file[niveau].fp == NULL) { for (niveau = 1; niveau < MAX_NIVEAU; ++niveau) { if (file[niveau].fp) fclose (file[niveau].fp); } nb_car = 1; niveau = 0; break; } fstat (fileno (file[niveau].fp), &st); time_include[nb_include++] = st.st_mtime; continue; } *fwd_ptr++ = c; if (c == '!') { c = fwd_commande (com_buf); *fwd_ptr++ = c; } ptr = com_buf; while ((*fwd_ptr++ = *ptr++) != '\0'); write_exms_string (FORWARD, ligne); } fclose (file[niveau].fp); } while (niveau--); } } ligne[0] = '\032'; ligne[1] = '\0'; write_exms_string (FORWARD, ligne); seek_exms_string (FORWARD, 0L); } void init_buf_fwd (void) { int nb_include; int c; int choix; char com_buf[80]; char *ptr, *fwd_ptr; unsigned nb_car = 1; struct stat st; if (EMS_FWD_OK ()) { init_buf_fwd_ems (); return; } nb_include = 1; reset_fwd_pointeurs (); etat_bloc = nbif[0] = nbif[1] = 0; niveau = 0; memset (file, 0, sizeof (File) * MAX_NIVEAU); file[niveau].nolig = 0; choix = 0; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); if (file[niveau].fp == NULL) { choix = 1; file[niveau].fp = fopen (c_disque (forward_sys[choix]), "rt"); } strcpy (file[niveau].name, forward_sys[choix]); if (file[niveau].fp) { do { while (fgets (com_buf, 80, file[niveau].fp)) { ++file[niveau].nolig; sup_ln (com_buf); c = fwd_commande (com_buf); if ((c == '*') || (c == '#') || (c == '\0')) continue; if (c == '<') { ++nb_include; if (++niveau >= MAX_NIVEAU) { --niveau; error_file ("too much include levels"); for (niveau = 1; niveau < MAX_NIVEAU; ++niveau) { if (file[niveau].fp) fclose (file[niveau].fp); } nb_car = 1; niveau = 0; break; } file[niveau].nolig = 0; strcpy (file[niveau].name, com_buf); if ((file[niveau].fp = fopen (c_disque (file[niveau].name), "rt")) == NULL) { char str[256]; sprintf (str, "Cannot find include file %s", file[niveau].name); error_file (str); for (niveau = 1; niveau < MAX_NIVEAU; ++niveau) { if (file[niveau].fp) fclose (file[niveau].fp); } nb_car = 1; niveau = 0; break; } continue; } if (tst_ligne (c)) { nb_car = 1; break; } if (c == '!') { c = fwd_commande (com_buf); if (tst_ligne (c)) { nb_car = 1; break; } ++nb_car; } nb_car += (strlen (com_buf) + 2); } fclose (file[niveau].fp); } while (niveau--); if (nbif[0] != 0) { error_file ("endif missing"); nb_car = 1; } } if (nb_car >= fwd_size) { if (fwd_file) m_libere (fwd_file, fwd_size); fwd_size = nb_car + nb_car / 5; fwd_file = m_alloue (fwd_size); } fwd_ptr = fwd_file; if (nb_include != include_size) { if (time_include) m_libere (time_include, include_size * sizeof (long)); include_size = nb_include; time_include = (long *) m_alloue (include_size * sizeof (long)); } if (nb_car > 1) { niveau = 0; nb_include = 0; file[niveau].nolig = 0; /* strcpy (file[niveau].name, "FORWARD.SYS"); */ file[niveau].fp = fopen (c_disque (file[niveau].name), "rt"); fstat (fileno (file[niveau].fp), &st); time_include[nb_include++] = st.st_mtime; if (file[niveau].fp) { do { while (fgets (com_buf, 80, file[niveau].fp)) { sup_ln (com_buf); c = fwd_commande (com_buf); if ((c == '*') || (c == '#') || (c == '\0')) continue; if (c == '<') { ++niveau; file[niveau].nolig = 0; strcpy (file[niveau].name, com_buf); file[niveau].fp = fopen (c_disque (file[niveau].name), "rt"); fstat (fileno (file[niveau].fp), &st); time_include[nb_include++] = st.st_mtime; continue; } *fwd_ptr++ = c; if (c == '!') { c = fwd_commande (com_buf); *fwd_ptr++ = c; } ptr = com_buf; while ((*fwd_ptr++ = *ptr++) != 0); } fclose (file[niveau].fp); } while (niveau--); } } *fwd_ptr = '\032'; } static void init_buf_rej_ems (void) { static int old_record_nb = 0; FILE *fp; int c; char mode; char type; char com_buf[80]; char exped[80]; char route[80]; char desti[80]; char bid[80]; int size; struct stat st; Rej_rec rej; unsigned record = 0; if ((stat (c_disque (REJECT_FILE), &st) == 0) && (st.st_mtime == t_rej)) return; t_rej = st.st_mtime; niveau = 0; memset (file, 0, sizeof (File) * MAX_NIVEAU); file[0].nolig = 0; strcpy (file[0].name, REJECT_FILE); fp = fopen (c_disque (REJECT_FILE), "rt"); if (fp) { while (fgets (com_buf, 80, fp)) { file[0].nolig++; sup_ln (strupr (com_buf)); c = *com_buf; if ((c == '#') || (c == '\0')) continue; if (sscanf (com_buf, "%c %c %s %s %s %s %d", &mode, &type, exped, route, desti, bid, &size) != 7) { error_file ("bad number of fields"); } if ((mode != 'H') && (mode != 'R') && (mode != 'L')) error_file ("bad mode (H, R or L)"); rej.mode = toupper (mode); rej.type = toupper (type); rej.size = size; strn_cpy (6, rej.exped, exped); strn_cpy (6, rej.via, route); strn_cpy (6, rej.desti, desti); strn_cpy (12, rej.bid, bid); write_rej (record, &rej); ++record; } fclose (fp); /* Invalide les anciens records */ rej.mode = '\0'; while (record < old_record_nb) { write_rej (record, &rej); ++record; } old_record_nb = record; } } void init_buf_rej (void) { if (EMS_REJ_OK ()) { init_buf_rej_ems (); return; } else { FILE *fp; int c; char com_buf[80], tp[80]; char *ptr, *rej_ptr; unsigned nb_car = 1; struct stat st; if ((stat (c_disque (REJECT_FILE), &st) == 0) && (st.st_mtime == t_rej)) return; t_rej = st.st_mtime; niveau = 0; memset (file, 0, sizeof (File) * MAX_NIVEAU); file[0].nolig = 0; strcpy (file[0].name, REJECT_FILE); fp = fopen (c_disque (REJECT_FILE), "rt"); if (fp) { while (fgets (com_buf, 80, fp)) { sup_ln (com_buf); c = *com_buf; if ((c == '#') || (c == '\0')) continue; nb_car += (strlen (com_buf) + 1); } } if (nb_car >= rej_size) { if (rej_file) m_libere (rej_file, rej_size); rej_size = nb_car + nb_car / 5; rej_file = m_alloue (rej_size); } rej_ptr = rej_file; if (fp) { rewind (fp); while (fgets (com_buf, 80, fp)) { file[0].nolig++; sup_ln (strupr (com_buf)); c = *com_buf; if ((c == '#') || (c == '\0')) continue; if (sscanf (com_buf, "%s %s %s %s %s %s %s", tp, tp, tp, tp, tp, tp, tp) != 7) { error_file ("bad number of fields"); } ptr = com_buf; while ((*rej_ptr++ = *ptr++) != '\0'); } fclose (fp); } *rej_ptr = '\032'; } } void end_swap (void) { if (swap_file) m_libere (swap_file, fwd_size); } void init_buf_swap (void) { FILE *fp; int c; char com_buf[80]; char *ptr, *swap_ptr; unsigned nb_car = 1; struct stat st; niveau = 0; memset (file, 0, sizeof (File) * MAX_NIVEAU); file[0].nolig = 0; strcpy (file[0].name, "SWAPP.SYS"); ptr = c_disque ("SWAPP.SYS"); strcpy (com_buf, ptr); if ((stat (com_buf, &st) == 0) && (st.st_mtime == t_swap)) return; t_swap = st.st_mtime; fp = fopen (c_disque ("SWAPP.SYS"), "rb"); if (fp) { while (fgets (com_buf, 80, fp)) { sup_ln (com_buf); c = fwd_commande (com_buf); if ((c == '#') || (c == '\0')) continue; nb_car += (strlen (com_buf) + 2); } } if (nb_car >= swap_size) { if (swap_file) m_libere (swap_file, fwd_size); swap_size = nb_car + nb_car / 5; swap_file = m_alloue (swap_size); } swap_ptr = swap_file; if (fp) { rewind (fp); while (fgets (com_buf, 80, fp)) { file[0].nolig++; sup_ln (strupr (com_buf)); c = fwd_commande (com_buf); if ((c == '#') || (c == '\0')) continue; if ((c != '<') && (c != '>') && (c != '@')) { error_file ("bad field specification (<, > of @)"); } *swap_ptr++ = c; ptr = com_buf; while ((*swap_ptr++ = *ptr++) != '\0'); } fclose (fp); } *swap_ptr = '\032'; } static void reset_fwd_pointeurs (void) { int port; Forward *pfwd; for (port = 0; port < NBPORT; port++) { if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { pfwd->fwdpos = 0; pfwd = pfwd->suite; } } } } static int fwd_commande (char *com_buf) { int type; char *ptr = com_buf, *lptr = com_buf; sup_ln (com_buf); while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; type = toupper (*ptr); ++ptr; if ((type == 'D') || (type == 'L') || (type == 'X')) { if (*ptr == 'C') { type = tolower (type); ++ptr; } } if ((type == 'E') && (toupper (*ptr) == 'L')) type = '@'; if (type != '!') while (ISGRAPH (*ptr)) ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; if (type == 'P') { swap_port (ptr); } while ((*lptr++ = *ptr++) != '\0'); return (type); } void end_bbs (void) { if (bbs_ptr) m_libere (bbs_ptr, 7 * NBBBS); bbs_ptr = NULL; } void init_bbs (void) { FILE *fichier; char chaine[80], bbs[80]; char *ptr; int i; int nb = 0; int tot = 0; struct stat st; if ((stat (c_disque ("BBS.SYS"), &st) == 0) && (st.st_mtime == t_bbs)) return; t_bbs = st.st_mtime; #ifdef __linux__ #ifdef ENGLISH if (!operationnel) cprintf ("BBS set-up \n"); #else if (!operationnel) cprintf ("Initialisation BBS\n"); #endif #else #ifdef ENGLISH if (!operationnel) cprintf ("BBS set-up \r\n"); #else if (!operationnel) cprintf ("Initialisation BBS\r\n"); #endif #endif if (bbs_ptr == NULL) { bbs_ptr = m_alloue (7 * NBBBS); } ptr = bbs_ptr; if ((fichier = fopen (c_disque ("BBS.SYS"), "rt")) != NULL) { while (fgets (chaine, 78, fichier)) { int itmp; sup_ln (chaine); if (*chaine == '#') continue; *bbs = '\0'; sscanf (chaine, "%d %s", &itmp, bbs); #if defined(__WINDOWS__) || defined(__linux__) if (*bbs) { char text[80]; ++tot; sprintf (text, "%d: %s", tot, bbs); InitText (text); } #endif for (i = 0; i < 6; i++) *ptr++ = bbs[i]; *ptr++ = '\001'; if (++nb == NBBBS) break; } fclose (fichier); } } static int type_commande (char *com_buf) { int type; char *ptr = com_buf, *lptr = com_buf; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; type = toupper (*ptr); if ((type == 'E') && (toupper (*(ptr + 1)) == 'L')) type = '@'; while (ISGRAPH (*ptr)) ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; while ((*lptr++ = *ptr++) != '\0'); sup_ln (com_buf); return (type); } void cron (long h_time) { FILE *fptr; char com_buf[80]; int cptif = 0; int lig = 0; int fin = 0; int modif = 0; int temp; char *cronname; aff_etat ('C'); #ifdef __FBBDOS__ cronname = "cron_d.sys"; #endif #ifdef __WINDOWS__ cronname = "cron_w.sys"; #endif #ifdef __linux__ cronname = "cron_l.sys"; #endif if ((fptr = fopen (c_disque (cronname), "rt")) == NULL) { if ((fptr = fopen (c_disque ("cron.sys"), "rt")) == NULL) { aff_etat ('A'); return; } } while ((!fin) && (fgets (com_buf, 80, fptr))) { ++lig; sup_ln (com_buf); if (*com_buf == '#') continue; switch (type_commande (com_buf)) { case 'E': /* ENDIF */ if (cptif) --cptif; else fin = erreur_cron (lig); break; case '@': /* ELSE */ if (cptif) { temp = cptif - 1; while (cptif != temp) { if (fgets (com_buf, 80, fptr) == NULL) { fin = erreur_cron (lig); break; } ++lig; switch (type_commande (com_buf)) { case 'I': ++cptif; break; case 'E': if (cptif) --cptif; else fin = erreur_cron (lig); break; default: break; } } } else fin = erreur_cron (lig); break; case 'I': ++cptif; if (tst_fwd (com_buf, 0, h_time, 0, NULL, 1, -1) == FALSE) { temp = cptif - 1; while (cptif != temp) { if (fgets (com_buf, 80, fptr) == NULL) { fin = erreur_cron (lig); break; } ++lig; switch (type_commande (com_buf)) { case 'I': ++cptif; break; case 'E': if (cptif) --cptif; else fin = erreur_cron (lig); break; case '@': if (cptif == (temp + 1)) ++temp; break; default: break; } } } break; case 'D': /* Dos */ if (strncmpi (com_buf, "PTCTRX", 6) == 0) { ptctrx (0, com_buf); } else { #if defined(__WINDOWS__) || defined(__FBBDOS__) send_dos (1, com_buf, NULL); #endif #ifdef __linux__ char *pptr = com_buf; call_nbdos (&pptr, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #endif } break; case 'X': /* Dos */ if (strncmpi (com_buf, "PTCTRX", 6) == 0) { ptctrx (0, com_buf); } else { #if defined(__WINDOWS__) || defined(__FBBDOS__) send_dos (2, com_buf, NULL); #endif #ifdef __linux__ char *pptr = com_buf; call_nbdos (&pptr, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #endif } break; case 'T': /* Talk */ talk_select (com_buf); modif = 1; break; case 'B': /* Bip */ bip_select (com_buf); modif = 1; break; case 'G': /* Gate */ gate_select (com_buf); modif = 1; break; case 'L': /* Unproto Lists */ list_select (com_buf); break; case 'M': /* Modification des parametres du port */ port_select (com_buf); break; case 'Y': /* Yapp */ yapp_select (com_buf); break; } } fclose (fptr); aff_etat ('A'); #if defined(__WINDOWS__) || defined(__linux__) if (modif) { maj_menu_options (); } #endif } static char *analyse (char *text, int *port, int *rep) { char temp[40]; char val[40]; int i; *port = 0; for (i = 0; *text; ++i, ++text) { if (isspace (*text)) break; temp[i] = *text; } temp[i] = '\0'; while ((*text) && (isspace (*text))) ++text; for (i = 0; *text; ++i, ++text) { if (isspace (*text)) break; val[i] = *text; } val[i] = '\0'; while ((*text) && (isspace (*text))) ++text; if (*val) *rep = *val; else *rep = *temp; if (*temp) { swap_port (temp); if (isdigit (*temp)) *port = *temp - '0'; else *port = *temp - '@'; } return (text); } static void talk_select (char *text) { int port, rep; analyse (text, &port, &rep); ok_tell = (rep != 'N'); } static void bip_select (char *text) { int port, rep; analyse (text, &port, &rep); bip = (rep != 'N'); } static void gate_select (char *text) { int p; int port, rep; analyse (text, &port, &rep); for (p = 1; p < NBPORT; p++) { if ((port == 0) || (p == port)) { if (rep == 'N') p_port[p].moport &= (~0x10); else p_port[p].moport |= 0x10; } } } static void yapp_select (char *text) { int p; int port, rep; analyse (text, &port, &rep); for (p = 1; p < NBPORT; p++) { if ((port == 0) || (p == port)) { if (rep == 'N') p_port[p].moport &= (~0x04); else p_port[p].moport |= 0x04; } } } static void list_select (char *text) { int p; int port, rep; analyse (text, &port, &rep); for (p = 1; p < NBPORT; p++) { if ((port == 0) || (p == port)) { if (rep == 'N') p_port[p].moport &= (~0x20); else p_port[p].moport |= 0x20; } } } static void port_select (char *text) { int p; int port, rep; int min, per; char *fwd_mp; fwd_mp = analyse (text, &port, &rep); for (p = 1; p < NBPORT; p++) { if ((port == 0) || (p == port)) { switch (rep) { case 'G': p_port[p].moport &= 0xf8; p_port[p].moport |= 1; break; case 'B': p_port[p].moport &= 0xf8; p_port[p].moport |= 2; break; case 'U': p_port[p].moport &= 0xf8; break; } if (*fwd_mp) { if (sscanf (fwd_mp, "%d/%d", &min, &per) == 2) { p_port[p].min_fwd = min; p_port[p].per_fwd = per; } } } } } static int erreur_cron (int lig) { char wtexte[200]; deb_io (); #ifdef ENGLISH sprintf (wtexte, "\r\nError in CRON.SYS file line %d \r\n\a", lig); if (w_mask & W_FILE) mess_warning (admin, "*** FILE ERROR *** ", wtexte); #else sprintf (wtexte, "\r\nErreur fichier CRON.SYS ligne %d\r\n\a", lig); if (w_mask & W_FILE) mess_warning (admin, "*** ERREUR FICHIER ***", wtexte); #endif cprintf ("%s\r\n",wtexte); sleep_ (5); fin_io (); return (1); } fbb-7.0.10/src/watchdog.c0000644000175000017500000001003513613360505012005 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * WATCHDOG.C * */ #include static int watch_option = 0; #ifdef __WINDOWS__ #ifdef __WIN32__ static HANDLE watchfd; #else static int watchfd; #endif #endif /* WINDOWS */ /*************************************** * Specifie un port pour le watchdog : * 0 = rien * 1 = lpt1 * 2 = lpt2 * etc... * 81 = com1 * 82 = coim2 * etc... ****************************************/ void init_watchdog (int val) { #ifdef __WINDOWS__ char str[80]; DCB dcb; int error; if (val == 0) return; if (val > 80) wsprintf (str, "LPT%d", val - 80); else wsprintf (str, "COM%d", val); #ifdef __WIN32__ watchfd = CreateFile (str, GENERIC_READ | GENERIC_WRITE, 0, // exclusive access NULL, // no security attrs OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_OVERLAPPED, NULL); if (watchfd == INVALID_HANDLE_VALUE) return; #else watchfd = OpenComm (str, 64, 64); if (watchfd < 0) { /* Erreur ouverture COM */ char title[80]; wsprintf (title, "Error Watchdog %d", val); ShowError (title, "OpenComm :", 0); return; } #endif if (val < 80) { memset ((char *) &dcb, '\0', sizeof (DCB)); wsprintf (str, "COM%d:9600,n,8,1", val); error = BuildCommDCB (str, &dcb); #ifdef __WIN32__ error = SetCommState (watchfd, &dcb); #else error = SetCommState (&dcb); #endif } watch_option = val; #endif } void end_watchdog (void) { #ifdef __WINDOWS__ int ret; if (!watch_option) { return; } #ifdef __WIN32__ if (watchfd != INVALID_HANDLE_VALUE) { // EscapeCommFunction (ptrcom->comfd, SETXON); if (!CloseHandle (watchfd)) { char title[80]; wsprintf (title, "Error watchdog %d", watch_option); ShowError (title, "CloseComm :", ret); } watchfd = INVALID_HANDLE_VALUE; } #else if (watchfd != -1) { if ((ret = CloseComm (watchfd)) < 0) { char title[80]; wsprintf (title, "Error watchdog %d", watch_option); ShowError (title, "CloseComm :", ret); } watchfd = -1; } #endif #endif watch_option = 0; } void watchdog (void) { #ifdef __WINDOWS__ time_t temps; static int car = 0; static time_t prev = 0; int nb; int err; if (!watch_option) { return; } temps = time (NULL); if (temps == prev) return; prev = temps; car = !car; #ifdef __WIN32__ { DWORD lpErrors = 0L; char title[80]; /* Get the first spurious error */ ClearCommError (watchfd, &lpErrors, NULL); ClearCommError (watchfd, &lpErrors, NULL); if (lpErrors & (CE_PTO | CE_IOE | CE_DNS)) { wsprintf (title, "Error watchdog %d", watch_option); ShowError (title, "Device not ready, watchdog disabled :", lpErrors); end_watchdog (); return; } } if (!WriteFile (watchfd, &car, 1, &nb, NULL)) { char title[80]; wsprintf (title, "Error watchdog %d", watch_option); ShowError (title, "WriteComm :", nb); return; } #else nb = WriteComm (watchfd, &car, 1); if (nb < 0) { char title[80]; while (err = GetCommError (watchfd, NULL)) { fbb_warning (9, "Send error : ", err); } wsprintf (title, "Error watchdog %d", watch_option); ShowError (title, "WriteComm :", nb); return; } #endif #endif } fbb-7.0.10/src/fbbgetconf.c0000644000175000017500000000553513613360505012315 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #define ENGLISH /* * This program returns values from the fbb configuration values * */ #include #include #include #include #include #include #ifdef __linux__ #include #include #else #include #include #endif #include #include char *conffile = NULL; void usage(void); void usage() { fprintf(stderr, "\nfbbgetconf v%s\n", VERSION); fprintf(stderr, "Usage : fbbgetconf [-a] [-d] [-h] [-f configfile] [key] [key] ...\n"); } int main(int ac, char **av) { int c = 0; int list_all = 0; int list_def = 0; while ((c = getopt(ac, av, "adhf:")) != -1) { switch (c) { case 'a': list_all = 1; break; case 'd': list_def = 1; break; case 'f': conffile = optarg; break; case 'h': usage(); exit(0); } } if (ac == 1) { usage(); exit(0); } if (read_fbb_conf(conffile) > 0) { #ifdef ENGLISH fprintf(stderr, "Cannot open fbb configuration file \n"); #else fprintf(stderr, "Erreur ouverture fichier de configuration\n"); #endif exit(1); /* and users base directory */ } if (list_all) { char *ptr; while ((ptr = get_fbb_all(1)) != NULL) { printf("%s\n", ptr); free(ptr); } return 0; } if (list_def) { char *ptr; while ((ptr = get_fbb_def(1)) != NULL) { printf("%s\n", ptr); free(ptr); } return 0; } while (optind < ac) { char *key = av[optind]; char *ptr; ptr = find_fbb_conf(key, 0); if (ptr == NULL) ptr = def_fbb_conf(key); if (ptr == NULL) { #ifdef ENGLISH fprintf(stderr, "Unknown keyword %s\n", key); #else fprintf(stderr, "Mot clé %s inconnu\n", key); #endif exit(1); } printf("%s\n", ptr); free(ptr); while (ptr) { ptr = find_fbb_conf(key, 1); if (ptr) { printf("%s\n", ptr); free(ptr); } } ++optind; } return 0; } fbb-7.0.10/src/epurwp.c0000644000175000017500000004177313747456632011563 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #define ENGLISH /* * Mise a jour des WP en fonction de la date * */ #include #include #include #include #include #include #ifdef __linux__ #include #include #else #include #include #endif #include #include #ifdef __linux__ #define __a2__ __attribute__ ((packed, aligned(2))) #define O_BINARY 0 #define _read read #define _write write #else #define __a2__ #endif #define uchar unsigned char #define lcall unsigned long typedef struct { /* 194 bytes */ char callsign[7]; char name[13]; uchar free; uchar changed; unsigned short seen; long last_modif __a2__; long last_seen __a2__; char first_homebbs[41]; char secnd_homebbs[41]; char first_zip[9]; char secnd_zip[9]; char first_qth[31]; char secnd_qth[31]; } Wps; lcall zone[1000]; int addr_check = 1; int ext_call = 0; unsigned deb_zone; long tst_date; long kill_date; long heure; long record = 0L; long lines_out = 0L; long record_in = 0L; long record_out = 0L; long update = 0L; long destroy = 0L; long dupes = 0L; Wps rec; char wp_sys[256]; char wp_old[256]; char wp_mess[256]; char upd_file[256]; char compte_rendu[256]; void defauts (int, int); void print_compte_rendu (void); void strn_cpy (char *, char *, int); void init_zone (long); void add_zone (Wps *); char *date_mbl_new (long); char *strdt (long); void wp_message (Wps *); lcall call2l (char *); int addr_ok (char *s); int find (char *); int copy_ (char *, char *); int check_record (Wps * rec); FILE *fpti; FILE *fpto; FILE *fptr_mess; FILE *fptr_upd; #ifdef __linux__ char *strupr (char *str) { char *tmp = str; while (*tmp) { if (islower (*tmp)) *tmp = toupper (*tmp); ++tmp; } return str; } char *strlwr (char *str) { char *tmp = str; while (*tmp) { if (isupper (*tmp)) *tmp = tolower (*tmp); ++tmp; } return str; } long filelength (int fd) { struct stat st; int val; val = fstat (fd, &st); if (val == -1) return (-1L); return (st.st_size); } #endif char *test_back_slash (char *chaine) { static char temp[256]; strcpy(temp, chaine); if ((strlen(temp) == 0) #ifdef __linux__ || (temp[strlen (temp) - 1] != '/')) strcat(temp, "/"); #else || (temp[strlen (temp) - 1] != '\\')) strcat(temp, "\\"); #endif return (temp); } void err_keyword(char *keyword) { fprintf(stderr, "Error : keyword \"%s\"missing in fbb.conf file\n", keyword); exit(1); } void epure (char *ligne) { int lg; lg = strlen (ligne); if (ligne[lg - 1] == '\n') ligne[lg - 1] = '\0'; lg = strlen (ligne); if (ligne[lg - 1] == '\r') ligne[lg - 1] = '\0'; if (*ligne == '\032') *ligne = '\0'; } int main (int ac, char **av) { int status; int jours = 40; int obsolete = 90; int deb_zone = 0xffff; *upd_file = '\0'; if ((ac >= 2) && (strcmp (strupr (av[1]), "/H") == 0)) { fprintf (stderr, "\nEPURWP V%s\n", VERSION); fprintf (stderr, "format : EPURWP [upd-days [kill-days [update-file]]]\n"); fprintf (stderr, "defaults: upd-days = 40\n kill-days= 90\n\n"); fprintf (stderr, "If temporary part is stable during \"upd-days\" days,\n"); fprintf (stderr, "temporary part updates main part of WP\n\n"); fprintf (stderr, "If the callsign is not seen during \"kill-days\" days,\n"); fprintf (stderr, "callsign is deleted from WP database\n\n"); fprintf (stderr, "\"update-file\" stores the WP records corresponding to the\n"); fprintf (stderr, "updates in a file which can be processed later (eg for statistics)\n\n"); exit (0); } if (strncmp (strupr (av[ac - 1]), "/NOC", 4) == 0) { addr_check = 0; --ac; } if (ac >= 2) jours = atoi (av[1]); if (ac >= 3) obsolete = atoi (av[2]); if (ac >= 4) strcpy (upd_file, av[3]); /* if (ac >= 4) deb_zone = (unsigned)atoi(av[3]) * 1000; */ fprintf (stderr, "\nEpurwp V%s\n\n", VERSION); heure = time (NULL); defauts (jours, obsolete); #ifdef ENGLISH fprintf (stderr, "Updating white pages database \n"); fprintf (stderr, " Update time is %d days\n", jours); if (obsolete) fprintf (stderr, " Delete time is %d days\n\n", obsolete); #else fprintf (stderr, "Mise … jour de la base de donn‚es\n"); fprintf (stderr, " D‚lai : %d jours\n", jours); if (obsolete) fprintf (stderr, " Suppression : %d jours\n\n", obsolete); #endif if ((fptr_mess = fopen (wp_mess, "at")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Cannot create '%s' \n", wp_mess); #else fprintf (stderr, "Erreur creation '%s'\n", wp_mess); #endif exit (1); } #ifdef ENGLISH fprintf (stderr, "%s - Saves WP.SYS file into WP.OLD file \n\n", date_mbl_new (time (NULL))); #else fprintf (stderr, "%s - Sauvegarde du fichier WP.SYS en WP.OLD\n\n", date_mbl_new (time (NULL))); #endif if (!copy_ (wp_sys, wp_old)) { unlink (wp_old); exit (2); } if ((fpti = fopen (wp_old, "rb")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Cannot open '%s' \n", wp_old); #else fprintf (stderr, "Erreur ouverture '%s'\n", wp_old); #endif exit (3); } if ((fpto = fopen (wp_sys, "wb")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Cannot open '%s' \n", wp_sys); #else fprintf (stderr, "Erreur ouverture '%s'\n", wp_sys); #endif exit (4); } if (*upd_file) { if ((fptr_upd = fopen (upd_file, "ab")) == NULL) { #ifdef ENGLISH fprintf (stderr, "Cannot open '%s' \n", upd_file); #else fprintf (stderr, "Erreur ouverture '%s'\n", upd_file); #endif exit (5); } } else fptr_upd = NULL; init_zone (filelength (fileno (fpti)) / (long) sizeof (Wps)); while (fread (&rec, sizeof (Wps), 1, fpti)) { status = check_record (&rec); if (record_in >= deb_zone) add_zone (&rec); if (status == 2) ++update; if (status) { if (fwrite (&rec, sizeof (Wps), 1, fpto) == 0) { #ifdef ENGLISH fprintf (stderr, "Error while writing file '%s'\n", wp_sys); #else fprintf (stderr, "Erreur ecriture fichier '%s' \n", wp_sys); #endif exit (1); } ++record_out; } else if (rec.last_modif) ++destroy; if ((*rec.callsign) && ((++record % 100) == 0)) #ifdef __linux__ fprintf (stderr, "\nRecord %ld", record); #else fprintf (stderr, "\rRecord %ld", record); #endif ++record_in; } #if 0 memset (&rec, '\0', sizeof (Wps)); while (record_out < record_in) { fseek (fpto, record_out * sizeof (Wps), SEEK_SET); if (fwrite (&rec, sizeof (Wps), 1, fpto) == 0) { #ifdef ENGLISH fprintf (stderr, "Error while writing file '%s'\n", wp_sys); #else fprintf (stderr, "Erreur ecriture fichier '%s' \n", wp_sys); #endif exit (1); } ++record_out; } #endif if (fptr_upd) fclose (fptr_upd); fclose (fpti); fclose (fpto); fclose (fptr_mess); fprintf (stderr, "\rRecord %ld\n\n", record); print_compte_rendu (); return (0); } void init_zone (long lg) { int i; long nbbloc = (lg / 1000L) + 1L; if (deb_zone == 0xffff) deb_zone = 1000 * (unsigned) (heure % nbbloc); /* printf("%ld records, %ld blocs, heure = %ld zone = %u\n", lg, nbbloc, heure, deb_zone); */ for (i = 0; i < 1000; i++) zone[i] = 0L; } int is_dupe (Wps * rec) { lcall lc; int i; lc = call2l (rec->callsign); for (i = 0; i < 1000; i++) { if (lc == zone[i]) { ++dupes; fprintf (stderr, "\rRecord %ld (%s) duplicated\n", record, rec->callsign); return (1); } } return (0); } void add_zone (Wps * rec) { static int index = 0; if (index == 1000) return; zone[index++] = call2l (rec->callsign); } int check_record (Wps * rec) { int modif = 1; rec->callsign[6] = '\0'; rec->name[12] = '\0'; rec->first_homebbs[40] = '\0'; rec->secnd_homebbs[40] = '\0'; rec->first_zip[8] = '\0'; rec->secnd_zip[8] = '\0'; rec->first_qth[30] = '\0'; rec->secnd_qth[30] = '\0'; if ((!find (rec->callsign)) || (*rec->first_homebbs == '\0') || (*rec->first_homebbs == '?')) return (0); if ((addr_check) && (!addr_ok (rec->first_homebbs))) { return (0); } if (is_dupe (rec)) return (0); if (rec->last_seen < kill_date) { /* Entree obsolete */ return (0); } if (rec->last_modif < tst_date) { /* Mise a jour */ if (strncmp (rec->first_homebbs, rec->secnd_homebbs, 40) != 0) { strn_cpy (rec->first_homebbs, rec->secnd_homebbs, 40); modif = 2; } if (strncmp (rec->first_zip, rec->secnd_zip, 8) != 0) { strn_cpy (rec->first_zip, rec->secnd_zip, 8); modif = 2; } if (strncmp (rec->first_qth, rec->secnd_qth, 30) != 0) { strn_cpy (rec->first_qth, rec->secnd_qth, 30); modif = 2; } } if (rec->changed) { wp_message (rec); rec->changed = 0; } return (modif); } void print_compte_rendu (void) { FILE *fcr; #ifdef ENGLISH printf ("\n"); printf ("WP updated : %5ld total records \n", record); printf (" : %5ld updated record(s) \n", update); printf (" : %5ld deleted record(s) \n", destroy); printf (" : %5ld WP update line(s) \n\n", lines_out); if ((fcr = fopen (compte_rendu, "wt")) != NULL) { fprintf (fcr, "%ld\n\n", heure); fprintf (fcr, "WP updated : %5ld total record(s) \n", record); fprintf (fcr, " : %5ld updated record(s) \n", update); fprintf (fcr, " : %5ld deleted records(s) \n", destroy); fprintf (fcr, " : %5ld WP update line(s) \n\n", lines_out); fprintf (fcr, "Start computing : %s\n", strdt (heure)); fprintf (fcr, "End computing : %s\n", strdt (time (NULL))); fclose (fcr); } #else printf ("\n"); printf ("Pages Blanches : %5ld enregistrement(s)\n", record); printf (" : %5ld mise(s) … jour \n", update); printf (" : %5ld suppression(s) \n", destroy); printf (" : %5ld lignes de m.a.j. \n\n", lines_out); if ((fcr = fopen (compte_rendu, "wt")) != NULL) { fprintf (fcr, "%ld\n\n", heure); fprintf (fcr, "Pages Blanches : %5ld enregistrement(s)\n", record); fprintf (fcr, " : %5ld mise(s) … jour \n", update); fprintf (fcr, " : %5ld suppression(s) \n", destroy); fprintf (fcr, " : %5ld lignes de m.a.j. \n\n", lines_out); fprintf (fcr, "Debut du traitement : %s\n", strdt (heure)); fprintf (fcr, "Fin du traitement : %s\n", strdt (time (NULL))); fclose (fcr); } #endif } void defauts (int jours, int obsolete) { unsigned int flag; char *ptr; char system_dir[256]; char temp[20]; if (read_fbb_conf(NULL) > 0) { #ifdef ENGLISH fprintf (stderr, "Cannot open fbb.conf file \n"); #else fprintf (stderr, "Erreur ouverture fichier fbb.conf\n"); #endif exit (1); /* and users base directory */ } ptr = find_fbb_conf("vers", 0); if (ptr == NULL) { #ifdef ENGLISH fprintf (stderr, "Version number missing in fbb.conf\n"); #else fprintf (stderr, "Pas de numéro dans le fbb.conf\n"); #endif exit (1); } sprintf (temp, "FBB%s", VERSION); /* Only test the major number ... */ if (strncasecmp (temp, ptr, 4) != 0) { #ifdef ENGLISH fprintf (stderr, "Wrong version number in fbb.conf\n"); #else fprintf (stderr, "Numéro de version erroné dans fbb.conf\n"); #endif exit (1); } #ifdef __linux__ fprintf (stderr, "Configuration version : %s\n", ptr); #else fprintf (stderr, "Configuration version : %s\r", ptr); #endif /* path of conf files */ ptr = find_fbb_conf("data", 0); if (ptr == NULL) ptr = def_fbb_conf("data"); if (ptr == NULL) err_keyword("data"); strcpy (system_dir, test_back_slash(strlwr (ptr))); /* flags */ ptr = find_fbb_conf("fbbf", 0); if (ptr == NULL) ptr = def_fbb_conf("fbbf"); if (ptr == NULL) err_keyword("fbbf"); flag = 0; sscanf (ptr, "%s %u", temp, &flag); ext_call = ((flag & 4096) != 0); #ifdef __linux__ sprintf (wp_sys, "%swp/wp.sys", system_dir); sprintf (wp_old, "%swp/wp.old", system_dir); sprintf (wp_mess, "%swp/mess.wp", system_dir); strcpy (compte_rendu, "epurwp.res"); #else sprintf (wp_sys, "%sWP\\WP.SYS", system_dir); sprintf (wp_old, "%sWP\\WP.OLD", system_dir); sprintf (wp_mess, "%sWP\\MESS.WP", system_dir); strcpy (compte_rendu, "EPURWP.RES"); #endif tst_date = heure - (long) jours *86400L; kill_date = heure - (long) obsolete *86400L; } char *strdt (long temps) { struct tm *sdate; static char cdate[80]; sdate = localtime (&temps); #ifdef ENGLISH sprintf (cdate, "%02d-%02d-%02d %02d:%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min); #else sprintf (cdate, "%02d/%02d/%02d %02d:%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100, sdate->tm_hour, sdate->tm_min); #endif return (cdate); } char *date_mbl_new (long temps) { struct tm *sdate; static char cdate[40]; sdate = localtime (&temps); #ifdef ENGLISH sprintf (cdate, "%02d-%02d-%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday); #else sprintf (cdate, "%02d/%02d/%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100); #endif return (cdate); } void strn_cpy (char *dest, char *source, int len) { for (;;) { if ((len-- == 0) || (*source == '\0')) break; *dest++ = *source++; } *dest = '\0'; } int find (char *s) { char *t = s; int n = 0; int dernier = 0, chiffre = 0, lettre = 0; while (isalnum (*t)) { *t = toupper (*t); dernier = (isdigit (*t)); if (isdigit (*t)) ++chiffre; else ++lettre; ++t; ++n; } *t = '\0'; if (ext_call) { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir au moins un chiffre * doit contenir au moins une lettre */ if ((n < 3) || (n > 6) || (chiffre < 1) || (lettre < 1)) return (0); } else { /* * L'indicatif doit avoir entre 3 et 6 caracteres . * doit contenir 1 ou 2 chiffres . * ne doit pas se terminer par un chiffre . */ if ((n < 3) || (n > 6) || (chiffre < 1) || (chiffre > 2) || dernier) return (0); } return (1); } static char *wp_date_mbl (long temps) { struct tm *sdate; static char cdate[7]; sdate = localtime (&temps); sprintf (cdate, "%02d%02d%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday); return (cdate); } void wp_message (Wps * rec) { if (fptr_upd) { fwrite (rec, sizeof (Wps), 1, fptr_upd); } if ((rec->changed == 'U') || (rec->changed == 'G') || (rec->changed == 'I')) { fprintf (fptr_mess, "On %s %s/%c @ %s zip %s %s %s\n", wp_date_mbl (rec->last_modif), rec->callsign, rec->changed, (*rec->secnd_homebbs) ? rec->secnd_homebbs : "?", (*rec->secnd_zip) ? rec->secnd_zip : "?", (*rec->name) ? rec->name : "?", (*rec->secnd_qth) ? rec->secnd_qth : "?" ); ++lines_out; } } #if 0 int copy_ (char *oldfich, char *newfich) { char s[256]; #ifdef __linux__ sprintf (s, "cp %s %s > /dev/null", oldfich, newfich); #else sprintf (s, "COPY %s %s > NUL", oldfich, newfich); #endif system (s); return (1); } #endif #define TAIBUF 16384 static char buffer[TAIBUF]; int copy_ (char *oldfich, char *newfich) { int retour = 1; int fd_orig; int fd_dest; int nb_lus; int ret; int dest_access; if ((fd_orig = open (oldfich, O_RDONLY | O_BINARY, S_IREAD | S_IWRITE)) == EOF) { fprintf (stderr, "Cannot find %s\n", oldfich); return (0); } dest_access = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY; if ((fd_dest = open (newfich, dest_access, S_IREAD | S_IWRITE)) == EOF) { close (fd_orig); fprintf (stderr, "Cannot create %s\n", newfich); return (0); } for (;;) { nb_lus = _read (fd_orig, buffer, TAIBUF); if (nb_lus == -1) { retour = 0; break; } if (nb_lus == 0) { retour = 1; break; } ret = _write (fd_dest, buffer, nb_lus); if (ret != nb_lus) { retour = 0; break; } } close (fd_orig); close (fd_dest); return (retour); } lcall call2l (char *callsign) { char *ptr = callsign; int c; lcall val = 0L; while ((c = (int) *ptr++) != 0) { if (c < 48) return (0xffffffffL); c -= 47; if (c > 10) { c -= 7; if (c > 36) { return (0xffffffffL); } else if (c < 11) { return (0xffffffffL); } } val *= 37; val += c; } return (val); } int addr_ok (char *s) { int nb = 0; int total = 0; while (*s) { if (*s == '.') { nb = 0; } else { if (nb == 6) { return (0); } ++nb; } ++s; if (++total == 31) return (0); } return (1); } fbb-7.0.10/src/mbl_rev.c0000644000175000017500000002432413613360505011641 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module MBL_REV.C */ #include "aff_stat.c" #define REV_HOLD 100 typedef struct rev_list { long hold[REV_HOLD]; struct rev_list *next; } RevList; static RevList *hold_list = NULL; static int off_hlist = REV_HOLD; static int longcmp (const void *a, const void *b) { long la = *((long *) a); long lb = *((long *) b); if (la == lb) return (0); return (la < lb) ? -1 : 1; } static int exist_hold (long numero) { char holdname[130]; struct stat stat; hold_name (numero, holdname); return (stat (holdname, &stat) == 0); } void end_hold (void) { int i; RevList *rptr = hold_list; RevList *prev = NULL; while (rptr) { for (i = 0; i < REV_HOLD; i++) { if (!exist_hold (rptr->hold[i])) rptr->hold[i] = 0L; if (rptr->hold[i] != 0L) break; } if (i == REV_HOLD) { /* Le bloc est vide, on relie les chainons valides et on le libere */ if (prev) { /* Il y a un chainon avant */ prev->next = rptr->next; } else { /* C'etait la tete de liste */ hold_list = rptr->next; } /* Si le dernier bloc est libere, on prepare l'allocation d'un nouveau bloc */ if (rptr->next == NULL) off_hlist = REV_HOLD; m_libere (rptr, sizeof (RevList)); if (prev) rptr = prev->next; else rptr = hold_list; } else { prev = rptr; rptr = rptr->next; } } } int already_held (long numero) { int i; RevList *rptr = hold_list; while (rptr) { for (i = 0; i < REV_HOLD; i++) if (rptr->hold[i] == numero) return 1; rptr = rptr->next; } return 0; } int delete_hold (long numero) { int i; RevList *rptr = hold_list; while (rptr) { for (i = 0; i < REV_HOLD; i++) { if (rptr->hold[i] == numero) { rptr->hold[i] = 0L; return 1; } } rptr = rptr->next; } return 0; } void ajoute_hold (long numero) { RevList *rptr = hold_list; if (already_held (numero)) return; if (rptr) { /* Avance jusqu'au dernier maillon */ while (rptr->next) { rptr = rptr->next; } } if (off_hlist == REV_HOLD) { RevList *ptmp; /* Ajoute un maillon a la liste */ ptmp = m_alloue (sizeof (RevList)); memset (ptmp, 0, sizeof (RevList)); off_hlist = 0; if (rptr) { rptr->next = ptmp; } else hold_list = rptr = ptmp; } rptr->hold[off_hlist++] = numero; } void init_hold (void) { int done; long num; int i; int nb; long *hold_nb; char path[130]; struct ffblk ffblk; /* Cree ou remet la liste a jour. Les entrees non valides sont a 0 */ end_hold (); sprintf (path, "%s*.HLD", MESSDIR); /* Chercher le nombre de messages held */ nb = 0; done = findfirst (path, &ffblk, 0); while (!done) { ++nb; done = findnext (&ffblk); } if (nb) { hold_nb = (long *) malloc (nb * sizeof (long)); i = 0; /* Lire les noms de messages held */ done = findfirst (path, &ffblk, 0); while (!done) { sscanf (ffblk.ff_name, "%lx", &num); hold_nb[i] = num; if (++i > nb) break; done = findnext (&ffblk); } /* Tri de la liste */ qsort (hold_nb, nb, sizeof (long), longcmp); /* Insere les numeros tries dans la liste */ for (i = 0; i < nb; i++) ajoute_hold (hold_nb[i]); free (hold_nb); } nb_hold = nb; } static int next_hold (void) { int fd; int retour = 1; bullist lbul; char holdname[130]; int i=0; RevList *rptr = hold_list; while (rptr) { for (i = 0; i < REV_HOLD; i++) { if (rptr->hold[i] > pvoie->l_hold) { pvoie->l_hold = rptr->hold[i]; break; } } if (i != REV_HOLD) break; rptr = rptr->next; } if ((rptr == NULL) || (i == REV_HOLD)) { /* Pas de message suivant */ texte (T_MBL + 3); return retour; } hold_name (pvoie->l_hold, holdname); fd = open (holdname, O_RDONLY | O_BINARY); read (fd, &lbul, sizeof (bullist)); close (fd); cr (); *ptmes = lbul; ptmes->numero = ++pvoie->temp1; entete_liste (); aff_status (ptmes); retour = 2; pvoie->messdate = ptmes->datesd; return (retour); } static int read_hold (int verbose) { int nb; FILE *fptr; char chaine[256]; char holdname[130]; nb = 0; hold_name (pvoie->l_hold, holdname); if ((fptr = fopen (holdname, "rt")) != NULL) { fseek (fptr, pvoie->enrcur, 0); if (!verbose) { pvoie->enrcur = supp_header (fptr, 1); fseek (fptr, pvoie->enrcur, 0); } fflush (fptr); while ((nb = read (fileno (fptr), chaine, 250)) > 0) { outs (chaine, nb); if (pvoie->memoc >= MAXMEM) { /* if (!getvoie(CONSOLE]->connect) cprintf("Max atteint\r\n") ; */ pvoie->enrcur = ftell (fptr); break; } } ferme (fptr, 45); } else return (-1); return (nb); } void list_held (void) { char holdname[130]; int fd; bullist lbul; int premier = 1; int i; RevList *rptr; init_hold (); rptr = hold_list; while (rptr) { for (i = 0; i < REV_HOLD; i++) { if (rptr->hold[i]) { hold_name (rptr->hold[i], holdname); fd = open (holdname, O_RDONLY | O_BINARY); read (fd, &lbul, sizeof (bullist)); close (fd); *ptmes = lbul; ptmes->numero = pvoie->temp1 + 1; if (premier) { premier = 0; entete_liste (); } aff_status (ptmes); ++pvoie->temp1; } } rptr = rptr->next; } if (premier) texte (T_MBL + 3); } static void hold_question (void) { texte (T_MBL + 58); } int review (void) { int orig; int dest; int local = 0; int verbose = 0; int error = 0; long numess; char holdname[130]; char messname[130]; switch (pvoie->niv3) { case 0: init_hold (); pvoie->l_hold = 0L; pvoie->temp1 = 0; switch (next_hold ()) { case 0: ch_niv3 (1); break; case 1: retour_mbl (); break; case 2: hold_question (); ch_niv3 (2); break; } break; case 1: switch (next_hold ()) { case 0: break; case 1: retour_mbl (); break; case 2: hold_question (); ch_niv3 (2); break; } break; case 2: while_space (); switch (toupper (*indd)) { case 'V': verbose = 1; case 'R': /* Lire le message held */ pvoie->sr_mem = 0; pvoie->enrcur = 256L; switch (read_hold (verbose)) { case 0: pvoie->sr_mem = 0; hold_question (); ch_niv3 (2); break; case -1: retour_mbl (); break; default: ch_niv3 (3); break; } /* indd = data; sprintf(data, "%ld", ptmes->numero); list_read(verbose); if (mbl_mess_read() == 0) { pvoie->sr_mem = 0; hold_question(); ch_niv3(2); } else ch_niv3(3); */ break; case 'A': case 'K': case 'D': unlink (hold_name (pvoie->l_hold, holdname)); delete_hold (pvoie->l_hold); --nb_hold; aff_msg_cons (); switch (next_hold ()) { case 0: ch_niv3 (1); break; case 1: retour_mbl (); break; case 2: hold_question (); ch_niv3 (2); break; } break; case 'L': local = 1; case 'U': /* Unhold */ *(pvoie->appendf) = '\0'; *(pvoie->mess_bid) = '\0'; ptmes->numero = 0L; ptmes->theme = 0; pvoie->chck = 0; pvoie->m_ack = 0; pvoie->messdate = time (NULL); pvoie->mess_num = -1; if ((ptmes->type == 'B') || ((ptmes->type == 'P') && (strcmp (ptmes->desti, "SYSOP") == 0))) { if (*(ptmes->bbsv)) ptmes->status = '$'; else ptmes->status = 'N'; } else ptmes->status = 'N'; /* Copier le fichier avec un nouveau No de message */ hold_name (pvoie->l_hold, holdname); orig = open (holdname, O_RDONLY | O_BINARY); if (orig < 0) { retour_mbl (); break; } /* Saute le header */ lseek (orig, (long) sizeof (bullist), SEEK_SET); /* Lit le home-bbs */ fbb_read (orig, pvoie->mess_home, sizeof (pvoie->mess_home)); pvoie->mess_home[sizeof (pvoie->mess_home) - 1] = '\0'; /* Debut du texte */ lseek (orig, 256L, SEEK_SET); /* Cree un nouveau message */ numess = ptmes->numero = next_num (); mess_name (MESSDIR, ptmes->numero, messname); dest = open (messname, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE); if (dest < 0) { close (orig); retour_mbl (); break; } copy_fic (orig, dest, NULL); close (orig); close (dest); unlink (holdname); delete_hold (pvoie->l_hold); --nb_hold; put_mess_fwd ('H'); if (local) { /* Pas de forwarding ... */ int i; for (i = 0; i < NBMASK; i++) { ptmes->forw[i] = 0xff; ptmes->fbbs[i] = '\0'; } maj_rec (ptmes->numero, ptmes); clear_fwd (ptmes->numero); /* Supprimer le via */ ptmes->bbsv[0] = '\0'; } tst_sysop (ptmes->desti, numess); tst_serveur (ptmes); tst_ack (ptmes); tst_warning (ptmes); aff_msg_cons (); cr (); switch (next_hold ()) { case 0: ch_niv3 (1); break; case 1: retour_mbl (); break; case 2: hold_question (); ch_niv3 (2); break; default: break; } break; case '\0': switch (next_hold ()) { case 0: ch_niv3 (1); break; case 1: retour_mbl (); break; case 2: hold_question (); ch_niv3 (2); break; } break; case 'Q': retour_mbl (); break; default: hold_question (); break; } break; case 3: switch (read_hold (1)) { case 0: pvoie->sr_mem = 0; hold_question (); ch_niv3 (2); break; case -1: retour_mbl (); break; } break; default: fbb_error (ERR_NIVEAU, "REVIEW", pvoie->niv3); } return (error); } fbb-7.0.10/src/drv_tcp.c0000644000175000017500000011236013615603431011652 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /****************************************************** * * * FBB Driver for TCP/IP domain sockets * * * * F6FBB - 1996 * * * ******************************************************/ #include #include #include #include #include #include #include #include #include #include #include #undef open #undef read #undef write #undef close #define AX25_CALLSID 10 #define READ_EVENT 1 #define WRITE_EVENT 2 #define EXCEPT_EVENT 4 #define QUEUE_EVENT 8 #define DISCONNECT 0 #define CPROGRESS 1 #define CONNECTED 2 #define WAITINGCALL 3 #define WAITINGPASS 4 #define READONLY 5 #define SENDCALL 6 #define DISC_EVENT 1 #define CONN_EVENT 2 #define RETR_EVENT 4 #define BUSY_EVENT 8 #define TIME_EVENT 16 typedef struct { int ncan; int sock; int sock_ui; int port; int state; int paclen; int maxframe; int netrom; int event; int queue; int nego; int cesc; int lgial; int lpos; int lqueue; int nb_try; int nb_ret; int bs; int binary; int lgcall; long timeout; char ial[3]; char call[80]; indicat callsign; char *lbuf; } tcan_t; typedef struct { int sock_ui; int rem_port; int curcan; int nbcan; char rem_addr[80]; tcan_t *tcan; } tport_t; static tport_t tport[NBPORT]; /* static int last_can = 1; */ static int stop_cnx (int port); static int tcp_getline (int port, int can, char *buffer); static int tcp_snd_dt (int port, int, char *, int); static int tcp_cmd (int, int, char *); static int tcp_connect (int, char *, int); static int tcp_stat (int, int, stat_ch *); static int tcp_paclen (int port, int); static int s_free (tcan_t *); static int s_status (tcan_t *); static int tcp_check_call (int port, int can, char *callsign, char *address); static int tcp_check_pass (int port, int can, char *callsign); static int tcp_trame (int port, int canal, char *data, int len); static int snd_tcp_ui(int port, char *buffer, int len, Beacon *ptr); static int rcv_tcp_ui(int port, char *buffer, int *len, ui_header * ui); static void clear_can (int port, int canal); static void read_only_alert (int port, int); /* * Generic functions of the driver */ /* Check or change status of a port/channel */ int sta_tcp (int port, int canal, int cmd, void *ptr) { char *scan; char commande; switch (cmd) { case TNCSTAT: return (tcp_stat (port, canal, (stat_ch *) ptr)); case PACLEN: *((int *) ptr) = tcp_paclen (port, canal); return (1); case BSCMD: tport[port].tcan[canal].bs = *((int *) ptr); return (1); case SNDCMD: return (tcp_cmd (port, canal, (char *) ptr)); case SETBUSY: return stop_cnx (port); case PORTCMD: scan = (char *)ptr; commande = toupper(*scan); ++scan; while (isspace(*scan)) ++scan; switch (commande) { case 'A' : n_cpy(39, tport[port].rem_addr, scan); break; case 'P' : tport[port].rem_port = atoi(scan); break; } return(1); } return (0); } /* Sends data */ int snd_tcp (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ret = 0; switch (cmd) { case COMMAND: break; case UNPROTO: if (p_port[port].typort == TYP_ETH) { snd_tcp_ui(port, buffer, len, ptr); return 1; } break; case DATA: if (len != 0) ret = tcp_snd_dt (port, canal, buffer, len); //else // fprintf (stderr, "FBB snd_tcp() DATA len = 0 !\n");*/ break; } return (ret); } /* receives data */ int rcv_tcp (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { #define LGBUF 252 char buf[LGBUF + 2]; int can; int valid; int res; int i; memset (buf, 0, sizeof (buf)); *cmd = INVCMD; valid = 0; /* Teste les UIs */ if (rcv_tcp_ui(*port, buffer, len, ui)) { *canal = 0; *cmd = UNPROTO; return 1; } usleep(50000); /* wait 50 msec to allow interrupt and avoid CPU overload */ /* Teste s'il y a une connection */ tport[*port].tcan[0].sock = p_port[*port].fd; res = s_status (&tport[*port].tcan[0]); if (res & READ_EVENT) { /* static char *TelnetInit = "\377\375\001\377\375\042"; */ /* static char *TelnetInit = "\377\376\001\377\375\042"; */ static char *TelnetInit = "\377\374\001\000Telnet Initialisation string "; int new; unsigned addr_len; struct sockaddr_in sock_addr; memset (&sock_addr, 0x00, sizeof (struct sockaddr_in)); addr_len = sizeof (sock_addr); new = accept (p_port[*port].fd, (struct sockaddr *) &sock_addr, &addr_len); if (new == -1) { perror ("rcv_tcp() accept"); return (FALSE); } /* Affecter le nouveau socket a un canal vide */ for (i = 1; i <= tport[*port].nbcan; i++) { if (tport[*port].tcan[i].state == DISCONNECT) { break; } } if (i > tport[*port].nbcan) { write (new, TelnetInit, strlen (TelnetInit)); /* Impossible d'affecter le canal -> deconnexion */ sprintf (buf, "\r\nSorry, no more channels available\r\n\r\n"); write (new, buf, strlen (buf)); close (new); } else { int val = 0; FILE *fptr; tport[*port].tcan[i].state = WAITINGCALL; tport[*port].tcan[i].sock = new; tport[*port].tcan[i].paclen = (val == 0) ? 250 : val; tport[*port].tcan[i].queue = s_free (&tport[*port].tcan[i]); tport[*port].tcan[i].timeout = time (NULL) + 120L; if (p_port[*port].typort == TYP_ETH) { sprintf (buf, "\r\n%s BBS data access\r\n\r\n", my_call); write (new, buf, strlen (buf)); } else { write (new, TelnetInit, strlen (TelnetInit)); if ((fptr = fopen (c_disque ("LANG\\TELNET.ENT"), "rt")) == NULL) { sprintf (buf, "\r\n%s BBS. TELNET Access\r\n\r\n", my_call); write (new, buf, strlen (buf)); } else { int nb; char *ptr; while (fgets (buf, LGBUF, fptr)) { nb = strlen (buf); if (nb) { buf[nb - 1] = '\r'; buf[nb] = '\n'; buf[nb + 1] = '\0'; } ptr = var_txt (buf); write (new, ptr, strlen (ptr)); } fclose (fptr); } } sprintf (buf, "Callsign : "); write (new, buf, strlen (buf)); val = p_port[*port].pk_t; return (FALSE); } } for (i = 1 ; i <= tport[*port].nbcan ; i++) { /* Passe au canal suivant pour le polling */ ++tport[*port].curcan; if (tport[*port].curcan > tport[*port].nbcan) tport[*port].curcan = 1; can = tport[*port].curcan; if ((tport[*port].tcan[can].sock == -1) && (tport[*port].tcan[can].state != DISCONNECT)) { sprintf (buffer, "(%d) DISCONNECTED fm TCP", can); tport[*port].tcan[can].state = DISCONNECT; clear_can (*port, can); *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } /* Canal de communication */ res = s_status (&tport[*port].tcan[can]); if (res & TIME_EVENT) { sprintf (buf, "Timeout, disconnected !\r\n"); write (tport[*port].tcan[can].sock, buf, strlen (buf)); close (tport[*port].tcan[can].sock); clear_can (*port, can); return (FALSE); } if (res & WRITE_EVENT) { /* Can write to the socket... Unused */ } if (res & EXCEPT_EVENT) { if (tport[*port].tcan[can].event == CONN_EVENT) { /* Appel sortant connecte */ /* Le host distant a ete connecte. sprintf(buffer, "*** Connected to %s-%d\r", tcan[can].callsign.call, tcan[can].callsign.num); in_buf(voie, buffer, strlen(buffer)); */ /* if (tcan[can].lgcall) write (tcan[can].sock, tcan[can].call, tcan[can].lgcall); */ /* Connexion a la BBS... */ sprintf (buffer, "(%d) CONNECTED to %s-%d", can, tport[*port].tcan[can].callsign.call, tport[*port].tcan[can].callsign.num); /* fprintf (stderr, "(%d) CONNECTED fm tcp to %s-%d\n", can, tport[*port].tcan[can].callsign.call, tport[*port].tcan[can].callsign.num);*/ if (p_port[*port].typort == TYP_ETH) tport[*port].tcan[can].state = SENDCALL; else tport[*port].tcan[can].state = CONNECTED; tport[*port].tcan[can].nb_try = 0; tport[*port].tcan[can].timeout = 0L; *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } } #define LGTCP 1100 if ((res & QUEUE_EVENT) || (res & READ_EVENT)) { int nb = 0; int i; if (tport[*port].tcan[can].sock == -1) { printf ("read on invalid socket\n"); return (FALSE); } /* Alloue le buffer si necessaire */ if (tport[*port].tcan[can].lbuf == NULL) { tport[*port].tcan[can].lbuf = calloc (LGTCP, 1); tport[*port].tcan[can].lpos = 0; tport[*port].tcan[can].lqueue = 0; tport[*port].tcan[can].nb_ret = 0; } if (res & READ_EVENT) { /* Reste de la place ds le buffer ? */ nb = ((LGTCP - tport[*port].tcan[can].lqueue) > 256) ? 256 : LGTCP - tport[*port].tcan[can].lqueue; if (nb) { nb = read (tport[*port].tcan[can].sock, buffer, nb); if ((nb == 0) || ((nb == -1) && (errno == ENOTCONN))) { /* Deconnection */ sprintf (buffer, "(%d) DISCONNECTED fm TCP", can); /* fprintf (stderr, "(%d) DISCONNECTED fm TCP\n", can);*/ close (tport[*port].tcan[can].sock); clear_can (*port, can); *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } else if (nb == -1) { printf ("errno = %d\n", errno); perror ("read"); return (FALSE); } } } { int process; int pos; int lg; char *ptr; char *address; unsigned addr_len; struct sockaddr_in sock_addr; memset (&sock_addr, 0x00, sizeof (struct sockaddr_in)); if (nb) { nb = tcp_trame (*port, can, buffer, nb); if (nb == 0) return (FALSE); } pos = tport[*port].tcan[can].lpos + tport[*port].tcan[can].lqueue; if (pos > LGTCP) pos -= LGTCP; for (i = 0; i < nb; i++) { if (tport[*port].tcan[can].lqueue > (LGTCP - 10)) { ++tport[*port].tcan[can].nb_ret; break; } tport[*port].tcan[can].lbuf[pos] = buffer[i]; if (++pos == LGTCP) pos = 0; ++tport[*port].tcan[can].lqueue; if (buffer[i] == '\r') { ++tport[*port].tcan[can].nb_ret; } } nb = tport[*port].tcan[can].lqueue; tport[*port].tcan[can].timeout = time (NULL) + 120L; process = (tport[*port].tcan[can].nb_ret > 0); switch (tport[*port].tcan[can].state) { case SENDCALL: lg = tcp_getline (*port, can, buffer); if (lg == 0) return 0; buffer[lg] = '\0'; if (strstr(buffer, "allsig")) { write(tport[*port].tcan[can].sock, tport[*port].tcan[can].call, tport[*port].tcan[can].lgcall); tport[*port].tcan[can].state = CONNECTED; tport[*port].tcan[can].lgcall = 0; return (TRUE); } break; case WAITINGCALL: if (!process) return (FALSE); if (!tcp_getline (*port, can, buffer)) return 0; sup_ln (strupr (buffer)); addr_len = sizeof (sock_addr); if ((getpeername(tport[*port].tcan[can].sock, (struct sockaddr *)&sock_addr, &addr_len) == 0) && (sock_addr.sin_family == AF_INET)) address = inet_ntoa(sock_addr.sin_addr); else address = NULL; switch (tcp_check_call (*port, can, buffer, address)) { case 0: if (++tport[*port].tcan[can].nb_try > 3) { sprintf (buf, "Callsign error, disconnected !\r\n"); /* fprintf (stderr, "Callsign error, disconnected !\n");*/ write (tport[*port].tcan[can].sock, buf, strlen (buf)); close (tport[*port].tcan[can].sock); tport[*port].tcan[can].sock = -1; } else { char buf[80]; buffer[20] = '\0'; sprintf (buf, "Invalid callsign \"%s\" !\r\n", buffer); /* fprintf (stderr, "Invalid callsign \"%s\" !\n", buffer);*/ write (tport[*port].tcan[can].sock, buf, strlen (buf)); sprintf (buf, "Callsign : "); /* fprintf (stderr, "Callsign : ");*/ write (tport[*port].tcan[can].sock, buf, strlen (buf)); } break; case 1: { info buf_info; FILE *fptr; unsigned coord; if ((coord = chercoord (tport[*port].tcan[can].callsign.call)) == 0xffff) { close (tport[*port].tcan[can].sock); tport[*port].tcan[can].sock = -1; break; } fptr = ouvre_nomenc (); fseek (fptr, (long) coord * sizeof (info), 0); fread ((char *) &buf_info, sizeof (info), 1, fptr); ferme (fptr, 11); if (!MOD (buf_info.flags)) { read_only_alert (*port, can); tport[*port].tcan[can].state = READONLY; } else { sprintf (buf, "Password : "); write (tport[*port].tcan[can].sock, buf, strlen (buf)); tport[*port].tcan[can].state = WAITINGPASS; tport[*port].tcan[can].nb_try = 0; } } break; case 2: if (++tport[*port].tcan[can].nb_try > 3) { sprintf (buf, "Callsign error, disconnected !\r\n"); /* fprintf (stderr, "Callsign error, disconnected !\n");*/ write (tport[*port].tcan[can].sock, buf, strlen (buf)); close (tport[*port].tcan[can].sock); tport[*port].tcan[can].sock = -1; } else { if (p_port[*port].moport & 0x40) { read_only_alert (*port, can); tport[*port].tcan[can].state = READONLY; } else { char buf[80]; sprintf (buf, "Unregistered callsign \"%s\" !\r\n", buffer); write (tport[*port].tcan[can].sock, buf, strlen (buf)); sprintf (buf, "For registration send message to SYSOP.\r\n\n"); write (tport[*port].tcan[can].sock, buf, strlen (buf)); sprintf (buf, "Callsign : "); write (tport[*port].tcan[can].sock, buf, strlen (buf)); } } break; case 5: sprintf (buffer, "(%d) CONNECTED to %s-%d", can, tport[*port].tcan[can].callsign.call, tport[*port].tcan[can].callsign.num); /* fprintf (stderr, "(%d) CONNECTED to %s-%d\n", can, tport[*port].tcan[can].callsign.call, tport[*port].tcan[can].callsign.num);*/ tport[*port].tcan[can].state = CONNECTED; tport[*port].tcan[can].nb_try = 0; tport[*port].tcan[can].timeout = 0L; *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } break; case WAITINGPASS: if (!process) return (FALSE); if (!tcp_getline (*port, can, buffer)) return 0; sup_ln (buffer); if (tcp_check_pass (*port, can, buffer)) { sprintf (buf, "\r\nLogon Ok. Type NP to change password.\r\n\r\n"); write (tport[*port].tcan[can].sock, buf, strlen (buf)); sprintf (buffer, "(%d) CONNECTED to %s-%d", can, tport[*port].tcan[can].callsign.call, tport[*port].tcan[can].callsign.num); tport[*port].tcan[can].state = CONNECTED; tport[*port].tcan[can].nb_try = 0; tport[*port].tcan[can].timeout = 0L; *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } else { if (++tport[*port].tcan[can].nb_try > 3) { if (p_port[*port].moport & 0x40) { read_only_alert (*port, can); tport[*port].tcan[can].state = READONLY; } else { sprintf (buf, "Password error, disconnected !\r\n"); write (tport[*port].tcan[can].sock, buf, strlen (buf)); close (tport[*port].tcan[can].sock); tport[*port].tcan[can].sock = -1; } } else { char buf[80]; sprintf (buf, "Password error !\r\nPassword : "); write (tport[*port].tcan[can].sock, buf, strlen (buf)); } } return (FALSE); case READONLY: if (!process) return (FALSE); if (!tcp_getline (*port, can, buffer)) return 0; if (toupper (*buffer) == 'Y') { /* Read-Only mode accepted */ sprintf (buf, "\r\nLogon Ok. You have a read-only access.\r\n\r\n"); write (tport[*port].tcan[can].sock, buf, strlen (buf)); sprintf (buffer, "(%d) READONLY to %s-%d", can, tport[*port].tcan[can].callsign.call, tport[*port].tcan[can].callsign.num); tport[*port].tcan[can].state = CONNECTED; tport[*port].tcan[can].nb_try = 0; tport[*port].tcan[can].timeout = 0L; *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } else { sprintf (buf, "Callsign : "); write (tport[*port].tcan[can].sock, buf, strlen (buf)); tport[*port].tcan[can].state = WAITINGCALL; } break; default: pos = tport[*port].tcan[can].lpos; ptr = tport[*port].tcan[can].lbuf; for (i = 0; i < tport[*port].tcan[can].lqueue; i++) { buffer[i] = ptr[pos]; if (++pos == LGTCP) pos = 0; } *len = tport[*port].tcan[can].lqueue; *cmd = DATA; *canal = can; tport[*port].tcan[can].nb_ret = 0; tport[*port].tcan[can].lpos = 0; tport[*port].tcan[can].lqueue = 0; tport[*port].tcan[can].timeout = 0L; return (TRUE); } } } } return (FALSE); } /* Open port */ int opn_tcp (int port, int nb) { int i; int val; int len; int ok = TRUE; int tcp_port; char s[80]; struct sockaddr_in sock_addr; char *ptr; memset (&sock_addr, 0x00, sizeof (struct sockaddr_in)); memset (s, 0, sizeof (s)); tport[port].sock_ui = -1; sock_addr.sin_family = AF_INET; sock_addr.sin_addr.s_addr = 0; /* Test if portname is hex number */ ptr = p_com[(int) p_port[port].ccom].name; if (strcmp (ptr, "0") == 0) { tcp_port = p_com[(int) p_port[port].ccom].port; } else if (strspn (ptr, "0123456789abcdefABCDEF") != strlen (ptr)) { /* It may be tcp address. Port number is in port */ if (inet_aton (ptr, &sock_addr.sin_addr)) tcp_port = p_com[(int) p_port[port].ccom].port; else tcp_port = p_com[(int) p_port[port].ccom].cbase; } else { /* for up compatibility */ tcp_port = p_com[(int) p_port[port].ccom].cbase; } sock_addr.sin_port = htons (tcp_port); sprintf (s, "Init PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); /* old_can = last_can; last_can += nb; if (last_can > TCP_MAXCAN) last_can = TCP_MAXCAN; for (i = old_can; i < last_can; i++) { clear_can (i); } */ tport[port].tcan = (tcan_t *)calloc(nb+1, sizeof(tcan_t)); if (tport[port].tcan == NULL) return 0; tport[port].curcan = 1; tport[port].nbcan = nb; for (i = 0 ; i <= nb ; i++) clear_can(port, i); /* Socket reception d'appels */ if (p_port[port].fd == 0) { sprintf (s, "Open PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); sleep (1); if ((p_port[port].fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } val = 1; len = sizeof (val); if (setsockopt (p_port[port].fd, SOL_SOCKET, SO_REUSEADDR, (char *) &val, len) == -1) { perror ("opn_tcp : setsockopt SO_REUSEADDR"); } if (bind (p_port[port].fd, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("opn_tcp : bind"); close (p_port[port].fd); p_port[port].fd = -1; return (0); } if (listen (p_port[port].fd, SOMAXCONN) == -1) { perror ("listen"); close (p_port[port].fd); p_port[port].fd = -1; return (0); } memset (&tport[port].tcan[0], 0, sizeof (tcan_t)); } /* Socket reception UIs */ if (p_port[port].typort == TYP_ETH) { if ((tport[port].sock_ui = socket (AF_INET, SOCK_DGRAM, 0)) < 0) { perror ("socket_ui"); return (0); } if (bind (tport[port].sock_ui, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("opn_tcp : bind"); close (tport[port].sock_ui); tport[port].sock_ui = -1; return (0); } } sprintf (s, "Prog PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); return (ok); } /* Close port */ int cls_tcp (int port) { int i; for (i = 1; i <= tport[port].nbcan; i++) { if (tport[port].tcan[i].sock != -1) { close (tport[port].tcan[i].sock); } tport[port].tcan[i].state = DISCONNECT; } if ((p_port[port].typort == TYP_SCK) && (p_port[port].fd)) { close (p_port[port].fd); p_port[port].fd = 0; } if (tport[port].sock_ui != -1) { close (tport[port].sock_ui); tport[port].sock_ui = -1; } free(tport[port].tcan); return (1); } /* * Static functions * */ #define LF 0x0a #define CR 0x0d #define SE 0xf0 #define NOP 0xf1 #define DM 0xf2 #define BRK 0xf3 #define IP 0xf4 #define AO 0xf5 #define AYT 0xf6 #define EC 0xf7 #define EL 0xf8 #define GA 0xf9 #define SB 0xfa #define WILL 0xfb #define WONT 0xfc #define DO 0xfd #define DONT 0xfe #define IAC 0xff /* Telnet options */ #define TN_TRANSMIT_BINARY 0 #define TN_ECHO 1 #define TN_SUPPRESS_GA 3 #define TN_STATUS 5 #define TN_TIMING_MARK 6 /* Linemode options */ #define TN_LINEMODE 34 #define TN_LINEMODE_MODE 1 #define TN_LINEMODE_MODE_EDIT 1 static int stop_cnx (int port) { if (p_port[port].fd) /* Prevent closing of 0 */ { close(p_port[port].fd); p_port[port].fd = 0; } return 1; } static int tcp_trame (int port, int canal, char *data, int len) { int i; int carac; int olg = 0; char *optr = data; int pial = tport[port].tcan[canal].lgial; if (tport[port].tcan[canal].binary) { return (len); } for (i = 0; i < len; i++) { carac = data[i] & 0xff; switch (pial) { case 0: if (carac == IAC) tport[port].tcan[canal].ial[pial++] = carac; else { if (tport[port].tcan[canal].nego == 0) { optr[olg++] = carac; if ((carac == CR) && (tport[port].tcan[canal].bs)) pial = 10; } else { printf ("%02x ", carac); } } break; case 1: if (carac == IAC) { optr[olg++] = carac; pial = 0; } else if (tport[port].tcan[canal].nego) { printf ("%02x...\n", carac); } else { switch (carac) { case WILL: printf ("WILL "); break; case WONT: printf ("WONT "); break; case DO: printf ("DO "); break; case DONT: printf ("DONT "); break; case SB: printf ("SUBN "); tport[port].tcan[canal].nego = 1; pial = 0; break; case GA: printf ("GA\n"); pial = 0; break; case EL: printf ("EL\n"); pial = 0; break; case EC: printf ("EC\n"); pial = 0; break; case AYT: printf ("AYT\n"); pial = 0; break; case AO: printf ("AO\n"); pial = 0; break; case IP: printf ("IP\n"); pial = 0; break; case BRK: printf ("BRK\n"); pial = 0; break; case DM: printf ("DM\n"); pial = 0; break; case NOP: printf ("NOP\n"); pial = 0; break; case SE: printf ("SE\n"); /* l = 0; */ tport[port].tcan[canal].nego = 0; pial = 0; break; default: printf ("%02x...\n", carac); break; } if (pial) tport[port].tcan[canal].ial[pial++] = carac; } break; case 2: { char buf[80]; memset (buf, 0, sizeof (buf)); /* printf ("%02x...\n", carac);*/ switch (tport[port].tcan[canal].ial[1]) { case WILL: if (carac == TN_LINEMODE) { /* write(tport[port].tcan[canal].sock, buffer, strlen(buffer)); */ /* printf (" -> DONT %02x\n", carac); */ sprintf (buf, "%c%c%c", IAC, DONT, carac); write (tport[port].tcan[canal].sock, buf, strlen (buf)); } break; case DO: if (carac != TN_ECHO) { /* printf (" -> WONT %02x\n", carac); */ sprintf (buf, "%c%c%c", IAC, WONT, carac); write (tport[port].tcan[canal].sock, buf, strlen (buf)); } break; case WONT: case DONT: break; case SB: break; } pial = 0; } break; case 10: { /* Teste le CRLF -> CR */ if (carac != LF) optr[olg++] = carac; pial = 0; } break; } } tport[port].tcan[canal].lgial = pial; return (olg); } static int tcp_check_call (int port, int can, char *callsign, char *address) { int res = 0; if (*callsign == '.') { tport[port].tcan[can].binary = 1; ++callsign; } tport[port].tcan[can].callsign.num = extind (callsign, tport[port].tcan[can].callsign.call); if (find (tport[port].tcan[can].callsign.call)) { if (chercoord (tport[port].tcan[can].callsign.call) != 0xffff) res = 1; else res = 2; } // Adresse autorisee sans password ? if (address) { FILE *fptr; char str[256]; char ip[80]; char pass[256]; memset (str, 0, sizeof (str)); memset (ip, 0, sizeof (ip)); memset (pass, 0, sizeof (pass)); fptr = fopen(c_disque("passwd.sys"), "rt"); if (fptr) { while (fgets(str, sizeof(str), fptr)) { if ((*str == '\0') || (*str == '#')) continue; *ip = *pass = '\0'; sscanf(str, "%s %s", ip, pass); if (strcmp("+", ip) == 0) { res = 5; break; } if (strcmp(address, ip) == 0) { if (strcmp("+", pass) == 0) res = 5; else res = 2; break; } } fclose(fptr); } } return (res); } static int tcp_check_pass (int port, int can, char *passwd) { unsigned record; record = chercoord (tport[port].tcan[can].callsign.call); if (record != 0xffff) { FILE *fptr; info frec; fptr = ouvre_nomenc (); fseek (fptr, ((long) record * sizeof (info)), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 92); if (strcasecmp (passwd, frec.pass) == 0) { return (TRUE); } } return (FALSE); } static int tcp_snd_dt (int port, int canal, char *buffer, int len) { int i; int nb; int lg; char *ptr; char buf[600]; memset (buf, 0, sizeof (buf)); if (tport[port].tcan[canal].sock == -1) return (FALSE); for (ptr = buf, nb = 0, i = 0; i < len; i++) { *ptr++ = buffer[i]; ++nb; if (!tport[port].tcan[canal].binary) { if ((buffer[i] == '\r') && (tport[port].tcan[canal].bs)) { *ptr++ = '\n'; ++nb; } else if (buffer[i] == IAC) { *ptr++ = IAC; ++nb; } } } lg = write (tport[port].tcan[canal].sock, buf, nb); if (lg == -1) { /* printf ("tcp_snd_dt() Error %d on socket %d\n", errno, tport[port].tcan[canal].sock); */ /* perror ("tcp_snd_dt() write on socket");*/ return (FALSE); } else if (lg < nb) { /* printf ("tcp_snd_dt() Cannot write %d bytes on socket %d\n", nb - lg, tport[port].tcan[canal].sock); */ return (FALSE); } return (TRUE); } static int tcp_cmd (int port, int canal, char *cmd) { switch (*cmd++) { case 'I': /* source callsign */ while (isspace (*cmd)) ++cmd; tport[port].tcan[canal].callsign.num = extind (cmd, tport[port].tcan[canal].callsign.call); break; case 'D': /* Deconnection */ if (tport[port].tcan[canal].sock != -1) { close (tport[port].tcan[canal].sock); tport[port].tcan[canal].sock = -1; } break; case 'C': tcp_connect (port, cmd, canal); break; default: return (0); } return (1); } static int tcp_connect (int port, char *commande, int can) { int fd; int ioc; int tcp_port; char tcp_add[80]; char indic[80]; struct sockaddr_in sock_addr; struct hostent *host; memset (&sock_addr, 0x00, sizeof (struct sockaddr_in)); memset (tcp_add, 0, sizeof (tcp_add)); memset (indic, 0, sizeof (indic)); /* Connection */ while (isspace (*commande)) ++commande; tport[port].tcan[can].paclen = p_port[port].pk_t; tport[port].tcan[can].maxframe = p_port[port].frame; tport[port].tcan[can].port = port; if (tport[port].tcan[can].state != DISCONNECT) return (0); tcp_add[0] = '\0'; tcp_port = 23; commande[79] = '\0'; if (p_port[port].typort == TYP_ETH) { char *ptr; strcpy(tcp_add, tport[port].rem_addr); tcp_port = tport[port].rem_port; sprintf(tport[port].tcan[can].call, ".%s-%d^", tport[port].tcan[can].callsign.call, tport[port].tcan[can].callsign.num); /* Remote call */ ptr = strtok(commande, " ,\t"); if (!ptr) return(0); strcat(tport[port].tcan[can].call, strupr(ptr)); /* Digis */ ptr = strtok(NULL, " ,\t"); if (ptr) strcat(tport[port].tcan[can].call, " via"); while (ptr) { if ((stricmp(ptr, "via") != 0) && (stricmp(ptr, "v") != 0)) { strcat(tport[port].tcan[can].call, " "); strcat(tport[port].tcan[can].call, strupr(ptr)); } ptr = strtok(NULL, " ,\t"); } strcat(tport[port].tcan[can].call, "\r"); tport[port].tcan[can].lgcall = strlen(tport[port].tcan[can].call); tport[port].tcan[can].binary = 1; /* Canal->phase = SENDCALL; */ } else { sscanf (commande, "%s %s %i", indic, tcp_add, &tcp_port); tport[port].tcan[can].callsign.num = extind (indic, tport[port].tcan[can].callsign.call); tport[port].tcan[can].lgcall = 0; if (!find (tport[port].tcan[can].callsign.call)) { /* fprintf (stderr, "connect : invalid callsign %s\n", indic);*/ return (0); } if (tcp_add[0] == '\0') { /* fprintf (stderr, "connect : tcp address missing\n");*/ return (0); } } if ((fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_ax"); clear_can (port, can); return (0); } sock_addr.sin_family = AF_INET; sock_addr.sin_port = htons (tcp_port); host = gethostbyname(tcp_add); if (host) sock_addr.sin_addr.s_addr = ((struct in_addr *)(host->h_addr))->s_addr; else sock_addr.sin_addr.s_addr = inet_addr (tcp_add); ioc = 1; ioctl (fd, FIONBIO, &ioc); if (connect (fd, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) == -1) { if (errno != EINPROGRESS) { printf ("\n"); /* perror ("connect");*/ /* printf ("*** Cannot connect %s canal %d\n", commande, can);*/ clear_can (port, can); close (fd); return (0); } } /* printf ("*** Connect in progress %s canal %d\n", commande, can);*/ tport[port].tcan[can].sock = fd; tport[port].tcan[can].state = CPROGRESS; tport[port].tcan[can].queue = s_free (&tport[port].tcan[can]); return (TRUE); } static int tcp_stat (int port, int canal, stat_ch * ptr) { int val; if ((canal == 0) || (tport[port].tcan[canal].sock == -1)) return (0); ptr->mem = 100; val = s_free (&tport[port].tcan[canal]); if (tport[port].tcan[canal].state != CONNECTED) ptr->ack = 0; else { ptr->ack = (tport[port].tcan[canal].queue - val) / tport[port].tcan[canal].paclen; if ((tport[port].tcan[canal].queue - val) && (ptr->ack == 0)) ptr->ack = 1; } return (1); } static int s_status (tcan_t * can) { int nb; int res = 0; fd_set tcp_read; fd_set tcp_write; fd_set tcp_excep; struct timeval to; memset (&to, 0x00, sizeof (struct timeval)); if (can->sock <= 0) /* Was -1. Sock=0 during housekeeping. Cause of select errors */ return (0); if ((can->timeout) && (can->timeout < time (NULL))) { res |= TIME_EVENT; can->timeout = 0L; return (res); } if (can->lqueue) { res |= QUEUE_EVENT; } to.tv_sec = to.tv_usec = 0; can->event = 0; FD_ZERO (&tcp_read); FD_ZERO (&tcp_write); FD_ZERO (&tcp_excep); FD_SET (can->sock, &tcp_read); FD_SET (can->sock, &tcp_write); FD_SET (can->sock, &tcp_excep); nb = select (can->sock + 1, &tcp_read, &tcp_write, &tcp_excep, &to); if (nb == -1) { perror ("select"); return (res); } else if (nb == 0) { return (res); } else { if (FD_ISSET (can->sock, &tcp_read)) { res |= READ_EVENT; } if (FD_ISSET (can->sock, &tcp_write)) { if (can->state == CPROGRESS) { if (p_port[port].typort == TYP_ETH) can->state = SENDCALL; else can->state = CONNECTED; write (can->sock, &res, 0); res |= EXCEPT_EVENT; can->event = CONN_EVENT; } else res |= WRITE_EVENT; } if (FD_ISSET (can->sock, &tcp_excep)) { res |= EXCEPT_EVENT; } } return (res); } static int tcp_paclen (int port, int canal) { if (tport[port].tcan[canal].sock == -1) return (0); return (tport[port].tcan[canal].paclen); } static int s_free (tcan_t * can) { int queue_free; if (ioctl (can->sock, TIOCOUTQ, &queue_free) == -1) { perror ("ioctl : TIOCOUTQ"); return (0); } return (queue_free); } static void clear_can (int port, int canal) { /* fprintf (stderr, "drv_tcp : clear_can() port %d canal %d\n", port, canal);*/ if (tport[port].tcan[canal].lbuf) free (tport[port].tcan[canal].lbuf); memset (&tport[port].tcan[canal], 0, sizeof (tcan_t)); tport[port].tcan[canal].sock = -1; tport[port].tcan[canal].bs = 1; tport[port].tcan[canal].binary = 0; tport[port].tcan[canal].state = DISCONNECT; } #define READ_ONLY "\r\nLogin in read-only mode.\r\nYou may leave a message to SYSOP.\r\n\r\nGo on anyway (Y/N) ? " static void read_only_alert (int port, int can) { char buf[256]; memset (buf, 0, sizeof (buf)); sprintf (buf, READ_ONLY); write (tport[port].tcan[can].sock, buf, strlen (buf)); } /* Copie une ligne dans le buffer */ static int tcp_getline (int port, int can, char *buffer) { int i = 0; int c; int pos; char *ptr; pos = tport[port].tcan[can].lpos; ptr = tport[port].tcan[can].lbuf; while (tport[port].tcan[can].lqueue) { c = ptr[pos]; if (++pos == LGTCP) pos = 0; --tport[port].tcan[can].lqueue; if ((c == '\n') && (tport[port].tcan[can].bs)) continue; buffer[i++] = c; if (c == '\r') { --tport[port].tcan[can].nb_ret; break; } } buffer[i] = '\0'; tport[port].tcan[can].lpos = pos; return (i); } static int snd_tcp_ui(int port, char *buffer, int len, Beacon *ptr) { int i; int lg; char buf[1024]; char call[10]; char desti[120]; int sock_ui; struct sockaddr_in sock_addr; memset (&sock_addr, 0x00, sizeof (struct sockaddr_in)); memset (buf, 0, sizeof (buf)); memset (call, 0, sizeof (call)); memset (desti, 0, sizeof (desti)); sock_addr.sin_family = AF_INET; sock_addr.sin_addr.s_addr = INADDR_ANY; sock_addr.sin_port = 0; sock_ui = socket(AF_INET, SOCK_DGRAM, 0); if (sock_ui < 0) { perror ("socket_ui"); return (0); } if (bind (sock_ui, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("snd_tcp_ui : bind"); close (sock_ui); return (0); } sprintf(desti, "%s-%d", ptr->desti.call, ptr->desti.num); for (i = 0; i < ptr->nb_digi; i++) { strcat(desti, " "); sprintf(call, "%s-%d", ptr->digi[i].call, ptr->digi[i].num); strcat(desti, call); } sprintf(buf, "%d^%s-%d^%s^UI^F0^%d^", port, mycall, myssid, desti, len); lg = strlen(buf); memcpy(buf+lg, buffer, len); sock_addr.sin_family = AF_INET; sock_addr.sin_addr.s_addr = inet_addr(tport[port].rem_addr); sock_addr.sin_port = htons(tport[port].rem_port); lg = sendto(sock_ui, buf, lg+len, 0, (const struct sockaddr *)&sock_addr, sizeof (sock_addr)); close(sock_ui); if (lg < 0) { perror ("snd_tcp_ui:sendto"); return (0); } return(1); } static int rcv_tcp_ui(int port, char *buffer, int *len, ui_header * ui) { int nb; int lg; fd_set tcp_read; struct timeval to; struct sockaddr_in sock_addr; unsigned addr_len = sizeof (sock_addr); char buf[1024]; char *ptr; char *p; memset (&sock_addr, 0x00, sizeof (struct sockaddr_in)); memset (&to, 0x00, sizeof (struct timeval)); memset (buf, 0, sizeof (buf)); if (tport[port].sock_ui == -1) return (0); to.tv_sec = to.tv_usec = 0; FD_ZERO (&tcp_read); FD_SET (tport[port].sock_ui, &tcp_read); nb = select (tport[port].sock_ui + 1, &tcp_read, NULL, NULL, &to); if (nb == -1) { perror ("select_ui"); return (0); } else if (nb == 0) { return (0); } nb = recvfrom(tport[port].sock_ui, buf, sizeof(buf), 0, (struct sockaddr *) &sock_addr, &addr_len); ptr = buf; /* remote port ignored */ lg = 0; p = ptr; while (*ptr != '^') { ++ptr; ++lg; --nb; } ++ptr; --nb; ui->port = port; /* from */ lg = 0; p = ptr; while (*ptr != '^') { ++ptr; ++lg; --nb; } n_cpy(lg, ui->from, p); ++ptr; --nb; /* to */ lg = 0; p = ptr; while (*ptr != '^') { if (*ptr == ' ') { /* Digis ... */ break; } ++ptr; ++lg; --nb; } n_cpy(lg, ui->to, p); ui->via[0] = '\0'; if (*ptr == ' ') { /* Digis ... */ ++ptr; --nb; lg = 0; p = ptr; while (*ptr != '^') { ++ptr; ++lg; --nb; } n_cpy(lg, ui->via, p); strcat(ui->via, " "); } ++ptr; --nb; /* ctrl */ lg = 0; p = ptr; while (*ptr != '^') { ++ptr; ++lg; --nb; } n_cpy(lg, ui->ctl, p); ui->ui = (strncmp("UI", p, 2) == 0); ++ptr; --nb; /* pid */ lg = 0; p = ptr; while (*ptr != '^') { ++ptr; ++lg; --nb; } sscanf(p, "%x", &ui->pid); ++ptr; --nb; /* len */ lg = 0; p = ptr; while (*ptr != '^') { ++ptr; ++lg; --nb; } lg = atoi(p); ++ptr; --nb; sprintf (ui->txt, " (%d)", lg); if (lg != nb) return 0; if (lg > 0) memcpy(buffer, ptr, lg); *len = lg; return lg; } fbb-7.0.10/src/themes.c0000644000175000017500000010125513613360505011477 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * THEMES.C * * Gestion des themes de bulletins */ #include #define READ_OK(st) ((st.status != 'K') && (st.status != 'A') && (st.status != 'H')) #define iswcard(c) ((c) == '*' || (c) == '?' || (c) == '&' || (c) == '#' || (c) == '@' || (c) == '=') #define isword(c) ((c) == '@' || iswcard(c) || isalnum(c)) #define isope(c) ((c) == '&' || (c) == '|') #define OPE_OR 255 #define OPE_AND 254 #define OPE_NOT 253 #define OPE 252 #define TYP_TO 0 #define TYP_VIA 1 #define MAX_THEMES 250 static int themes_read (int verbose); static void error_file (void); static void libere_theme (void); static void prompt_themes (void); static void trans_num (void); static void group_select(char *ptr); static void group_read(char *ptr); static void group_previous(void); static void group_next(void); static void group_xhdr(char *ptr); static void group_xover(char *ptr); typedef char NomTh[7]; #define LG_THEME 32 typedef struct type_Fields { char typ_field; char *val_field; } Fields; typedef struct type_Equate { Fields fields[256]; int nb_fields; char equ[512]; int nb_equ; } Equate; typedef struct { char nom[LG_THEME+1]; // char nb_themes; // NomTh *lthemes; Equate equate; int nb_bull; long first_bull; long last_bull; } Theme; typedef struct { long msg_num; int grp_num; } grplu; #define NBGRPLU 100 typedef struct typ_grpbloc { grplu *grpel; int nb_tot; int nb_cur; } grpbloc; typedef struct typ_th_date { char nom[LG_THEME+1]; time_t date; int trouve; } th_date; static grpbloc *group_index[MAX_THEMES]; static th_date theme_date[MAX_THEMES*2]; static int tot_themes; static int nolig; static int nb_dates; int scan_pos; char *scan_line; static Theme *theme_liste = NULL; void end_themes (void) { if (theme_liste) libere_theme (); } #define CADENCE 5; void scan_themes (int add) { #ifdef __FBBDOS__ fen *fen_ptr; #endif unsigned offset = 0; int nb = 0; long last_num = 0L; bloc_mess *bptr = tete_dir; bullist ligne; deb_io (); #ifdef __FBBDOS__ #ifdef ENGLISH fen_ptr = open_win (10, 5, 50, 8, INIT, "Themas"); #else fen_ptr = open_win (10, 5, 50, 8, INIT, "Themes"); #endif #endif ouvre_dir (); while (bptr) { if (bptr->st_mess[offset].noenr) { ++nb; read_dir (bptr->st_mess[offset].noenr, &ligne); if ((ligne.type == 'B') && (READ_OK (ligne))) { valide_themes (bptr->st_mess[offset].noenr, add, &ligne); } if ((nb % 100) == 0) { #if defined(__WINDOWS__) || defined(__linux__) char buf[80]; sprintf (buf, "%ld", bptr->st_mess[offset].nmess); InitText (buf); #endif #ifdef __FBBDOS__ cprintf ("%ld\r", bptr->st_mess[offset].nmess); #endif } last_num = bptr->st_mess[offset].nmess; } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } #if defined(__WINDOWS__) || defined(__linux__) { char buf[80]; sprintf (buf, "%ld", last_num); InitText (buf); } #else cprintf ("%ld\r", last_num); #endif ferme_dir (); #ifdef __FBBDOS__ attend_caractere (2); close_win (fen_ptr); #endif fin_io (); } int theme_existe (char *theme, char liste[MAX_THEMES][LG_THEME+1]) { int i; for (i = 0; i < tot_themes; i++) { if (strcmp (theme, liste[i]) == 0) return (1); } return (0); } static void read_dates (void) { int nb; FILE *fptr; memset(theme_date, 0, sizeof(th_date) * MAX_THEMES * 2); fptr = fopen (d_disque ("THEMES.DAT"), "rt"); if (fptr == NULL) return; for (nb_dates = 0 ; nb_dates < MAX_THEMES ; nb_dates++) { nb = fscanf(fptr, "%s %ld\n", theme_date[nb_dates].nom, &theme_date[nb_dates].date); if (nb != 2) break; theme_date[nb_dates].trouve = 0; } fclose(fptr); return; } char *check_dates (time_t date) { int i; int nb = 0; static char buf[4 + (LG_THEME+2) * MAX_THEMES]; for (i = 0 ; i < nb_dates ; i++) { if ((theme_date[i].trouve) && (date < theme_date[i].date)) { nb += sprintf(buf+nb, "%s\r\n", theme_date[i].nom); } } sprintf(buf+nb, ".\r\n"); return buf; } static void write_dates (void) { int i; FILE *fptr = fopen (d_disque ("THEMES.DAT"), "wt"); if (fptr == NULL) return; for (i = 0 ; i < nb_dates ; i++) { if (theme_date[i].trouve) fprintf(fptr, "%s %ld\n", theme_date[i].nom, theme_date[i].date); } fclose(fptr); return; } static void add_date (char *nom) { int i; for (i = 0 ; i < nb_dates ; i++) { if (strcmpi(theme_date[i].nom, nom) == 0) { theme_date[i].trouve = 1; return; } } n_cpy (LG_THEME, theme_date[nb_dates].nom, nom); theme_date[nb_dates].date = time(NULL); theme_date[nb_dates].trouve = 1; printf("%s", ctime(&theme_date[nb_dates].date)); nb_dates++; } static int new_val(Equate *st, int type, char *value) { st->fields[st->nb_fields].val_field = value; st->fields[st->nb_fields].typ_field = type; st->equ[st->nb_equ++] = st->nb_fields++; return 1; } static int new_ope(Equate *st, int operation) { st->equ[st->nb_equ++] = operation; return 1; } static char *next_word(void) { int nb = 0; while (isword(scan_line[scan_pos+nb])) ++nb; if (nb > 0) { char *word = malloc(nb+1); memcpy(word, scan_line+scan_pos, nb); word[nb] = '\0'; scan_pos += nb; return word; } return NULL; } /* return values 0 : OK 1 : unattended character 2 : ')' missing 3 : No memory */ static int expression(Equate *st) { int operation; int type; while (isspace(scan_line[scan_pos])) ++scan_pos; /* 1st word */ if (isope(scan_line[scan_pos])) { return 1; } if (scan_line[scan_pos] ==')') { return 0; } if (scan_line[scan_pos] =='!') { int ret; ++scan_pos; ret = expression(st); if (ret != 0) return ret; new_ope(st, OPE_NOT); } else if (scan_line[scan_pos] == '(') { int ret; ++scan_pos; ret = expression(st); if (ret != 0) return ret; if (scan_line[scan_pos] != ')') return 2; ++scan_pos; } else if (isword(scan_line[scan_pos])) { type = TYP_TO; if (scan_line[scan_pos] == '@') { type = TYP_VIA; ++scan_pos; } if (!new_val(st, type, next_word())) return 3; } else { return 1; } operation = OPE_OR; /* next words */ for (;;) { while (isspace(scan_line[scan_pos])) ++scan_pos; if (scan_line[scan_pos] == '\0') return 0; else if (scan_line[scan_pos] == '&') { ++scan_pos; operation = OPE_AND; continue; } else if (scan_line[scan_pos] == '|') { ++scan_pos; operation = OPE_OR; continue; } else if (scan_line[scan_pos] =='!') { int ret; ++scan_pos; ret = expression(st); if (ret != 0) return ret; new_ope(st, OPE_NOT); continue; } else if (scan_line[scan_pos] == '(') { int ret; ++scan_pos; ret = expression(st); if (ret != 0) return ret; if (scan_line[scan_pos] != ')') return 2; ++scan_pos; } else if (scan_line[scan_pos] ==')') { return 0; } else if (isword(scan_line[scan_pos])) { type = TYP_TO; if (scan_line[scan_pos] == '@') { type = TYP_VIA; ++scan_pos; } if (!new_val(st, type, next_word())) return 3; } else { return 10; } new_ope(st, operation); operation = OPE_OR; } } void load_themes (void) { int i; // int nb; FILE *fptr; char *ptr; char buffer[258]; // NomTh tmp_nom[100]; // NomTh *pnom; struct stat st; char nom_themes[MAX_THEMES][LG_THEME+1]; if ((stat (c_disque ("THEMES.SYS"), &st) == 0) && (st.st_mtime == t_thm)) return; t_thm = st.st_mtime; if (theme_liste) { libere_theme (); theme_liste = NULL; } for (i = 0 ; i < MAX_THEMES ; i++) group_index[i] = NULL; nolig = 0; tot_themes = 0; fptr = fopen (c_disque ("THEMES.SYS"), "rt"); if (fptr == NULL) { return; } while (fgets (buffer, 257, fptr)) { ++nolig; ptr = strtok (buffer, " \t\n"); if ((ptr == NULL) || (*ptr == '#')) continue; if (theme_existe (ptr, nom_themes)) { fclose (fptr); error_file (); tot_themes = 0; return; } n_cpy (10, nom_themes[tot_themes], ptr); ++tot_themes; if (tot_themes == MAX_THEMES) break; } if (tot_themes == 0) { fclose (fptr); return; } theme_liste = (Theme *) m_alloue (tot_themes * sizeof (Theme)); rewind (fptr); read_dates (); tot_themes = 0; while (fgets (buffer, 257, fptr)) { int ret; sup_ln (buffer); ptr = strtok (buffer, " \t"); if ((ptr == NULL) || (*ptr == '#')) continue; n_cpy (LG_THEME, theme_liste[tot_themes].nom, ptr); add_date(ptr); scan_line = strtok (NULL, "\n"); scan_pos = 0; if (scan_line) { ret = expression(&theme_liste[tot_themes].equate); if (ret != 0) { printf("error %d - theme \"%s\" (col %d)\n", ret, theme_liste[tot_themes].nom, (int)strlen(ptr)+scan_pos+1); printf("%s\n", scan_line); for (i = 0 ; i < scan_pos ; i++) putchar(' '); printf("^\n"); } } /* nb = 0; while ((ptr = strtok (NULL, " \t")) != NULL) { n_cpy (6, tmp_nom[nb], ptr); ++nb; } if (nb) pnom = (NomTh *) m_alloue (nb * sizeof (NomTh)); else pnom = NULL; for (i = 0; i < nb; i++) strcpy (pnom[i], tmp_nom[i]); theme_liste[tot_themes].lthemes = pnom; theme_liste[tot_themes].nb_themes = nb; */ theme_liste[tot_themes].nb_bull = 0; theme_liste[tot_themes].first_bull = 1L; theme_liste[tot_themes].last_bull = 0L; ++tot_themes; if (tot_themes == MAX_THEMES) break; } write_dates (); fclose (fptr); scan_themes (0); scan_themes (1); } static int add_to_group(int add, int group, bullist *pbul) { if (group_index[group] == NULL) { group_index[group] = (grpbloc *)calloc(sizeof(grpbloc), 1); if (group_index[group] == NULL) return 0; group_index[group]->nb_tot = NBGRPLU; group_index[group]->grpel = (grplu *)calloc(sizeof(grplu), group_index[group]->nb_tot); if (group_index[group]->grpel == NULL) return 0; } ++theme_liste[group].nb_bull; if (add || pbul->grpnum <= theme_liste[group].last_bull) { pbul->grpnum = ++theme_liste[group].last_bull; pbul->theme = 0L; } if (theme_liste[group].nb_bull == 1) theme_liste[group].first_bull = pbul->grpnum; theme_liste[group].last_bull = pbul->grpnum; group_index[group]->grpel[group_index[group]->nb_cur].msg_num = pbul->numero; group_index[group]->grpel[group_index[group]->nb_cur].grp_num = pbul->grpnum; ++group_index[group]->nb_cur; if (group_index[group]->nb_cur == group_index[group]->nb_tot) { group_index[group]->nb_tot += NBGRPLU; group_index[group]->grpel = (grplu *)realloc(group_index[group]->grpel, sizeof(grplu) * group_index[group]->nb_tot); if (group_index[group]->grpel == NULL) return 0; } return 1; } static long grp_to_bull(int group, int grp_num) { int i; if (group_index[group] == NULL){ return 0l; } for (i = 0 ; i < group_index[group]->nb_cur ; i++) { if (group_index[group]->grpel[i].grp_num == grp_num) return group_index[group]->grpel[i].msg_num; } return 0L; } int th_check(Equate *st, bullist * pbul) { #define TH_STACK 256 char *to = pbul->desti; char *via = pbul->bbsv; char stack[TH_STACK+1]; int stpos = -1; // int res = 0; int i; int val; stack[0] = 0; for (i = 0 ; i < st->nb_equ ; i++) { int x = st->equ[i]; if (x > OPE) { /* char *op[] = {"ENTER", "OR", "AND" }; int t = -x - 1; printf(" %s ", op[t]); */ if (stpos <= 0) return -1; switch (x) { case OPE_NOT: val = stack[stpos]; stack[stpos] = !val; break; case OPE_AND: val = stack[stpos--]; stack[stpos] &= val; break; case OPE_OR: val = stack[stpos--]; stack[stpos] |= val; break; } } else { int cur = 0; if (stpos == TH_STACK) return -1; /* printf("%d %s", st->fields[x].typ_field, st->fields[x].val_field); */ if (st->fields[x].typ_field == TYP_TO) cur = strmatch(to, st->fields[x].val_field); else if (st->fields[x].typ_field == TYP_VIA) cur = strmatch(via, st->fields[x].val_field); stack[++stpos] = cur; } /* printf("\n"); */ } /* printf("stack = %d, result = %d\n", stpos, stack[stpos]); */ return (stack[stpos]); } /* * * First pass (add = 0) : Validate all already well classed bulletins * Second pass (add = 1): Validate unclassed or new bulletins * */ void valide_themes (unsigned noenr, int add, bullist * pbul) { int i; // , j; int update = 0; /* long val = 1L;*/ long masque = -1L; if (theme_liste == NULL) return; for (i = 1; i < tot_themes; i++) { /* for (j = 0; j < theme_liste[i].nb_themes; j++) { if (strmatch (pbul->desti, theme_liste[i].lthemes[j])) { masque = i; break; } } if (masque != -1L) break; */ if (th_check(&theme_liste[i].equate, pbul)) { /* No duplicate */ masque = i; break; } } if (add == 0) { /* masque must be equal to the theme */ if (pbul->theme == masque) update = 1; } else { /* unclassed or new bulletins */ if (pbul->theme != masque) update = 1; } if (update) { int group = (masque == -1L) ? 0 : (int)masque; add_to_group(add, group, pbul); if (pbul->theme != masque) { pbul->theme = masque; if (noenr != 0) write_dir (noenr, pbul); } } } static void libere_theme (void) { int i; if (theme_liste == NULL) return; for (i = 0; i < NBVOIES; i++) { if ((svoie[i]->niv1 == N_THEMES) && (svoie[i]->niv2 != 0)) { selvoie (i); pvoie->finf.theme = 0; prompt_themes (); } } for (i = 0; i < tot_themes; i++) { int j; Equate *st = &theme_liste[i].equate; for (j = 0 ; j < st->nb_fields; j++) { free(st->fields[j].val_field); } /* if (theme_liste[i].nb_themes) { m_libere (theme_liste[i].lthemes, theme_liste[i].nb_themes * sizeof (NomTh)); } */ } m_libere (theme_liste, tot_themes * sizeof (Theme)); theme_liste = NULL; tot_themes = 0; } char *cur_theme (int voie) { return (theme_liste[(int)svoie[voie]->finf.theme].nom); } int nbull_theme (int voie) { return (theme_liste[(int)svoie[voie]->finf.theme].nb_bull); } static void prompt_themes (void) { maj_niv (N_THEMES, 0, 0); pvoie->sr_mem = 0; texte (T_THE + 2); } static void list_topics (void) { /* int i; char s[100]; int numero = pvoie->finf.theme; for (i = 0; i < theme_liste[numero].nb_themes; i++) { sprintf (s, " %-6s", theme_liste[numero].lthemes[i]); out (s, strlen (s)); if ((i + 1) % 8 == 0) cr (); } if (i % 8) cr (); */ } static void display_themes (void) { int i; char s[100]; for (i = 0; i < tot_themes; i++) { sprintf (s, "%2d:%-25s %-4d", i, theme_liste[i].nom, theme_liste[i].nb_bull); out (s, strlen (s)); if ((i + 1) % 2 == 0) cr (); else out (" ", 5); } if (i % 2) cr (); prompt_themes (); } static char *ltitre (int mode, bullist * pbul) /* Mode = 1 pour LS */ { /* int lg = (mode) ? 80 : 36 ; */ int lg = 80; static char buf[100]; if (pvoie->typlist) { sprintf (buf, "%-12s ", pbul->bid); if (mode) strn_cpy (lg, buf + 13, pbul->titre); else n_cpy (lg, buf + 13, pbul->titre); } else { if (mode) strn_cpy (lg, buf, pbul->titre); else n_cpy (lg, buf, pbul->titre); } return (buf); } static void alloue_list_numeros (void) { if (pvoie->ptemp) { m_libere ((char *) pvoie->ptemp, pvoie->psiz); pvoie->ptemp = NULL; pvoie->psiz = 0; } pvoie->psiz = pvoie->temp2 * sizeof (long); pvoie->ptemp = m_alloue (pvoie->psiz); } static void aff_ligne (int numero, bullist * ligne) { char *ptr; *ptmes = *ligne; if (*(ligne->bbsv)) sprintf (varx[0], "@%-6s", bbs_via (ligne->bbsv)); else strcpy (varx[0], " "); var_cpy (1, ltitre (0, ligne)); ptmes->numero = (long) numero; ptr = var_txt (langue[vlang]->plang[T_THE + 1 - 1]); if (strlen (ptr) > 80) { ptr[79] = '\r'; ptr[80] = '\0'; } outs (ptr, strlen (ptr)); } static int entete_theme (void) { return (texte (T_THE + 0)); } static int themes_bloc_liste (void) { long *num_list; int retour = 1; int num_lig = 0; int max_lig; int group; unsigned offset = pvoie->recliste.offset; bloc_mess *bptr = pvoie->recliste.ptemp; bullist ligne; num_list = (long *) pvoie->ptemp; if ((num_list == NULL) || (pvoie->psiz == 0)) return (retour); pvoie->sr_mem = pvoie->seq = FALSE; group = (pvoie->finf.theme == 0) ? -1 : pvoie->finf.theme; max_lig = pvoie->psiz / sizeof (long); num_lig = max_lig - pvoie->temp2; ouvre_dir (); while (bptr) { /* Pb debordement du tableau ! */ if (num_lig >= max_lig) { retour = 2; break; } if (!pvoie->reverse) --offset; if (bptr->st_mess[offset].noenr) { read_dir (bptr->st_mess[offset].noenr, &ligne); if ((ligne.type == 'B') && (READ_OK (ligne))) { if (ligne.theme == group) { if (pvoie->temp1) { pvoie->temp2 -= entete_theme (); pvoie->temp1 = 0; } num_list[num_lig++] = ligne.numero; aff_ligne (num_lig, &ligne); --pvoie->temp2; } } if (pvoie->temp2 == 0) { retour = 2; break; } } if (pvoie->reverse) { if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } else { if (offset == 0) { bptr = prec_dir (bptr); offset = T_BLOC_MESS; } } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } ferme_dir (); pvoie->recliste.offset = offset; pvoie->recliste.ptemp = bptr; return (retour); } int themes_lx (void) { pvoie->temp1 = 1; if (pvoie->reverse) { pvoie->recliste.ptemp = tete_dir; pvoie->recliste.offset = 0; } else { pvoie->recliste.ptemp = last_dir (); pvoie->recliste.offset = T_BLOC_MESS; } return (1); } int themes_rx (int verbose) { int error = 0; long no; int c, ok = TRUE; bullist *pbul; rd_list *ptemp = NULL; df ("themes_rx", 1); /* print_fonction(stdout); print_history(stdout); sleep_(10); for (;;); */ sup_ln (indd); c = toupper (*indd); ++indd; if ((c != ' ') && (*indd != ' ') && (*indd != '\0')) { ff (); return (1); } pvoie->aut_nc = 1; libere_tread (voiecur); init_recliste (voiecur); pvoie->recliste.l = verbose; switch (c) { /* case 'A' : pvoie->recliste.status = 'A' ; break ; case 'L' : if (teste_espace()) { if (isdigit(*indd)) pvoie->recliste.last = lit_chiffre(0) ; else { texte(T_ERR + 3) ; ok = 0 ; } } else { --indd; error = 1; ok = 4 ; } break ; case 'M' : case 'N' : if (read_mine(c)) ok = 2 ; else ok = 0 ; break ; case 'S' : if (teste_espace()) strn_cpy(19, pvoie->recliste.find, indd) ; else { --indd; error = 1; ok = 4 ; } break ; case '<' : if (teste_espace()) { strn_cpy(6, pvoie->recliste.exp, indd) ; } else { texte(T_ERR + 2) ; ok = 0 ; } break ; case '>' : if (teste_espace()) { strn_cpy(6, pvoie->recliste.dest, indd) ; } else { texte(T_ERR + 2) ; ok = 0 ; } break ; */ case ' ': trans_num (); /*if (strchr(indd, '-')) { if (isdigit(*indd)) pvoie->recliste.debut = lit_chiffre(1) ; else { texte(T_ERR + 3) ; ok = 0 ; break ; } ++indd ; if (isdigit(*indd)) pvoie->recliste.fin = lit_chiffre(1) ; if (pvoie->recliste.fin <= pvoie->recliste.debut) ok = 0 ; } else { */ ok = 0; while ((no = lit_chiffre (1)) != 0L) { if ((pbul = ch_record (NULL, no, 'Y')) != NULL) { if (droit_ok (pbul, 1)) { if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_read = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = no; ptemp->verb = verbose; ok = 2; } else texte (T_ERR + 10); } else texte (T_ERR + 10); } /* } */ break; default: if ((c == '\0') && (verbose)) { texte (T_MBL + 8); ok = 0; } else { error = 1; --indd; ok = 4; } break; } switch (ok) { case 0: prompt_themes (); break; case 1: pvoie->recliste.ptemp = last_dir (); pvoie->recliste.offset = T_BLOC_MESS; pvoie->temp1 = 1; pvoie->sr_mem = 1; ch_niv3 (1); themes_read (verbose); break; case 2: pvoie->sr_mem = 1; ch_niv3 (2); themes_read (verbose); break; } ff (); return (error); } static int themes_read (int verbose) { int error = 0; df ("themes_read", 1); switch (pvoie->niv3) { case 0: ++indd; error = themes_rx (verbose); break; case 1: switch (mbl_bloc_list ()) { case 0: /* Pas de message */ texte (T_MBL + 3); prompt_themes (); case 1: /* Pas fini */ break; case 2: /* Termine */ ch_niv3 (2); mbl_read (verbose); break; } break; case 2: if (mbl_mess_read () == 0) { prompt_themes (); } break; case 3: if (read_mess (1) == 0) ch_niv3 (2); break; default: fbb_error (ERR_NIVEAU, "MSG-READ", pvoie->niv3); } ff (); return (error); } static void trans_num (void) { char s[256]; char buf[80]; char *ptr; int num; int i; n_cpy (255, s, indd); *indd = '\0'; ptr = s; while (*ptr) { if (isdigit (*ptr)) { i = 0; while (isdigit (*ptr)) { buf[i++] = *ptr++; } buf[i] = '\0'; num = atoi (buf) - 1; if ((num >= 0) && (num < (pvoie->psiz / sizeof (long)))) { long lnum; lnum = ((long *) pvoie->ptemp)[num]; strcat (indd, ltoa (lnum, buf, 10)); } else { /* Erreur */ } } else { buf[0] = *ptr++; buf[1] = '\0'; strcat (indd, buf); } } } int themes_list (void) { int mode_list = 1; int verbose = 0; int error = 0; switch (pvoie->niv3) { case 0: if (toupper (*indd) == 'C') { return (list_lc ()); } switch (themes_lx ()) { case 0: prompt_themes (); case 2: mode_list = 0; break; case 1: pvoie->temp2 = nbl_page (voiecur); alloue_list_numeros (); ch_niv3 (1); break; case 3: mode_list = 0; error = 1; --indd; break; } break; case 1: break; case 2: while_space (); switch (toupper (*indd)) { case 'A': mode_list = 0; prompt_themes (); break; case 'V': verbose = 1; case 'R': mode_list = 0; incindd (); if (isdigit (*indd)) { trans_num (); pvoie->aut_nc = 1; list_read (verbose); pvoie->sr_mem = 1; if (mbl_mess_read () == 0) { pvoie->sr_mem = 0; texte (T_QST + 6); } } else { texte (T_ERR + 3); texte (T_QST + 6); } break; default: pvoie->temp2 = nbl_page (voiecur); alloue_list_numeros (); ch_niv3 (1); break; } break; case 3: mode_list = 0; pvoie->aut_nc = 1; if (read_mess (1) == 0) ch_niv3 (4); break; case 4: mode_list = 0; pvoie->aut_nc = 1; pvoie->sr_mem = 1; if (mbl_mess_read () == 0) { pvoie->sr_mem = 0; texte (T_QST + 6); ch_niv3 (2); } break; default: fbb_error (ERR_NIVEAU, "MSG-LIST", pvoie->niv3); } if (mode_list) { pvoie->lignes = -1; switch (themes_bloc_liste ()) { case 0: break; case 1: prompt_themes (); break; case 2: texte (T_QST + 6); ch_niv3 (2); break; } } return (error); } int nom_theme (char *nom) { int i; strupr (sup_ln (nom)); if (strlen(nom) > 2) { for (i = 0; i < tot_themes; i++) { if (strncmpi (theme_liste[i].nom, nom, strlen(nom)) == 0) { pvoie->finf.theme = i; list_topics (); prompt_themes (); return (1); } } } return (0); } void theme_err (char *ptri) { int i = 0; char *ptr = varx[0]; while (ISGRAPH (*ptri)) { if (++i == 40) break; else *ptr++ = *ptri++; } *ptr = '\0'; texte (T_ERR + 1); *varx[0] = '\0'; if ((FOR (pvoie->mode)) || (++pvoie->nb_err == MAX_ERR)) pvoie->deconnect = 6; else prompt_themes (); } int menu_themes (void) { int error = 0; int verbose = 0; char *com = indd; if (tot_themes == 0) { texte (T_DOS + 2); retour_mbl (); return (error); } if (nom_theme (indd)) return (error); switch (toupper (*indd)) { case 'H': display_themes (); break; case 'Q': case 'F': retour_mbl (); break; case 'L': ch_niv2 (1); error = themes_list (); break; case 'V': verbose = 1; case 'R': ch_niv2 (2); error = themes_read (verbose); break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; default: if (isdigit (*indd)) { int select = atoi (indd); if ((select >= 0) && (select < tot_themes) && (theme_liste[select].nb_bull)) { pvoie->finf.theme = select; list_topics (); } else { texte (T_DOS + 2); } prompt_themes (); } else if (!ISGRAPH (*indd)) { display_themes (); } else { error = 1; } break; } if (error) theme_err (com); return (error); } int themes (void) { int ret = 0; if (POP (no_port(voiecur))) { incindd (); switch (*indd) { case 'G': /* Select group "G name" */ incindd(); group_select(indd); break; case 'P': /* Select previous bulletin in the theme */ group_previous(); break; case 'N': /* Select next bulletin in the theme */ group_next(); break; case 'R': /* Read a bulletin number "R mode #nb" */ incindd(); group_read(indd); break; case 'H': /* Read a bulletin number "R mode #nb" */ incindd(); group_xhdr(indd); break; case 'O': /* Read a bulletin number "R mode #nb" */ incindd(); group_xover(indd); break; default : ret = 1; break; } retour_mbl(); return ret; } switch (pvoie->niv2) { case 0: ret = menu_themes (); break; case 1: ret = themes_list (); break; case 2: ret = themes_read (0); break; default : ret = 0; break; } return (ret); } static void error_file (void) { char wtexte[200]; deb_io (); #ifdef ENGLISH if (operationnel) { sprintf (wtexte, "\r\nError in file THEMES.SYS line %d \r\n\a", nolig); if (w_mask & W_FILE) mess_warning (admin, "*** FILE ERROR *** ", wtexte); } sprintf (wtexte, "Error in file THEMES.SYS line %d ", nolig); #else if (operationnel) { sprintf (wtexte, "\r\nErreur fichier THEMES.SYS ligne %d\r\n\a", nolig); if (w_mask & W_FILE) mess_warning (admin, "*** ERREUR FICHIER ***", wtexte); } sprintf (wtexte, "Erreur fichier THEMES.SYS ligne %d", nolig); #endif fin_io (); win_message (5, wtexte); } /* Functions for the NNTP server */ static int n_theme; static int pos_theme(char *nom) { int i; strupr (sup_ln (nom)); for (i = 0; i < tot_themes; i++) { if (strcmpi (theme_liste[i].nom, nom) == 0) return i; } return -1; } char *next_group (void) { static char cur_buf[80]; if (n_theme >= tot_themes) return NULL; sprintf(cur_buf, "%s %ld %ld %c", theme_liste[n_theme].nom, theme_liste[n_theme].last_bull, theme_liste[n_theme].first_bull, 'n'); ++n_theme; return cur_buf; } char *first_group (void) { load_themes(); n_theme = 0; return next_group(); } char *get_group_info(char *nom, char *buffer) { int val = pos_theme (nom); if (val == -1) return NULL; sprintf(buffer, "%d %ld %ld %s", theme_liste[val].nb_bull, theme_liste[val].first_bull, theme_liste[val].last_bull, theme_liste[val].nom); return buffer; } static int group_st(char *buffer, long nbul, int mode) { char *strm[4] = {"text follows", "head follows", "body follows", "statistics"}; int intm[4] = {220, 221, 222, 223}; bullist *pbul = NULL; int cur_theme = pvoie->groupe; int ret = 0; if (cur_theme == -1) { strcpy(buffer, "412 No group selected"); } else if (nbul == -1L) { strcpy(buffer, "420 No current bulletin"); } else { long numero; int group = (cur_theme == 0) ? -1 : cur_theme; numero = grp_to_bull(cur_theme, nbul); pbul = ch_record (NULL, numero, ' '); if (pbul == NULL) strcpy(buffer, "430 No such bulletin"); else if (pbul->theme != group) strcpy(buffer, "423 No such bulletin in the current group"); else { sprintf(buffer, "%d %ld <%ld@%s> - %s", intm[mode], nbul, numero, mycall, strm[mode]); pvoie->cur_bull = nbul; ret = 1; } } return (ret); } static int get_range(char *ptr, long *first, long *last) { char *scan; *first = 0; *last = 0x7fffffff; if (*ptr) { *first = atol(ptr); scan = strchr(ptr, '-'); if (scan) { ++scan; if (isdigit(*scan)) *last = atol(scan); } else { *last = *first; } } return 1; } static void send_overview(long numero, bullist *pbul) { char buffer[256]; int nb; /* I simplified the Subject line just to remove a little clutter */ nb = sprintf(buffer, "%ld\t%s\t%s\t%s\t<%ld@%s>\t\t%ld\t%d", numero, pbul->titre, pbul->exped, pop_date(pbul->datesd), pbul->numero, mycall, /* reference, ? */ pbul->taille, 1); outsln(buffer, nb); } static void group_xover(char *ptr) { char buffer[80]; long nbul; long numero; bullist *pbul; long first, last; int cur_theme; cur_theme = (int)pvoie->groupe; if (cur_theme == -1) { strcpy(buffer, "412 No group selected\r\032"); } else { if (get_range(ptr, &first, &last)) { if (last > theme_liste[cur_theme].last_bull) last = theme_liste[cur_theme].last_bull; strcpy(buffer, "224 Overview information"); outsln(buffer, strlen(buffer)); ouvre_dir (); for (nbul = first ; nbul <= last ; nbul++) { if (nbul < theme_liste[cur_theme].first_bull || nbul > theme_liste[cur_theme].last_bull) continue; numero = grp_to_bull(cur_theme, nbul); if (numero > 0L) { pbul = ch_record (NULL, numero, ' '); send_overview(nbul, pbul); } } ferme_dir (); outsln("\033\r", 2); return; } else { strcpy(buffer, "420 No bulletin selected\r\032"); } } outsln(buffer, strlen(buffer)); } static void group_select(char *ptr) { int val = pos_theme (ptr); int nb; char buf[80]; if (val == -1) { nb = sprintf(buf, "411 No such group"); } else { pvoie->groupe = val; nb = sprintf(buf, "211 %d %ld %ld %s", theme_liste[val].nb_bull, theme_liste[val].first_bull, theme_liste[val].last_bull, theme_liste[val].nom); } outsln(buf, nb); } static void group_read(char *ptr) { char buffer[80]; char *scan; int mode; int ret; long numero = pvoie->cur_bull; scan = strchr(ptr, '<'); if (scan) { /* Get by ID */ sscanf(ptr, "%d", &mode); ++scan; numero = atol(scan); } else { /* Get by number */ sscanf(ptr, "%d %ld", &mode, &numero); } ret = group_st(buffer, numero, mode); outsln(buffer, strlen(buffer)); if (ret) { if (!scan) { /* update the current bulletin number */ pvoie->cur_bull = numero; } if (mode != 3) { int cur_theme = pvoie->groupe; int group = (cur_theme == -1L) ? 0 : cur_theme; long nbul = grp_to_bull(group, numero); sprintf(indd, " %ld\r", nbul); mbl_read (0); } } else { outsln("\032\r", 2); } } static void group_next(void) { char buffer[80]; int trouve = 0; int cur_theme = pvoie->groupe; long nbul = pvoie->cur_bull; if (cur_theme == -1) { strcpy(buffer, "412 No group selected"); } else if (nbul == -1L) { strcpy(buffer, "420 No current bulletin"); } else { while (nbul < theme_liste[cur_theme].last_bull) { ++nbul; if (grp_to_bull(cur_theme, nbul) != 0L) { trouve = 1; break; } } if (trouve) { group_st(buffer, nbul, 3); } else { strcpy(buffer, "422 No next bulletin in group"); } } outsln(buffer, strlen(buffer)); } static void group_previous(void) { char buffer[80]; int trouve = 0; int cur_theme = pvoie->groupe; long nbul = pvoie->cur_bull; if (cur_theme == -1) { strcpy(buffer, "412 No group selected"); } else if (nbul == -1L) { strcpy(buffer, "420 No current bulletin"); } else { while (nbul > theme_liste[cur_theme].first_bull) { --nbul; if (grp_to_bull(cur_theme, nbul) != 0L) { trouve = 1; break; } } if (trouve) { group_st(buffer, nbul, 3); } else { strcpy(buffer, "422 No previous bulletin in group"); } } outsln(buffer, strlen(buffer)); } static void group_xhdr(char *ptr) { /* char head[80]; char range[80]; sscanf(ptr, "%s %s", head, range); if (strcmpi(head, "subject) != 0) */ } fbb-7.0.10/src/statis.c0000644000175000017500000002116313613360505011520 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE STATIS.C */ #include #ifdef THIRTYTWOBITDATA static struct tm *fbb_localtime(int *time) { long ltime = *time; return localtime(<ime); } #else #define fbb_localtime localtime #endif static void menu_statistiques (void); static void histo_jour (void) { FILE *fptr; long hist[7], max, sommet, nbc, debtime; int i, d; struct tm *sdate; statis buffstat; for (i = 0; i < 7; hist[i++] = 0L) ; incindd (); tester_masque (); debtime = time (NULL) - (86400L * 14L); fptr = ouvre_stats (); fflush (fptr); nbc = filelength (fileno (fptr)); do { nbc -= (MAXSTAT * (long) sizeof (buffstat)); if (nbc < 0L) { nbc = 0; break; } fseek (fptr, nbc, 0); fread ((char *) &buffstat, sizeof (buffstat), 1, fptr); } while (buffstat.datcnx > debtime); do { if (buffstat.datcnx >= debtime) { char cal[8]; n_cpy (6, cal, buffstat.indcnx); if (strmatch (cal, pvoie->ch_temp)) { sdate = fbb_localtime (&buffstat.datcnx); hist[(sdate->tm_wday + 6) % 7] += buffstat.tpscnx; } } } while (fread ((char *) &buffstat, sizeof (buffstat), 1, fptr) == 1); ferme (fptr, 13); sommet = max = 10L; for (i = 0; i < 7; i++) if (hist[i] > max) max = hist[i]; for (i = 0; i < 7; i++) hist[i] = (hist[i] * sommet) / max; texte (T_STA + 3); for (i = (int) sommet; i > 0; i--) { out (" ", 1); for (d = 0; d < 7; d++) { if (hist[d] >= i) out (" *** ", 5); else out (" ", 5); } out ("\r", 1); } outln (" ----------------------------------", 35); texte (T_STA + 4); retour_menu (N_STAT); } static void histo_heure (void) { long hist[24], max, sommet; FILE *fptr; int i, h; long nbc, nbc_total; struct tm *sdate; statis buffstat; long record; for (i = 0; i < 24; hist[i++] = 0L) ; incindd (); tester_masque (); fptr = ouvre_stats (); fflush (fptr); record = filelength (fileno (fptr)); nbc_total = record / (long) sizeof (statis); nbc = record - (MAXSTAT * (long) sizeof (statis)); if (nbc < 0L) nbc = 0L; fseek (fptr, nbc, 0); if (record) { nbc = MAXSTAT; } else { nbc = nbc_total; } while (fread ((char *) &buffstat, sizeof (buffstat), 1, fptr) == 1) { char cal[8]; n_cpy (6, cal, buffstat.indcnx); if (strmatch (cal, pvoie->ch_temp)) { sdate = fbb_localtime (&buffstat.datcnx); hist[sdate->tm_hour] += buffstat.tpscnx; } } ferme (fptr, 14); sommet = max = 10L; for (i = 0; i < 24; i++) if (hist[i] > max) max = hist[i]; for (i = 0; i < 24; i++) hist[i] = (hist[i] * sommet) / max; texte (T_STA + 5); for (i = (int) sommet; i > 0; i--) { for (h = 0; h < 24; h++) { if (hist[h] >= i) out ("*", 1); else out (" ", 1); } out ("\r", 1); } outln ("------------------------", 24); texte (T_STA + 6); texte (T_STA + 7); retour_menu (N_STAT); } static void generalites (void) { struct tm *sdate; statis buffstat; FILE *fptr; long nbc = (long) MAXSTAT, nbc_total; int i, nbjour = 0, h1 = 0, h2 = 0; long hist[24], somme_tps = 0L, max1 = 0L, max2 = 0L; long record, depart = 0; for (i = 0; i < 24; hist[i++] = 0L) ; fptr = ouvre_stats (); fflush (fptr); record = filelength (fileno (fptr)); nbc_total = record / (long) sizeof (statis); nbc = record - (MAXSTAT * (long) sizeof (statis)); if (nbc < 0L) nbc = 0L; fseek (fptr, nbc, 0); nbc = 0L; nbjour = 0L; while (fread ((char *) &buffstat, sizeof (buffstat), 1, fptr) == 1) { if (nbjour == 0) { /* Compte le nombre de jours */ nbjour = (int) ((time (NULL) - buffstat.datcnx) / 86400L); /* Fait le calcul sur un nombre de jours entier */ depart = time (NULL) - (long) nbjour *86400L; } sdate = fbb_localtime (&buffstat.datcnx); if (buffstat.datcnx > depart) { hist[sdate->tm_hour] += (long) buffstat.tpscnx; ++nbc; } } for (i = 0; i < 24; i++) { somme_tps += hist[i]; if (hist[i] > max1) { h2 = h1; max2 = max1; h1 = i; max1 = hist[i]; } else if (hist[i] > max2) { h2 = i; max2 = hist[i]; } } rewind (fptr); fread ((char *) &buffstat, sizeof (buffstat), 1, fptr); ferme (fptr, 15); texte (T_STA + 8); ltoa (nbc_total, varx[0], 10); if (nbc_total) ptmes->date = buffstat.datcnx; else ptmes->date = time (NULL); texte (T_STA + 9); if (nbc) i = (int) (somme_tps / (long) nbc); else i = 0; itoa (i / 60, varx[0], 10); sprintf (varx[1], "%02d", i % 60); texte (T_STA + 10); if (nbjour == 0) nbjour = 1; ltoa (nbc / (long) nbjour, varx[0], 10); texte (T_STA + 11); itoa (h1, varx[0], 10); itoa (h2, varx[1], 10); texte (T_STA + 12); retour_menu (N_STAT); } static void occupation (void) { long total, stotal; float ftotal; stotal = stemps[N_DOS] + stemps[N_QRA] + stemps[N_INFO] + stemps[N_STAT] + stemps[N_NOMC] + stemps[N_TRAJ]; total = stotal + stemps[N_MBL]; ftotal = ((float) total) / 100.0; if (ftotal == 0.0) { ftotal = 1E-5; } texte (T_STA + 13); sprintf (varx[0], "%4.1f", ((float) stemps[N_MBL]) / ftotal); texte (T_STA + 14); sprintf (varx[0], "%4.1f", ((float) stotal) / ftotal); texte (T_STA + 15); ftotal = (float) (stotal) / 100.0; if (ftotal == 0.0) ftotal = 1E-5; texte (T_STA + 16); sprintf (varx[0], "%4.1f", ((float) stemps[N_DOS]) / ftotal); texte (T_STA + 17); sprintf (varx[0], "%4.1f", ((float) stemps[N_QRA]) / ftotal); texte (T_STA + 18); sprintf (varx[0], "%4.1f", ((float) stemps[N_INFO]) / ftotal); texte (T_STA + 19); sprintf (varx[0], "%4.1f", ((float) stemps[N_STAT]) / ftotal); texte (T_STA + 20); sprintf (varx[0], "%4.1f", ((float) stemps[N_NOMC]) / ftotal); texte (T_STA + 21); sprintf (varx[0], "%4.1f", ((float) stemps[N_TRAJ]) / ftotal); texte (T_STA + 22); retour_menu (N_STAT); } static void liste_connect (void) { char c; FILE *fptr; pvoie->lignes = -1; switch (pvoie->niv3) { case 0: incindd (); tester_masque (); fptr = ouvre_stats (); fseek (fptr, 0L, 2); pvoie->noenr_menu = ftell (fptr); if (page_connect ('\0', fptr)) { texte (T_TRT + 11); maj_niv (3, 1, 1); } else retour_menu (N_STAT); ferme (fptr, 16); break; case 1: c = toupper (*indd); if ((c == 'A') || (c == 'F') || (c == Non)) { maj_niv (3, 0, 0); incindd (); menu_statistiques (); } else { fptr = ouvre_stats (); if (!page_connect ('\0', fptr)) retour_menu (N_STAT); else texte (T_TRT + 11); ferme (fptr, 17); } break; default: fbb_error (ERR_NIVEAU, "LIST-CONN", pvoie->niv3); break; } } /* * MENUS - PREMIER NIVEAU STATISTIQUES */ static void menu_statistiques (void) { int error = 0; char com[80]; limite_commande (); while (*indd && (!ISGRAPH (*indd))) indd++; strn_cpy (70, com, indd); switch (toupper (*indd)) { case 'L': maj_niv (3, 1, 0); liste_connect (); break; case 'I': maj_niv (3, 2, 0); incindd (); liste_indic (); break; case 'J': maj_niv (3, 3, 0); /* maj_niv non necessaire */ histo_jour (); /* histo traite en un seul bloc */ break; case 'H': maj_niv (3, 4, 0); histo_heure (); break; case 'G': maj_niv (3, 5, 0); generalites (); break; case 'O': maj_niv (3, 6, 0); occupation (); break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; case 'F': maj_niv (0, 1, 0); incindd (); choix (); break; case '\0': prompt (pvoie->finf.flags, pvoie->niv1); break; default: if (!defaut ()) error = 1; break; } if (error) { cmd_err (indd); } } void statistiques (void) { switch (pvoie->niv2) { case 0: menu_statistiques (); break; case 1: liste_connect (); break; case 2: liste_indic (); break; case 3: histo_jour (); break; case 4: histo_heure (); break; case 5: generalites (); break; case 6: occupation (); break; default: fbb_error (ERR_NIVEAU, "STATS", pvoie->niv2); break; } } fbb-7.0.10/src/wpserv.c0000644000175000017500000003165013613360505011541 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Serveur White Pages * * Do not overlay ! * */ #include #define LG_CACHE 20 #define MAX_UPD 10 static Wpr *wp_cache = NULL; static int pos_cache = 0; #define WP_TRACE #ifdef WP_TRACE static int deb_wp = 0; #endif void add_wp_trace (int val) { deb_wp = val; } int is_wpupdate (char *titre) { char str[10]; strn_cpy (9, str, titre); return (strcmp ("WP UPDATE", str) == 0); } void debug_wp (char *deb) { FILE *wp_fptr; if (!deb_wp) return; wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); if (!wp_fptr) return; fputs (deb, wp_fptr); fclose (wp_fptr); } static int wp_read (Wpr * rec) { static long wp_record = 0L; int retour; FILE *fptr; deb_io (); fptr = fopen (d_disque ("WP\\FBB.WP"), "rb"); if (fptr == NULL) { fin_io (); wp_record = 0L; return (0); } fseek (fptr, wp_record * sizeof (Wpr), SEEK_SET); retour = fread (rec, sizeof (Wpr), MAX_UPD, fptr); fclose (fptr); if (retour == MAX_UPD) { wp_record += (long) retour; } else { unlink (d_disque ("WP\\FBB.WP")); wp_record = 0L; } fin_io (); return (retour); } #ifdef WP_TRACE static void debug_wp_user (char *type, FILE * fptr, long record, Wps * rec, Wpr * ask) { char modif[80]; char seen[80]; if (!deb_wp) return; strcpy (modif, date_mbl (rec->last_modif)); strcpy (seen, date_mbl (rec->last_seen)); fprintf (fptr, "[%s] %-4ld: %s %s %-6s (%u) %s (source %c)\n", type, record, modif, seen, rec->callsign, rec->seen, (*rec->name) ? rec->name : "?", rec->changed ); fprintf (fptr, " [1] @%s Zip:%s Qth:%s\n", rec->first_homebbs, (*rec->first_zip) ? rec->first_zip : "?", (*rec->first_qth) ? rec->first_qth : "?" ); fprintf (fptr, " [2] @%s Zip:%s Qth:%s\n", rec->secnd_homebbs, (*rec->secnd_zip) ? rec->secnd_zip : "?", (*rec->secnd_qth) ? rec->secnd_qth : "?" ); fprintf (fptr, "Ask on %s source=%c local=%d :\n %s@%s Name:%s Zip:%s Qth:%s\n", date_mbl (ask->last), ask->source, ask->local, ask->callsign, ask->homebbs, ask->name, ask->zip, ask->qth ); } #endif static void wp_update (Wpr * rec) { Wps up_rec; char *ptr; FILE *fptr; int ok = 0; Wp wp; /* int cur_page; */ int maj; int upd; unsigned record; #ifdef WP_TRACE FILE *wp_fptr = NULL; Wps old_rec; #endif deb_io (); upd = maj = 0; fptr = fopen (d_disque ("WP\\WP.SYS"), "r+b"); if (fptr == NULL) { fptr = fopen (d_disque ("WP\\WP.SYS"), "w+b"); if (fptr == NULL) { /* remet_bloc(cur_page); */ fin_io (); return; } } record = search_wp_record (call2l (rec->callsign), USR_CALL, 0); if (record < 0xffff) ok = 1; if (ok) { #ifdef WP_TRACE #endif fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fread (&up_rec, sizeof (Wps), 1, fptr); #ifdef WP_TRACE old_rec = up_rec; #endif if (rec->last >= up_rec.last_seen) { up_rec.last_seen = rec->last; /* Name */ if (*rec->name) { if ((*up_rec.name == '\0') || (rec->source == 'U')) { n_cpy (12, up_rec.name, rec->name); maj = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "Upd : Name = <%s>\n", rec->name); } #endif } } /* Home BBS */ if (*rec->homebbs) { if ((*rec->homebbs) && (strncmp (up_rec.secnd_homebbs, rec->homebbs, 40) != 0)) { strn_cpy (40, up_rec.secnd_homebbs, rec->homebbs); upd = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "2nd : New HomeBBS = <%s>\n", rec->homebbs); } #endif } if ((*up_rec.first_homebbs == '\0') || (rec->source == 'U') || (!strchr (up_rec.first_homebbs, '.') && strchr (rec->homebbs, '.'))) { strn_cpy (40, up_rec.first_homebbs, rec->homebbs); maj = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "1st : New HomeBBS = <%s>\n", rec->homebbs); } #endif } } /* ZIP */ if (*rec->zip) { ptr = rec->zip; while (*ptr) { /* Remplace les espaces par '_' */ if (isspace (*ptr)) *ptr = '_'; ++ptr; } if (strncmp (up_rec.secnd_zip, rec->zip, 8) != 0) { strn_cpy (8, up_rec.secnd_zip, rec->zip); upd = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "2nd : New Zip = <%s>\n", rec->zip); } #endif } if ((*up_rec.first_zip == '\0') || (rec->source == 'U')) { strn_cpy (8, up_rec.first_zip, rec->zip); maj = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "1st : New Zip = <%s>\n", rec->zip); } #endif } } /* QTH */ if (*rec->qth) { if (strncmp (up_rec.secnd_qth, rec->qth, 30) != 0) { n_cpy (30, up_rec.secnd_qth, rec->qth); upd = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "2nd : New Qth = <%s>\n", rec->qth); } #endif } if ((*up_rec.first_qth == '\0') || (rec->source == 'U')) { n_cpy (30, up_rec.first_qth, rec->qth); maj = 1; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); debug_wp_user ("OLD", wp_fptr, record, &old_rec, rec); } fprintf (wp_fptr, "1st : New Qth = <%s>\n", rec->qth); } #endif } } /* Mise a jour de la base */ if (maj || upd) { if ((up_rec.changed != 'U') && !rec->local) up_rec.changed = rec->source; up_rec.last_modif = rec->last; #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); } fprintf (wp_fptr, "1st = %d 2nd = %d\n", maj, upd); debug_wp_user ("WRT", wp_fptr, record, &up_rec, rec); } #endif } else { #ifdef WP_TRACE if (deb_wp >= 3) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); } fprintf (wp_fptr, "WP not updated, no difference with WP database\n"); debug_wp_user ("TST", wp_fptr, record, &up_rec, rec); } #endif } /* Mise a jour de la date de derniere modif */ ++up_rec.seen; fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); fwrite (&up_rec, sizeof (Wps), 1, fptr); /* if (upd || maj) up_rec.secnd_date = time(NULL); */ if (maj) { wp.callsign = call2l (rec->callsign); wp.home = call2l (bbs_via (up_rec.first_homebbs)); write_wp (record, &wp); } } else { #ifdef WP_TRACE if (deb_wp >= 2) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); } fprintf (wp_fptr, "WP not updated, information on %s is older\n", date_mbl (rec->last)); debug_wp_user ("TST", wp_fptr, record, &up_rec, rec); } #endif } } else { fflush (fptr); record = (unsigned) (filelength (fileno (fptr)) / (long) sizeof (Wps)); memset (&up_rec, '\0', sizeof (Wps)); up_rec.free = 0; up_rec.changed = 0; up_rec.seen = 1; up_rec.last_modif = up_rec.last_seen = rec->last; strn_cpy (6, up_rec.callsign, rec->callsign); n_cpy (12, up_rec.name, rec->name); strn_cpy (40, up_rec.first_homebbs, rec->homebbs); strn_cpy (8, up_rec.first_zip, rec->zip); n_cpy (30, up_rec.first_qth, rec->qth); strn_cpy (40, up_rec.secnd_homebbs, rec->homebbs); strn_cpy (8, up_rec.secnd_zip, rec->zip); n_cpy (30, up_rec.secnd_qth, rec->qth); fseek (fptr, (long) record * sizeof (Wps), SEEK_SET); wp.callsign = call2l (rec->callsign); wp.home = call2l (bbs_via (rec->homebbs)); if (!rec->local) up_rec.changed = rec->source; fwrite (&up_rec, sizeof (Wps), 1, fptr); write_wp (record, &wp); #ifdef WP_TRACE if (deb_wp) { if (wp_fptr == NULL) { wp_fptr = fopen (d_disque ("WP\\WP.DBG"), "at"); } fprintf (wp_fptr, "Creates new record\n"); debug_wp_user ("CRT", wp_fptr, record, &up_rec, rec); } #endif } fclose (fptr); #ifdef WP_TRACE if (deb_wp) { if (wp_fptr) { fprintf (wp_fptr, "\n\n"); fclose (wp_fptr); } } #endif fin_io (); } int wp_server (void) { int nb; int i; int retour = 0; Wpr rec[MAX_UPD]; df ("wp_server", 0); aff_etat ('X'); if ((nb = wp_read (rec)) != 0) { for (i = 0; i < nb; i++) { wp_update (&rec[i]); } if (nb == MAX_UPD) retour = 1; } if (!retour) { dde_wp_serv = 0; } ff (); aff_msg_cons (); return (retour); } void ini_rec (Wpr * rec) { rec->local = 0; rec->last = time (NULL); rec->source = '\0'; *rec->homebbs = '\0'; *rec->callsign = '\0'; *rec->zip = '\0'; *rec->name = '\0'; *rec->qth = '\0'; } int is_serv (char *call) { serlist *lptr; lptr = tete_serv; while (lptr) { if (strcmp (lptr->nom_serveur, call) == 0) return (1); lptr = lptr->suiv; } return (0); } void wp_upd (Wpr * rec, int flush) { FILE *fptr; if ((!EMS_WPG_OK ()) || (wp_cache == NULL)) return; if (rec) { if (!rec->homebbs && !rec->name && !rec->zip && !rec->qth) return; if ((!find (rec->callsign)) || (is_serv (rec->callsign)) || (strcmp (rec->callsign, "SYSOP") == 0)) return; } deb_io (); if ((rec) && (pos_cache < LG_CACHE)) { wp_cache[pos_cache++] = *rec; } if ((pos_cache) && ((flush) || (pos_cache == LG_CACHE))) { fptr = fopen (d_disque ("WP\\FBB.WP"), "ab"); if (fptr == NULL) { fin_io (); return; } fwrite (wp_cache, sizeof (Wpr), pos_cache, fptr); fclose (fptr); dde_wp_serv = 1; pos_cache = 0; } fin_io (); } void exped_wp (char *exped, char *route) { Wpr rec; if (!EMS_WPG_OK ()) return; if (!find (exped)) return; ini_rec (&rec); rec.source = 'G'; strn_cpy (6, rec.callsign, exped); strn_cpy (40, rec.homebbs, route); if (addr_check (route)) wp_upd (&rec, 0); } void user_wp (info * finf) { Wpr rec; if (!EMS_WPG_OK ()) return; ini_rec (&rec); rec.source = 'U'; strn_cpy (6, rec.callsign, finf->indic.call); if (*finf->home) strn_cpy (40, rec.homebbs, extend_bbs (finf->home)); else strn_cpy (40, rec.homebbs, mypath); if (*finf->zip) strn_cpy (8, rec.zip, finf->zip); if (*finf->prenom != '?') n_cpy (12, rec.name, finf->prenom); if (*finf->ville) n_cpy (30, rec.qth, finf->ville); if (addr_check (rec.homebbs)) { wp_upd (&rec, 1); flush_wp_cache (); } } void header_wp (long date, char *home, char *qth, char *zip) { char st[80]; char *ptr; Wpr rec; if (!EMS_WPG_OK ()) return; ini_rec (&rec); rec.source = 'I'; rec.last = date; strn_cpy (40, rec.homebbs, home); n_cpy (30, rec.qth, qth); strn_cpy (8, rec.zip, zip); strn_cpy (40, st, home); ptr = strchr (st, '.'); if (ptr) *ptr = '\0'; strn_cpy (6, rec.callsign, st); if (addr_check (home)) wp_upd (&rec, 0); } void end_wp (void) { if (wp_cache) { m_libere (wp_cache, sizeof (Wpr) * LG_CACHE); wp_cache = NULL; } } void init_wp_cache (void) { wp_cache = (Wpr *) m_alloue (sizeof (Wpr) * LG_CACHE); pos_cache = 0; } void flush_wp_cache (void) { wp_upd (NULL, 1); } lcall call2l (char *callsign) { char *ptr = callsign; int c; lcall val = 0L; while ((c = (int) *ptr++) != 0) { if (c < 48) return (0xffffffffL); c -= 47; if (c > 10) { c -= 7; if (c > 36) { return (0xffffffffL); } else if (c < 11) { return (0xffffffffL); } } val *= 37; val += c; } return (val); } fbb-7.0.10/src/md5c.c0000644000175000017500000002562613613360505011051 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* MD5C.C - RSA Data Security, Inc., MD5 message-digest algorithm */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include "global.h" #include "md5.h" /* Constants for MD5Transform routine. */ #define S11 7 #define S12 12 #define S13 17 #define S14 22 #define S21 5 #define S22 9 #define S23 14 #define S24 20 #define S31 4 #define S32 11 #define S33 16 #define S34 23 #define S41 6 #define S42 10 #define S43 15 #define S44 21 static void MD5Transform PROTO_LIST ((UINT4[4], uchar[64])); static void Encode PROTO_LIST ((uchar *, UINT4 *, unsigned int)); static void Decode PROTO_LIST ((UINT4 *, uchar *, unsigned int)); static void MD5_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); static void MD5_memset PROTO_LIST ((POINTER, int, unsigned int)); static uchar PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G, H and I are basic MD5 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (z)) | ((y) & (~z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) #define I(x, y, z) ((y) ^ ((x) | (~z))) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG, HH, and II transformations for rounds 1, 2, 3, and 4. Rotation is separate from addition to prevent recomputation. */ #define FF(a, b, c, d, x, s, ac) { \ (a) += F ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define GG(a, b, c, d, x, s, ac) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define HH(a, b, c, d, x, s, ac) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } #define II(a, b, c, d, x, s, ac) { \ (a) += I ((b), (c), (d)) + (x) + (UINT4)(ac); \ (a) = ROTATE_LEFT ((a), (s)); \ (a) += (b); \ } /* MD5 initialization. Begins an MD5 operation, writing a new context. */ void MD5Init (context) MD5_CTX *context; /* context */ { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301L; context->state[1] = 0xefcdab89L; context->state[2] = 0x98badcfeL; context->state[3] = 0x10325476L; } /* MD5 block update operation. Continues an MD5 message-digest operation, processing another message block, and updating the context. */ void MD5Update (context, input, inputLen) MD5_CTX *context; /* context */ uchar *input; /* input block */ unsigned int inputLen; /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int) ((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4) inputLen << 3)) < ((UINT4) inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4) inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { MD5_memcpy ((POINTER) & context->buffer[index], (POINTER) input, partLen); MD5Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) MD5Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ MD5_memcpy ((POINTER) & context->buffer[index], (POINTER) & input[i], inputLen - i); } /* MD5 finalization. Ends an MD5 message-digest operation, writing the the message digest and zeroizing the context. */ void MD5Final (digest, context) uchar digest[16]; /* message digest */ MD5_CTX *context; /* context */ { uchar bits[8]; unsigned int index, padLen; /* Save number of bits */ Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int) ((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); MD5Update (context, PADDING, padLen); /* Append length (before padding) */ MD5Update (context, bits, 8); /* Store state in digest */ Encode (digest, context->state, 16); /* Zeroize sensitive information. */ MD5_memset ((POINTER) context, 0, sizeof (*context)); } /* MD5 basic transformation. Transforms state based on block. */ static void MD5Transform (state, block) UINT4 state[4]; uchar block[64]; { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[0], S11, 0xd76aa478L); /* 1 */ FF (d, a, b, c, x[1], S12, 0xe8c7b756L); /* 2 */ FF (c, d, a, b, x[2], S13, 0x242070dbL); /* 3 */ FF (b, c, d, a, x[3], S14, 0xc1bdceeeL); /* 4 */ FF (a, b, c, d, x[4], S11, 0xf57c0fafL); /* 5 */ FF (d, a, b, c, x[5], S12, 0x4787c62aL); /* 6 */ FF (c, d, a, b, x[6], S13, 0xa8304613L); /* 7 */ FF (b, c, d, a, x[7], S14, 0xfd469501L); /* 8 */ FF (a, b, c, d, x[8], S11, 0x698098d8L); /* 9 */ FF (d, a, b, c, x[9], S12, 0x8b44f7afL); /* 10 */ FF (c, d, a, b, x[10], S13, 0xffff5bb1L); /* 11 */ FF (b, c, d, a, x[11], S14, 0x895cd7beL); /* 12 */ FF (a, b, c, d, x[12], S11, 0x6b901122L); /* 13 */ FF (d, a, b, c, x[13], S12, 0xfd987193L); /* 14 */ FF (c, d, a, b, x[14], S13, 0xa679438eL); /* 15 */ FF (b, c, d, a, x[15], S14, 0x49b40821L); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[1], S21, 0xf61e2562L); /* 17 */ GG (d, a, b, c, x[6], S22, 0xc040b340L); /* 18 */ GG (c, d, a, b, x[11], S23, 0x265e5a51L); /* 19 */ GG (b, c, d, a, x[0], S24, 0xe9b6c7aaL); /* 20 */ GG (a, b, c, d, x[5], S21, 0xd62f105dL); /* 21 */ GG (d, a, b, c, x[10], S22, 0x2441453L); /* 22 */ GG (c, d, a, b, x[15], S23, 0xd8a1e681L); /* 23 */ GG (b, c, d, a, x[4], S24, 0xe7d3fbc8L); /* 24 */ GG (a, b, c, d, x[9], S21, 0x21e1cde6L); /* 25 */ GG (d, a, b, c, x[14], S22, 0xc33707d6L); /* 26 */ GG (c, d, a, b, x[3], S23, 0xf4d50d87L); /* 27 */ GG (b, c, d, a, x[8], S24, 0x455a14edL); /* 28 */ GG (a, b, c, d, x[13], S21, 0xa9e3e905L); /* 29 */ GG (d, a, b, c, x[2], S22, 0xfcefa3f8L); /* 30 */ GG (c, d, a, b, x[7], S23, 0x676f02d9L); /* 31 */ GG (b, c, d, a, x[12], S24, 0x8d2a4c8aL); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[5], S31, 0xfffa3942L); /* 33 */ HH (d, a, b, c, x[8], S32, 0x8771f681L); /* 34 */ HH (c, d, a, b, x[11], S33, 0x6d9d6122L); /* 35 */ HH (b, c, d, a, x[14], S34, 0xfde5380cL); /* 36 */ HH (a, b, c, d, x[1], S31, 0xa4beea44L); /* 37 */ HH (d, a, b, c, x[4], S32, 0x4bdecfa9L); /* 38 */ HH (c, d, a, b, x[7], S33, 0xf6bb4b60L); /* 39 */ HH (b, c, d, a, x[10], S34, 0xbebfbc70L); /* 40 */ HH (a, b, c, d, x[13], S31, 0x289b7ec6L); /* 41 */ HH (d, a, b, c, x[0], S32, 0xeaa127faL); /* 42 */ HH (c, d, a, b, x[3], S33, 0xd4ef3085L); /* 43 */ HH (b, c, d, a, x[6], S34, 0x4881d05L); /* 44 */ HH (a, b, c, d, x[9], S31, 0xd9d4d039L); /* 45 */ HH (d, a, b, c, x[12], S32, 0xe6db99e5L); /* 46 */ HH (c, d, a, b, x[15], S33, 0x1fa27cf8L); /* 47 */ HH (b, c, d, a, x[2], S34, 0xc4ac5665L); /* 48 */ /* Round 4 */ II (a, b, c, d, x[0], S41, 0xf4292244L); /* 49 */ II (d, a, b, c, x[7], S42, 0x432aff97L); /* 50 */ II (c, d, a, b, x[14], S43, 0xab9423a7L); /* 51 */ II (b, c, d, a, x[5], S44, 0xfc93a039L); /* 52 */ II (a, b, c, d, x[12], S41, 0x655b59c3L); /* 53 */ II (d, a, b, c, x[3], S42, 0x8f0ccc92L); /* 54 */ II (c, d, a, b, x[10], S43, 0xffeff47dL); /* 55 */ II (b, c, d, a, x[1], S44, 0x85845dd1L); /* 56 */ II (a, b, c, d, x[8], S41, 0x6fa87e4fL); /* 57 */ II (d, a, b, c, x[15], S42, 0xfe2ce6e0L); /* 58 */ II (c, d, a, b, x[6], S43, 0xa3014314L); /* 59 */ II (b, c, d, a, x[13], S44, 0x4e0811a1L); /* 60 */ II (a, b, c, d, x[4], S41, 0xf7537e82L); /* 61 */ II (d, a, b, c, x[11], S42, 0xbd3af235L); /* 62 */ II (c, d, a, b, x[2], S43, 0x2ad7d2bbL); /* 63 */ II (b, c, d, a, x[9], S44, 0xeb86d391L); /* 64 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ MD5_memset ((POINTER) x, 0, sizeof (x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ static void Encode (output, input, len) uchar *output; UINT4 *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (uchar) (input[i] & 0xff); output[j + 1] = (uchar) ((input[i] >> 8) & 0xff); output[j + 2] = (uchar) ((input[i] >> 16) & 0xff); output[j + 3] = (uchar) ((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ static void Decode (output, input, len) UINT4 *output; uchar *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4) input[j]) | (((UINT4) input[j + 1]) << 8) | (((UINT4) input[j + 2]) << 16) | (((UINT4) input[j + 3]) << 24); } /* Note: Replace "for loop" with standard memcpy if possible. */ static void MD5_memcpy (output, input, len) POINTER output; POINTER input; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } /* Note: Replace "for loop" with standard memset if possible. */ static void MD5_memset (output, value, len) POINTER output; int value; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) ((char *) output)[i] = (char) value; } fbb-7.0.10/src/fbb_conf.c.in0000644000175000017500000001240613613360505012354 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include #include #define FBBCONFFILE "@sysconfdir@/ax25/fbb/fbb.conf" /* Default values for the fbb.conf file */ static char *defstr[] = { "conf", "@sysconfdir@/ax25/fbb", "data", "@localstatedir@/ax25/fbb", "mess", "@localstatedir@/ax25/fbb/mail", "comp", "@localstatedir@/ax25/fbb/binmail", "fbbd", "*,*,@localstatedir@/ax25/fbb/fbbdos,*,*,*,*,*", "yapp", "@localstatedir@/ax25/fbb/fbbdos/yapp", "docs", "@docdir@", "sysm", "", "impo", "@localstatedir@/ax25/fbb/mail/mail.in", "logs", "OK", "test", "NO", "fbbf", "OK 160", "fbbc", "OK 3", "aski", "OK", "mask", "3616", "secu", "0 4 59", "warn", "255", "hous", "2", "time", "10 20", "maxd", "0 0", "loca", "0", "beac", "8", "scro", "1500 1500 1500", "fwdh", "[$c] $$:$R", "maxb", "30000", "life", "30", "wpca", "", "zipc", "000000", "unpr", "500 5 P", "upba", "", "dwba", "", "pg", "@libdir@/fbb/pg", "fdir", "@libdir@/fbb/filter", "sdir", "@libdir@/fbb/server", "tdir", "@libdir@/fbb/tool", "poph", "", NULL }; /* a keyword has a maximum of 4 characters */ typedef struct conf_list { char key[5]; char *value; struct conf_list *next; } ConfList; static ConfList *conf_head = NULL; /* Creates a list of keyword = value */ int read_fbb_conf(char *pathname) { int i; int len; FILE *fp; char *ptr; char *scan; char line[256]; ConfList *conf; if (pathname == NULL) if ((pathname = getenv("FBBCONF")) == NULL) pathname = FBBCONFFILE; if ((fp = fopen (pathname, "r")) == NULL) return 1; while (fgets (line, sizeof(line), fp)) { scan = line; /* Eats spaces */ while (isspace(*scan)) ++scan; if (*scan == '#' || *scan == '\0') continue; /* remove the leading \n */ len = strlen(scan); if (len && (scan[len-1] == '\n')) scan[len-1] = '\0'; /* allocate a new structure */ conf = malloc(sizeof(ConfList)); if (conf == NULL) return 2; /* Not enough memory */ conf->value = NULL; conf->next = conf_head; conf_head = conf; /* extract the keyword */ i = 0; ptr = conf->key; while (isgraph(*scan)) { if (i++ < 4) { *ptr++ = *scan; } ++scan; if (*scan == '=') break; } *ptr = '\0'; /* finds the '=' */ scan = strchr(scan, '='); /* Copy the value */ if (scan) { ++scan; while (isspace(*scan)) ++scan; /* if the first character is '"' then string ends with '"' */ if (*scan == '"') { ++scan; ptr = strrchr(scan, '"'); if (ptr) *ptr = '\0'; } conf->value = strdup(scan); } else { conf->value = strdup(""); } } fclose(fp); return 0; } /* returns the value of a keyword. If unknown return NULL */ char *find_fbb_conf(char *key, int next) { static ConfList *conf_next = NULL; ConfList *conf = conf_head; if (next) conf = conf_next; while (conf) { if (strncasecmp(key, conf->key, 4) == 0) { conf_next = conf->next; return strdup(conf->value); } conf = conf->next; } return NULL; } /* returns the default value of a keyword. If unknown return NULL */ char *def_fbb_conf(char *key) { int pos; for (pos = 0 ; defstr[pos] ; pos += 2) { if (strncasecmp(key, defstr[pos], 4) == 0) { return strdup(defstr[pos+1]); } } return NULL; } /* free the list of keywords */ void free_fbb_conf(void) { ConfList *conf; while (conf_head) { conf = conf_head; conf_head = conf_head->next; free(conf->value); free(conf); } } /* get the list of default values */ char *get_fbb_def(int next) { static int pos = 0; char str[512]; if (next == 0) pos = 0; if (defstr[pos]) { sprintf(str, "%s\t%s", defstr[pos], defstr[pos+1]); pos += 2; return strdup(str); } return NULL; } /* get the list of all values */ char *get_fbb_all(int next) { static int first = 1; static int pos = 0; static ConfList *conf_next = NULL; char str[512]; if (first) { first = 0; pos = 0; conf_next = conf_head; } if (next == 0) { pos = 0; conf_next = conf_head; } if (conf_next) { sprintf(str, "s %s\t%s", conf_next->key, conf_next->value); conf_next = conf_next->next; return strdup(str); } while (defstr[pos]) { if (!find_fbb_conf(defstr[pos], 0)) { sprintf(str, "d %s\t%s", defstr[pos], defstr[pos+1]); pos += 2; return strdup(str); } else { pos += 2; } } return NULL; } fbb-7.0.10/src/fwdovl2.c0000644000175000017500000006042513615603431011600 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 2 */ #include #include static int tst_line (char *, int); static int tst_var (char *); char *idnt_fwd (void) { static char buffer[25]; char *ptr = buffer; *ptr++ = '['; *ptr++ = 'F'; *ptr++ = 'B'; *ptr++ = 'B'; *ptr++ = '-'; *ptr++ = '0' + PACKAGE_VERSION_MAJOR; *ptr++ = '.'; *ptr++ = '0' + PACKAGE_VERSION_MINOR; *ptr++ = '.'; //*ptr++ = '0' + PACKAGE_VERSION_MICRO; if (PACKAGE_VERSION_MICRO < 10) { *ptr++ = '0' + PACKAGE_VERSION_MICRO; } else if (PACKAGE_VERSION_MICRO < 100) { *ptr++ = '0' + (PACKAGE_VERSION_MICRO / 10); *ptr++ = '0' + (PACKAGE_VERSION_MICRO % 10); } *ptr++ = '-'; *ptr++ = 'A'; if (pvoie->prot_fwd & FWD_FBB) { if (pvoie->prot_fwd & FWD_BIN) { *ptr++ = 'B'; if (pvoie->prot_fwd & FWD_BIN1) *ptr++ = '1'; } *ptr++ = 'F'; } *ptr++ = 'H'; *ptr++ = 'M'; if (pvoie->mbl_ext) *ptr++ = 'R'; if (pvoie->prot_fwd & FWD_XPRO) *ptr++ = 'X'; *ptr++ = '$'; *ptr++ = ']'; *ptr++ = '\r'; *ptr++ = '\0'; return (buffer); } #ifdef __linux__ int nbcan_linux (void) { int nbcan = 0; int i; for (i = 1; i < NBPORT; i++) if (S_LINUX (i)) nbcan += p_port[i].nb_voies; return (nbcan); } #endif int nbcan_hst (void) { int nbcan = 0; int i; for (i = 1; i < NBPORT; i++) if ((HST (i)) && (p_port[i].ccanal != 0)) nbcan += p_port[i].nb_voies; return (nbcan); } int nbcan_drsi (void) { int nbcan = 0; int i; for (i = 1; i < NBPORT; i++) if (DRSI (i)) nbcan += p_port[i].nb_voies; return (nbcan); } int nbcan_bpq (void) { int nbcan = 0; int i; for (i = 1; i < NBPORT; i++) if (BPQ (i)) nbcan += p_port[i].nb_voies; return (nbcan); } int ch_voie (int port, int canal) { /* * Cherche une voie libre sur un port. * Commence par la derniere voie du port * * Si canal != 0, essaye d'allouer le canal specifie. */ int i, j; if (port == 0) { if (svoie[INEXPORT]->sta.connect) return (-1); return (1); } if (save_fic) return (-1); if (p_port[port].pvalid == 0) return (-1); if (DRSI (port)) { if (port_free (port) == 0) return (-1); if (canal) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == canal) && (DRSI (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } else { for (i = nbcan_drsi (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (DRSI (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } } } else if (BPQ (port)) { if (port_free (port) == 0) return (-1); if (canal) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == canal) && (BPQ (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } else { for (i = nbcan_bpq (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (BPQ (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } } } #ifdef __linux__ else if (S_LINUX (port)) { if (port_free (port) == 0) return (-1); if (canal) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == canal) && (S_LINUX (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } else { for (i = nbcan_linux (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (S_LINUX (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } } } #endif if (HST (port)) { int com = p_port[port].ccom; if (port_free (port) == 0) return (-1); if (p_port[port].ccanal == 0) { /* Port Pactor. Cherche la voie correspondante */ for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == PACTOR_CH) && (HST (no_port (j))) && (p_port[no_port (j)].ccom == com) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } return (-1); } if (canal) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == canal) && (HST (no_port (j))) && (p_port[no_port (j)].ccom == com) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } else { for (i = nbcan_hst (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (HST (no_port (j))) && (p_port[no_port (j)].ccom == com) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } } } else { if (canal) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.port == port) && (svoie[j]->affport.canal == canal) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } else { for (i = p_port[port].nb_voies; i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.port == port) && (svoie[j]->affport.canal == i) && (!svoie[j]->sta.connect) && (!voie_forward (j))) { for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; init_fb_mess (j); return (j); } } } } } return (-1); } static char *check_call (char *ptr) { char *scan = ptr; while (*scan > ' ') ++scan; if (*scan == '\0') scan = ptr; else { while ((*scan) && (isspace (*scan))) ++scan; if (isgraph(*scan) && !isalnum(*scan)) /* Pactor - ! ou % */ ++scan; if ((isdigit (*scan)) && (!isalnum (*(scan + 1)))) { ++scan; while ((*scan) && (!isalnum (*scan))) ++scan; } } return (scan); } int connect_fwd (int voie, Forward * pfwd) { int nb; stat_fwd = 0; nb = connect_station (voie, 0, pfwd->con_lig[0]); svoie[voie]->niv1 = N_FORW; svoie[voie]->niv2 = 2; svoie[voie]->niv3 = 0; /* fprintf(stderr, "connect_fwd : voie %d niv1 %d niv2 %d niv3 %d\n", voie, svoie[voie]->niv1, svoie[voie]->niv2, svoie[voie]->niv3);*/ if ((DEBUG) || (!p_port[no_port (voie)].pvalid)) { pfwd->forward = -1; } return (nb); } int connect_station (int voie, int echo, char *ptr) { int port = no_port (voie); char buffer[256]; char *scan = check_call (ptr); int nb = 0, sav_voie = voiecur; svoie[voie]->debut = time (NULL); svoie[voie]->finf.lang = langue[0]->numlang; if ((DEBUG) || (!p_port[no_port (voie)].pvalid)) return (0); selvoie (voie); svoie[voie]->sta.indicatif.num = extind (scan, svoie[voie]->sta.indicatif.call); /* fprintf(stderr, "connect_station : %s-%d\n", svoie[voie]->sta.indicatif.call, svoie[voie]->sta.indicatif.num);*/ strcpy (buffer, ptr); deb_io (); switch (p_port[port].typort) { case TYP_DED: /* DED */ if (DRSI (port)) { if (strchr (ptr, ':') == NULL) { while (ISGRAPH (*ptr)) ++ptr; while (isspace (*ptr)) ++ptr; sprintf (buffer, "C %d:%s", p_port[port].ccanal, ptr); } } tnc_commande (voie, buffer, SNDCMD); break; case TYP_PK: /* PK232 */ buffer[1] = 'O'; tnc_commande (voie, buffer, SNDCMD); break; case TYP_HST: /* PTC-II */ case TYP_FLX: tnc_commande (voie, buffer, SNDCMD); break; #ifndef __linux__ case TYP_MOD: /* MODEM */ md_no_echo (voie); svoie[voie]->sta.stat = 1; strtok (buffer, " "); strtok (NULL, " "); scan = strtok (NULL, " "); if (scan) md_send (no_port (voie), var_txt (scan)); svoie[voie]->maj_ok = 0; break; #endif case TYP_KAM: /* KAM */ kam_commande (voie, buffer); break; #ifdef __linux__ case TYP_SCK: /* AX25 */ tnc_commande (voie, buffer, SNDCMD); break; #else case TYP_BPQ: /* BPQ */ command = 1; sta_drv (voie, CMDE, (void *) &command); break; #endif #ifdef __linux__ case TYP_TCP: /* TELNET */ case TYP_ETH: /* ETHER-LINK */ tnc_commande (voie, buffer, SNDCMD); break; #endif #ifdef __WINDOWS__ case TYP_ETH: /* ETHER-LINK */ { tnc_commande (voie, buffer, SNDCMD); } break; case TYP_TCP: /* TELNET */ { tnc_commande (voie, buffer, SNDCMD); } break; case TYP_AGW: /* AX25 */ tnc_commande (voie, buffer, SNDCMD); break; #endif } fin_io (); /* Au cas ou pas de SID ... */ svoie[voie]->fbb = 0; svoie[voie]->mbl_ext = 0; svoie[voie]->sta.connect = 1; svoie[voie]->maj_ok = 0; selvoie (sav_voie); if ((echo) && (nb)) outln (buffer, nb); status (voie); return (nb); } static int tst_line (char *ptr, int val) { int nb; while ((*ptr) && (!isdigit (*ptr))) ptr++; while (*ptr) { nb = 0; while ((*ptr) && (!ISGRAPH (*ptr))) ptr++; if (*ptr == '*') return (FALSE); while (isdigit (*ptr)) { nb *= 10; nb += (*ptr++ - '0'); } while ((*ptr) && (!ISGRAPH (*ptr))) ptr++; if (isalpha (*ptr)) { if (val == nb) return (TRUE); else return (FALSE); } switch (*ptr++) { case ',': if (val == nb) return (TRUE); break; case '-': if (val >= nb) { nb = 0; while ((*ptr) && (!ISGRAPH (*ptr))) ptr++; while (isdigit (*ptr)) { nb *= 10; nb += (*ptr++ - '0'); } if (val <= nb) return (TRUE); } break; case '\n': case 0: if (val == nb) return (TRUE); return (FALSE); default: #ifdef ENGLISH cprintf ("Error in time list \r\n"); #else cprintf ("Erreur liste horaire\r\n"); #endif return (FALSE); } } return (FALSE); } void swap_port (char *port_name) { int port; int trouve = 0; strupr (port_name); for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { if (strcmp (port_name, p_port[port].freq) == 0) { port_name[0] = port + '@'; trouve = 1; break; } } } if ((!trouve) && (port_name[1] != '\0')) { if (!operationnel) { /* Erreur, le port n'existe pas ... */ char buf[80]; sprintf (buf, "Error : port \"%s\" in forward file does not exist", port_name); win_message (5, buf); } port_name[0] = 'A'; } port_name[1] = '\0'; } int tst_fwd (char *ptr, int nobbs, long h_time, int port, int *nb_choix, int reverse, int cur_port) { char temp[40]; int i, choix; int val; while (isspace (*ptr)) ++ptr; switch (val = toupper (*ptr)) { case 'C': /* Choix links */ if (nobbs) { while ((*ptr) && (!isdigit (*ptr))) ptr++; choix = (int) *ptr - '0'; if ((nb_choix) && (choix > *nb_choix)) { *nb_choix = choix; } if (choix == get_link (nobbs)) { return (val); } } return (FALSE); case 'D': /* Choix jour */ ++ptr; return ((tst_line (ptr, jour (h_time))) ? val : FALSE); case 'N': /* Choix No du jour */ ++ptr; return ((tst_line (ptr, nojour (h_time))) ? val : FALSE); case 'F': /* Choix port libre */ while (ISGRAPH (*ptr)) ++ptr; while (isspace (*ptr)) ++ptr; if (*ptr) { strn_cpy (39, temp, ptr); swap_port (temp); if (find (strupr (temp))) { for (i = 0; i < NBVOIES; i++) { if ((svoie[i]->sta.connect) && (strcmp (svoie[i]->sta.indicatif.call, temp) == 0)) { return (FALSE); } } } else { port = *temp - '@'; for (i = 0; i < NBVOIES; i++) { if ((svoie[i]->sta.connect) && (no_port (i) == port)) { return (FALSE); } } } } else { for (i = 0; i < NBVOIES; i++) { if ((svoie[i]->sta.connect) && (no_port (i) == port)) { return (FALSE); } } } return (val); case 'G': /* Choix heure GMT */ ++ptr; return ((tst_line (ptr, gmt_heure (h_time))) ? val : FALSE); case 'H': /* Choix heure locale */ ++ptr; return ((tst_line (ptr, heure (h_time))) ? val : FALSE); case 'M': /* Forward manuel */ ++ptr; return ((reverse) ? val : FALSE); case 'P': while (ISGRAPH (*ptr)) ++ptr; while (isspace (*ptr)) ++ptr; i = -2; if (*ptr) { strn_cpy (39, temp, ptr); swap_port (temp); i = *temp - '@'; } return ((i == cur_port) ? val : FALSE); case 'V': /* Test variable environnement */ ++ptr; return ((tst_var (ptr)) ? val : FALSE); default: return ((tst_line (ptr, heure (h_time))) ? val : FALSE); } } static int tst_var (char *chaine) { char var[80]; char val[80]; char *env; sscanf (chaine, "%s %s", var, val); env = getenv (var); if (env == NULL) return (0); return (strcmp (env, val) == 0); } void analyse_idnt (char *chaine) { char *ptr; int fin = 0; unsigned lprot_fwd = FWD_MBL; sup_ln (chaine); pvoie->sid = 1; pvoie->fbb = 1; pvoie->mbl_ext = 0; pvoie->mode |= F_FOR; if (pvoie->timout == time_n) pvoie->timout = time_b; ptr = strrchr (chaine, '-'); if (ptr) ++ptr; else ptr = chaine + 1; while (!fin) { switch (*ptr++) { case '\0': case ']': case '-': fin = 1; break; case 'H': pvoie->mode |= F_HIE; break; case 'A': pvoie->mode |= F_ACQ; break; case 'B': lprot_fwd |= FWD_BIN; if (isdigit (*ptr)) { if ((*ptr >= '1') && (bin_fwd == 2)) { pvoie->fbb = 2; lprot_fwd |= FWD_BIN1; } ++ptr; } break; case 'C': if (pvoie->clock) pvoie->clock = 2; break; case 'F': lprot_fwd |= FWD_FBB; break; case 'M': pvoie->mode |= F_MID; break; case 'R': pvoie->mbl_ext = 1; break; case 'X': lprot_fwd |= FWD_XPRO; break; case '$': pvoie->mode |= F_BID; break; default: break; } } if (lprot_fwd & FWD_FBB) { pvoie->mode |= F_FBB; /* Protocole FBB valide */ if (lprot_fwd & FWD_BIN) { pvoie->mode |= F_BIN; /* Transfert binaire valide */ } } lprot_fwd &= pvoie->prot_fwd; if ((lprot_fwd & FWD_XPRO) && (std_header & 512)) { /* XFwd prioritaire */ pvoie->mode &= (~(F_FBB | F_BIN)); lprot_fwd &= (~FWD_FBB); } if ((lprot_fwd & FWD_BIN) == 0) { lprot_fwd &= (~FWD_BIN1); } if ((lprot_fwd & FWD_FBB) == 0) { lprot_fwd &= (~(FWD_BIN | FWD_BIN1)); } pvoie->prot_fwd = lprot_fwd; aff_forward (); } int att_prompt (void) { char *ptr = indd; int modex = FALSE; int error = 0; if (*indd == '!') { incindd (); new_om = -1; accept_cnx (); return (FALSE); } if ((pvoie->nb_prompt == 0) && (*indd == '[')) modex = TRUE; if (*indd == '*') error++; while (nb_trait--) { if ((error) && (*ptr == '*')) { if (++error == 4) pvoie->deconnect = 4; break; } else error = 0; if (*ptr == '\r') { if ((pvoie->nb_prompt == 0) && (*(ptr - 1) == ']') && (modex)) { *ptr = '\0'; analyse_idnt (indd); /* Choisit le protocole en fonction des options */ /* si les deux protocoles FBB et XFWD sont OK */ if ((pvoie->prot_fwd & FWD_FBB) && (pvoie->prot_fwd & FWD_XPRO)) { if (std_header & 512) { /* XFwd prioritaire */ pvoie->prot_fwd &= (~(FWD_FBB | FWD_BIN | FWD_BIN1)); } else { /* FBB prioritaire */ pvoie->prot_fwd &= (~FWD_XPRO); } } } else if (*(ptr - 1) == '>') { if (pvoie->nb_prompt > 0) --pvoie->nb_prompt; else { if (pvoie->sid == 0) { /* Pas de SID recu -> ni fbb, ni xfwd */ pvoie->prot_fwd = 0; } return TRUE; } } else modex = FALSE; } ++ptr; } return FALSE; } static int is_duplicate_forward (int nobbs) { Forward *pfwd; int port; int nb_bbs = 0; for (port = 0; port < NBPORT; port++) { if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { if (pfwd->no_bbs == nobbs) ++nb_bbs; pfwd = pfwd->suite; } } } return (nb_bbs > 1); } int mess_suiv (int voie) /* * Y a-t-il encore un message ? * Si oui, typ_mess, n_mess, enrdeb et enrcur sont mis a jour. retour TRUE . * Si non, retour FALSE . */ { long no; df ("mess_suiv", 1); if (save_fic) { ++pvoie->sta.ack; svoie[voie]->deconnect = 6; ff (); return (0); } if (svoie[voie]->bbsfwd == 0) { ff (); return (0); } /* teste si un forward est deja en cours -> pas de proposition */ if (is_duplicate_forward (svoie[voie]->bbsfwd)) { ff (); return (0); } while ((no = msg_fwd_suiv ((int) svoie[voie]->bbsfwd, svoie[voie]->maxfwd, svoie[voie]->oldfwd, svoie[voie]->typfwd, voie)) != 0L) { if (ch_record (ptmes, no, '\0')) { if ((ptmes->status == 'N') || (ptmes->status == 'Y') || (ptmes->status == '$')) { ff (); return (TRUE); } } /* Le message n'existe plus : supression de la liste */ clear_fwd (no); } ff (); return (FALSE); } void program_tnc (int voie, char *ptr) { int nb; char buffer[300]; switch (p_port[no_port (voie)].typort) { case TYP_DED: /* DED */ case TYP_HST: /* PTC */ case TYP_FLX: if (*ptr == 'B') { ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; nb = atoi (ptr); if ((nb >= 30) && (nb <= 250)) svoie[voie]->paclen = nb; else cprintf ("INVALID VALUE: %s\r\n", ptr); } else { if ((!DEBUG) && (p_port[no_port (voie)].pvalid)) { strcpy (buffer, ptr); tnc_commande (voie, buffer, ECHOCMD); if (*buffer) { cprintf ("%s\r\n", buffer); } } } break; case TYP_PK: /* PK232 */ if ((*ptr == 'B') && (!isgraph (*(ptr + 1)))) { ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; nb = atoi (ptr); if ((nb >= 10) && (nb <= 250)) svoie[voie]->paclen = nb; else cprintf ("INVALID VALUE: %s\r\n", ptr); } else { if ((!DEBUG) && (p_port[no_port (voie)].pvalid)) tnc_commande (voie, ptr, ECHOCMD); } break; case TYP_KAM: /* KAM */ if ((*ptr == 'B') && (!isgraph (*(ptr + 1)))) { ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; nb = atoi (ptr); if ((nb >= 30) && (nb <= 250)) svoie[voie]->paclen = nb; else cprintf ("INVALID VALUE: %s\r\n", ptr); } else { if ((!DEBUG) && (p_port[no_port (voie)].pvalid)) kam_commande (voie, ptr); } break; case TYP_BPQ: /* BPQ */ if ((*ptr == 'B') && (!isgraph (*(ptr + 1)))) { ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; nb = atoi (ptr); if ((nb == 0) || ((nb >= 30) && (nb <= 250))) svoie[voie]->paclen = nb; else cprintf ("INVALID VALUE: %s\r\n", ptr); } break; #ifdef __WINDOWS__ case TYP_AGW: /* AGW */ if (*ptr == 'B') { ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; nb = atoi (ptr); if ((nb >= 30) && (nb <= 250)) svoie[voie]->paclen = nb; else cprintf ("INVALID VALUE: %s\r\n", ptr); } else { if ((!DEBUG) && (p_port[no_port (voie)].pvalid)) { strcpy (buffer, ptr); tnc_commande (voie, buffer, ECHOCMD); if (*buffer) { cprintf ("%s\r\n", buffer); } } } break; #endif } } void program_fwd (int affiche, int fwd, typ_pfwd ** ptnc, int voie) { char *ptr; typ_pfwd *pcurr, *ptemp; #ifdef __linux__ typ_pfwd *prev; int done; int nbdos; char *list[25]; /* 25 taches DOS max */ #endif #ifdef __WINDOWS__ typ_pfwd *prev; int done; int nbdos; char *list[25]; /* 25 taches DOS max */ #endif #ifdef __FBBDOS__ char s[80]; fen *fen_ptr; #endif pcurr = *ptnc; if (pcurr == NULL) return; #if defined(__WINDOWS__) prev = NULL; while (pcurr) { ptr = pcurr->chaine; if (voie) { done = 0; if (pcurr->type) { /* Commande DOS */ if (strncmpi (ptr, "PTCTRX", 6) == 0) { ptctrx (no_port (voie), ptr); done = 1; } /* DLL Actions */ else if (call_dll (ptr, NO_REPORT_MODE, NULL, 0, NULL) != -1) { done = 1; } } else { /* Programm TNC */ if (fwd) program_tnc (voie, ptr); done = 1; } } else done = 1; if (done) { /* Enleve la cammande de la liste */ ptemp = pcurr; if (prev) { prev->suiv = pcurr->suiv; pcurr = pcurr->suiv; } else { /* Tete de liste ... */ *ptnc = pcurr = pcurr->suiv; } m_libere (ptemp, sizeof (typ_pfwd)); } else { prev = pcurr; pcurr = pcurr->suiv; } } /* Runs the DOS actions */ pcurr = *ptnc; if (pcurr == NULL) return; nbdos = 0; while (pcurr) { ptr = pcurr->chaine; if (voie) { if (pcurr->type) { if (nbdos < 25) list[nbdos++] = pcurr->chaine; } } pcurr = pcurr->suiv; } if (nbdos) call_nbdos (list, nbdos, NO_REPORT_MODE, NULL, TOOLDIR, NULL); /* Frees the list */ while (pcurr) { ptemp = pcurr; pcurr = pcurr->suiv; m_libere (ptemp, sizeof (typ_pfwd)); } #endif #if defined(__linux__) prev = NULL; while (pcurr) { ptr = pcurr->chaine; if (voie) { done = 0; if (pcurr->type) { /* Commande DOS */ if (strncmpi (ptr, "PTCTRX", 6) == 0) { ptctrx (no_port (voie), ptr); done = 1; } } else { /* Programm TNC */ if (fwd) program_tnc (voie, ptr); done = 1; } } else done = 1; if (done) { /* Enleve la cammande de la liste */ ptemp = pcurr; if (prev) { prev->suiv = pcurr->suiv; pcurr = pcurr->suiv; } else { /* Tete de liste ... */ *ptnc = pcurr = pcurr->suiv; } m_libere (ptemp, sizeof (typ_pfwd)); } else { prev = pcurr; pcurr = pcurr->suiv; } } /* Runs the DOS actions */ pcurr = *ptnc; if (pcurr == NULL) return; nbdos = 0; while (pcurr) { ptr = pcurr->chaine; if (voie) { if (pcurr->type) { if (nbdos < 25) list[nbdos++] = pcurr->chaine; } } pcurr = pcurr->suiv; } if (nbdos) call_nbdos (list, nbdos, NO_REPORT_MODE, NULL, TOOLDIR, NULL); /* Frees the list */ while (pcurr) { ptemp = pcurr; pcurr = pcurr->suiv; m_libere (ptemp, sizeof (typ_pfwd)); } #endif #ifdef __FBBDOS__ if (affiche) { sprintf (s, "TNC Prog. Ch %d", voie); fen_ptr = open_win (50, 8, 73, 21, INIT, s); } while (pcurr) { ptr = pcurr->chaine; if (voie) { if (pcurr->type) { /* Commande DOS */ if (strncmpi (ptr, "PTCTRX", 6) == 0) { ptctrx (no_port (voie), ptr); } else { send_dos (pcurr->type, ptr, NULL); } } else { /* Programm TNC */ if (fwd) { if (affiche) cprintf ("%s\r\n", ptr); program_tnc (voie, ptr); } } } ptemp = pcurr; pcurr = pcurr->suiv; m_libere (ptemp, sizeof (typ_pfwd)); } #endif *ptnc = NULL; #ifdef __FBBDOS__ if (affiche) { sleep_ (1); close_win (fen_ptr); } #endif } fbb-7.0.10/src/bidexms.c0000644000175000017500000002114613613360505011645 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Gestion des BID memoire EMS/XMS * */ #include static unsigned nb_record; static void tst_vbid (bullist *, int, int *); static void tst_bid (bullist *, int, int *); static int where_bid (char *bid); /* * Routines standard */ void w_bid (void) { int i; long lnb, maxbid; char *ptr; FILE *fptr; bidfwd fwbid; maxbid = maxbbid; if ((fptr = fopen (d_disque ("WFBID.SYS"), "r+b")) == NULL) { #ifdef ENGLISH if (!svoie[CONSOLE]->sta.connect) cprintf ("\r\nw_bid() Warning : Creating file %s \r\n\n", d_disque("WFBID.SYS")); #else if (!svoie[CONSOLE]->sta.connect) cprintf ("\r\nw_bid() Warning : Cr‚ation du fichier %s\r\n\n", d_disque("WFBID.SYS")); #endif if ((fptr = fopen (d_disque ("WFBID.SYS"), "wb")) == NULL) { #ifdef ENGLISH cprintf ("\r\nw_bid() Error : Impossible to create file %s \r\n\n", d_disque("WFBID.SYS")); #else cprintf ("\r\nw_bid() Erreur : Impossible de creer le fichier %s\r\n\n", d_disque("WFBID.SYS")); #endif fbb_error (ERR_CREATE, d_disque ("WFBID.SYS"), 0); exit(1); } else { ptr = (char *) &fwbid; for (i = 0; i < sizeof (bidfwd); i++) *ptr++ = '\0'; fwrite (&fwbid, sizeof (bidfwd), 1, fptr); rewind (fptr); } } fread (&fwbid, sizeof (fwbid), 1, fptr); ++fwbid.numero; if ((fwbid.numero > maxbid) || (fwbid.numero < 1L)) fwbid.numero = 1L; lnb = fwbid.numero; rewind (fptr); fwrite (&fwbid, sizeof (fwbid), 1, fptr); fseek (fptr, fwbid.numero * sizeof (bidfwd), 0); fwbid.mode = ptmes->type; strncpy (fwbid.fbid, ptmes->bid, 12); fwbid.fbid[12] = '\0'; fwbid.numero = ptmes->numero; fwrite (&fwbid, sizeof (fwbid), 1, fptr); ferme (fptr, 59); --lnb; if (bid_ptr) { /* Mise a jour du tableau */ ptr = bid_ptr + (int) (BIDCOMP * lnb); memcpy (ptr, comp_bid (ptmes->bid), BIDCOMP); } else if (EMS_BID_OK ()) { write_bid ((int) lnb, comp_bid (ptmes->bid)); } } int search_bid (char *bid) { int i; char *ptr; char t_bid[BIDCOMP]; if (bid_ptr) { memcpy (t_bid, comp_bid (bid), BIDCOMP); ptr = bid_ptr; for (i = 0; i < maxbbid; i++) { if (memcmp (ptr, t_bid, BIDCOMP) == 0) { return (i + 1); } ptr += BIDCOMP; } return (0); } else if (EMS_BID_OK ()) return (where_exms_bid (bid)); else return (where_bid (bid)); } void libere_bid (void) { if (bid_ptr) { m_libere (bid_ptr, (unsigned) (BIDCOMP * maxbbid)); bid_ptr = NULL; } } void end_bids (void) { libere_bid (); } void cree_bid (void) { int i; FILE *fptr; bidfwd fwbuf; bidfwd fwbid; char *ptr; #if defined(__WINDOWS__) || defined(__linux__) char buffer[80]; #endif #ifdef __FBBDOS__ fen *fen_ptr; #endif /* bid_exms = 0; */ nb_record = 0; if ((fptr = fopen (d_disque ("WFBID.SYS"), "rb")) == NULL) { fprintf (stderr, "WFBID.SYS file is not present. Creating %s\n", d_disque("WFBID.SYS")); printf ("WFBID.SYS is not present. Creating %s\n",d_disque("WFBID.SYS")); if ((fptr = fopen (d_disque ("WFBID.SYS"), "wb")) == NULL) { #ifdef ENGLISH cprintf ("\r\nError : Impossible to create file %s \r\n\n", d_disque("WFBID.SYS")); #else cprintf ("\r\nErreur : Impossible de cr<82>er le fichier %s\r\n\n", d_disque("WFBID.SYS")); #endif fbb_error (ERR_CREATE, d_disque ("WFBID.SYS"), 0); exit(1); } else { ptr = (char *) &fwbid; for (i = 0; i < sizeof (bidfwd); i++) *ptr++ = '\0'; fwrite (&fwbid, sizeof (bidfwd), 1, fptr); rewind (fptr); } } deb_io (); #ifdef __FBBDOS__ fen_ptr = open_win (10, 5, 50, 8, INIT, "BID"); #endif if (EMS_BID_OK ()) { init_exms_bid (fptr); } else { if ((bid_ptr == NULL) && (maxbbid <= 5000) && (tot_mem > 100000L)) { bid_ptr = m_alloue ((unsigned) (BIDCOMP * maxbbid)); memset (bid_ptr, 0, (size_t) maxbbid * BIDCOMP); ptr = bid_ptr; for (i = 0; i < maxbbid; i++) { if ((i % 500) == 0) { #if defined(__WINDOWS__) || defined(__linux__) InitText (ltoa ((long) i, buffer, 10)); #endif #ifdef __FBBDOS__ cprintf ("\r%d BIDs", i); #endif } fread (&fwbuf, sizeof (bidfwd), 1, fptr); memcpy (ptr, comp_bid (fwbuf.fbid), BIDCOMP); ptr += BIDCOMP; } #if defined(__WINDOWS__) || defined(__linux__) InitText (ltoa ((long) i, buffer, 10)); #endif #ifdef __FBBDOS__ cprintf ("\r%d BIDs", i); #endif } } ferme (fptr, 71); #ifdef __FBBDOS__ sleep_ (1); close_win (fen_ptr); #endif fin_io (); } static void tst_bid (bullist * fb_mess, int nb, int *t_res) { int i, j, res; FILE *fptr; bidfwd fwbid; if ((fptr = fopen (d_disque ("WFBID.SYS"), "rb")) != NULL) { if (fread (&fwbid, sizeof (fwbid), 1, fptr) == 0) return; for (i = 0; i < maxbbid; i++) { if (fread (&fwbid, sizeof (fwbid), 1, fptr) == 0) break; res = 1; for (j = 0; j < nb; j++) /* Test si tous sont trouves */ { if ((t_res[j] == 0) && (*fb_mess[j].bid)) { res = 0; break; } } if (res) break; for (j = 0; j < nb; j++) { if (t_res[j]) continue; /* Deja trouve ? */ if (*fb_mess[j].bid == '\0') continue; if (strcmp (fwbid.fbid, fb_mess[j].bid) == 0) { t_res[j] = 1; } } } ferme (fptr, 70); } } static int where_bid (char *bid) { int i; FILE *fptr; bidfwd fwbid; if ((fptr = fopen (d_disque ("WFBID.SYS"), "rb")) != NULL) { if (fread (&fwbid, sizeof (fwbid), 1, fptr) == 0) return (0); for (i = 0; i < maxbbid; i++) { if (fread (&fwbid, sizeof (fwbid), 1, fptr) == 0) break; if (strcmp (fwbid.fbid, bid) == 0) { return (i + 1); } } ferme (fptr, 70); } return (0); } static void tst_vbid (bullist * fb_mess, int nb, int *t_res) { int i, j, res; char *ptr; char t_bid[MAX_FB][BIDCOMP]; for (i = 0; i < nb; i++) if (*fb_mess[i].bid) memcpy (t_bid[i], comp_bid (fb_mess[i].bid), BIDCOMP); ptr = bid_ptr; for (i = 0; i < maxbbid; i++) { res = 1; for (j = 0; j < nb; j++) { /* Test si tous sont trouves */ if ((t_res[j] == 0) && (*fb_mess[j].bid)) { res = 0; break; } } if (res) break; for (j = 0; j < nb; j++) { if (t_res[j]) continue; /* Deja trouve ? */ if (*fb_mess[j].bid == '\0') continue; if (strncmp (ptr, t_bid[j], BIDCOMP) == 0) { t_res[j] = 1; } } ptr += BIDCOMP; } } /* Tests divers lors de la reception d'un message Retour : 0 : Message accepte 1 : Message deja recu [ ou rejete (protocole 0) ] 2 : en cours de reception sur un autre canal 3 : 4 : Message rejete (protocole 1). 5 : Message retenu (protocole 1). */ int deja_recu (bullist * fb_mess, int nb, int *t_res) { int i, j, voie; for (i = 0; i < nb; i++) { t_res[i] = rejet (&fb_mess[i]); /* if (t_res[i] == 0) t_res[i] = retenu(&fb_mess[i]); */ } for (i = 0; i < (nb - 1); i++) { for (j = i + 1; j < nb; j++) { if (t_res[j]) continue; if (strcmp (fb_mess[i].bid, fb_mess[j].bid) == 0) { t_res[j] = 1; break; } } } if (bid_ptr) tst_vbid (fb_mess, nb, t_res); else if (EMS_BID_OK ()) tst_exms_bid (fb_mess, nb, t_res); else tst_bid (fb_mess, nb, t_res); for (i = 0; i < nb; i++) { if (t_res[i]) continue; if (*fb_mess[i].bid == '\0') continue; /* Teste si en cours de reception */ for (voie = 0; voie < NBVOIES; voie++) { if ((voie == voiecur) || (!svoie[voie]->sta.connect)) continue; if (strcmp (svoie[voie]->entmes.bid, fb_mess[i].bid) == 0) { t_res[i] = 2; break; } for (j = 0; j < MAX_FB; j++) { if (svoie[voie]->fb_mess[j].type == '\0') continue; if (strcmp (svoie[voie]->fb_mess[j].bid, fb_mess[i].bid) == 0) { t_res[i] = 2; break; } } if (t_res[i]) break; } } for (i = 0; i < nb; i++) { if (t_res[i] == 0) t_res[i] = retenu (&fb_mess[i]); } return (t_res[0]); } fbb-7.0.10/src/mbl_kill.c0000644000175000017500000002232613613360505012000 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module Nø1 emulation WA7MBL */ static int mbl_kill_liste (void); static int mbl_kx (void); static int teste_liste (bullist *); static char *ltitre (int mode, bullist * pbul) /* Mode = 1 pour LS */ { int lg = 80; static char buf[100]; if (pvoie->typlist) { sprintf (buf, "%-12s ", pbul->bid); if (mode) strn_cpy (lg, buf + 13, pbul->titre); else n_cpy (lg, buf + 13, pbul->titre); } else { if (mode) strn_cpy (lg, buf, pbul->titre); else n_cpy (lg, buf, pbul->titre); } return (buf); } static int strfind (bullist * pbul, char *cherche) { return (strmatch (ltitre (1, pbul), cherche)); } static int teste_liste (bullist * lbul) { if (lbul->numero < pvoie->recliste.debut) return (0); if (lbul->numero > pvoie->recliste.fin) return (0); if (lbul->date < pvoie->recliste.avant) return (0); if (lbul->date > pvoie->recliste.apres) return (0); if (!droits (COSYSOP)) { if (strcmp (lbul->desti, "KILL") == 0) return (0); if (lbul->type == 'A') return (0); if ((lbul->status == 'K') && (pvoie->recliste.status != 'K')) return (0); if ((lbul->status == 'A') && (pvoie->recliste.status != 'A')) return (0); } if (*pvoie->recliste.find) return (strfind (lbul, pvoie->recliste.find)); if ((pvoie->recliste.type) && (pvoie->recliste.type != lbul->type)) return (0); if ((pvoie->recliste.status) && (pvoie->recliste.status != lbul->status)) return (0); if ((*pvoie->recliste.exp) && (!strmatch (lbul->exped, pvoie->recliste.exp))) return (0); if ((*pvoie->recliste.dest) && (!strmatch (lbul->desti, pvoie->recliste.dest))) return (0); if (*pvoie->recliste.bbs) { if (*pvoie->recliste.bbs == '-') { if (*lbul->bbsv) return (0); } else { if (!strmatch (lbul->bbsv, pvoie->recliste.bbs)) return (0); } } return (1); } /* Commande 'K' -> Kill messages ou 'H' -> hold message */ int supp_nomess (long no, int archive) { int i; int kill_new = 0; bullist lbul; char s[80]; char type = '\0'; if (archive >= 0x80) { archive -= 0x80; kill_new = 1; } switch (archive) { case 0: type = 'K'; break; case 1: type = 'A'; break; case 2: type = 'H'; break; } if (!ch_record (&lbul, no, 0)) return (2); if (archive == 2) { if ((lbul.status != '$') && (lbul.status != 'N') && (lbul.status != 'Y')) return (2); } if (!droit_ok (&lbul, (archive == 1) ? 3 : ((kill_new) ? 4 : 2))) return (3); ch_record (&lbul, no, (kill_new) ? (type | 0x80) : type); sprintf (s, "%c %ld", type, lbul.numero); fbb_log (voiecur, 'M', s); clear_fwd (lbul.numero); lbul.status = type; for (i = 0; i < NBMASK; i++) { lbul.fbbs[i] = '\0'; } maj_rec (lbul.numero, &lbul); if (archive == 2) ++nb_hold; return (1); } static void kill_mine (int archive) { /* Suppression des messages personnels */ int trouve = 0; unsigned num_ind = pvoie->no_indic; unsigned offset = 0; bullist bul; bloc_mess *bptr = tete_dir; mess_noeud *mptr; ouvre_dir (); while (bptr) { mptr = &(bptr->st_mess[offset]); if (mptr->noenr == 0) break; if (mptr->no_indic == num_ind) { read_dir (mptr->noenr, &bul); *ptmes = bul; if (bul.status != 'H') { trouve = 1; if (bul.status != 'N') { switch (supp_nomess (bul.numero, archive)) { case 1: texte (T_MBL + 7); break; case 2: /* Deja tue ! */ break; case 3: texte (T_ERR + 12); break; } } else texte (T_ERR + 12); } } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } ferme_dir (); if (!trouve) texte (T_MBL + 3); } static int mbl_kill_liste (void) { int retour = 1; bullist ligne; unsigned offset = pvoie->recliste.offset; bloc_mess *bptr = pvoie->recliste.ptemp; int archive = pvoie->recliste.l; mess_noeud *mptr; pvoie->sr_mem = pvoie->seq = FALSE; ouvre_dir (); while (bptr) { mptr = &(bptr->st_mess[offset]); if (mptr->noenr == 0) break; read_dir (mptr->noenr, &ligne); if (ligne.numero < pvoie->recliste.debut) break; if (teste_liste (&ligne)) { if (pvoie->recliste.last-- == 0L) break; if (droit_ok (&ligne, 2)) { switch (supp_nomess (ligne.numero, archive)) { case 1: if (archive == 2) outln ("Msg #$M held.", 13); else texte (T_MBL + 7); break; case 2: /* Deja tue ! */ ptmes->numero = ligne.numero; break; case 3: ptmes->numero = ligne.numero; if (archive == 2) texte (T_ERR + 13); else texte (T_ERR + 12); break; } pvoie->temp1 = 0; } } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 0; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 0; break; } } ferme_dir (); pvoie->recliste.offset = offset; pvoie->recliste.ptemp = bptr; if ((retour) && (pvoie->temp1)) texte (T_MBL + 3); return (retour); } int mbl_kill (void) { int error = 0; switch (pvoie->niv3) { case 0: error = mbl_kx (); break; case 1: if (mbl_kill_liste ()) retour_mbl (); break; default: fbb_error (ERR_NIVEAU, "MESS-KILL", pvoie->niv3); } return (error); } static int mbl_kx (void) { long no; char c; int archive = 0, fin = 1, suite = 1; int error = 0; sup_ln (indd); c = toupper (*indd); init_recliste (voiecur); pvoie->aut_nc = 1; if (droits (SUPMES)) { if (c == 'K') { ++indd; c = toupper (*indd); archive = 1; } switch (c) { case '>': ++indd; suite = 0; if (teste_espace ()) { strn_cpy (6, pvoie->recliste.dest, indd); fin = 0; } else { texte (T_ERR + 2); } break; case '<': ++indd; suite = 0; if (teste_espace ()) { strn_cpy (6, pvoie->recliste.exp, indd); fin = 0; } else { texte (T_ERR + 2); } break; case 'F': ++indd; suite = 0; pvoie->recliste.status = 'F'; fin = 0; break; case '@': ++indd; suite = 0; if (teste_espace ()) { strn_cpy (6, pvoie->recliste.bbs, indd); fin = 0; } else { texte (T_ERR + 2); } break; default: break; } if ((!fin) && (!suite)) { pvoie->recliste.ptemp = tete_dir; pvoie->recliste.offset = 0; pvoie->recliste.l = archive; pvoie->temp1 = 1; if (mbl_kill_liste ()) fin = 1; else ch_niv3 (1); } } if (suite) { if (c == 'M') { kill_mine (archive); } else { if (teste_espace ()) { while ((no = lit_chiffre (1)) != 0L) { /* Autorise la suppression des messages non lus */ switch (supp_nomess (no, archive + 0x80)) { case 1: texte (T_MBL + 7); break; case 2: texte (T_ERR + 10); break; case 3: texte (T_ERR + 12); break; } } } else { /* texte(T_ERR + 3) ; */ error = 1; fin = 0; } } } if (fin) retour_mbl (); return (error); } /* * Archive = 0 -> K * 1 -> A * 2 -> H */ int hold_kill (int archive) { long no; char c; int fin = 1, suite = 1; int error = 0; c = toupper (*indd); switch (c) { case '>': ++indd; suite = 0; if (teste_espace ()) { strn_cpy (6, pvoie->recliste.dest, indd); fin = 0; } else { texte (T_ERR + 2); } break; case '<': ++indd; suite = 0; if (teste_espace ()) { strn_cpy (6, pvoie->recliste.exp, indd); fin = 0; } else { texte (T_ERR + 2); } break; case 'F': if (archive != 2) { ++indd; suite = 0; pvoie->recliste.status = 'F'; fin = 0; } break; case '@': ++indd; suite = 0; if (teste_espace ()) { strn_cpy (6, pvoie->recliste.bbs, indd); fin = 0; } else { texte (T_ERR + 2); } break; default: break; } if ((!fin) && (!suite)) { pvoie->recliste.ptemp = tete_dir; pvoie->recliste.offset = 0; pvoie->recliste.l = archive; pvoie->temp1 = 1; if (mbl_kill_liste ()) fin = 1; else ch_niv3 (1); } if (suite) { if (teste_espace ()) { while ((no = lit_chiffre (1)) != 0L) { switch (supp_nomess (no, archive)) { case 1: outln ("Msg #$M held.", 13); break; case 2: break; case 3: texte (T_ERR + 10); break; } } } else { error = 1; fin = 0; } } if (fin) retour_mbl (); return (error); } fbb-7.0.10/src/satupdat.c0000644000175000017500000010147113615603431012037 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************ * HISTORIQUE : * DATE AUTEUR / AUTHOR : Bernard Pidoux, f6bvp@amsat.org * ajoursat 16/10/89 Bernard Pidoux F6BVP * 11/11/89 le répertoire n'est pas imposé * 20/05/00 * portage sous linux (J-P ROUBELAT - F6FBB) * * Version 1.72 12/12/90 avec vérifications renforcés du synchronisme * du format de lecture, sans bouclage infini. * 1.74 3/03/91 Traite jusqu'à 768 Satellites * 26/04/91 Test si place disponible en mémoire * 1.75 27/04/91 Option lecture format Nasa * nouveau renforcement controle intégrité des donnés * Exclusion des doublons * libéation mémoire alloué en sortie * extension fichier source .txt uniquement par défaut * 1.76 19/05/91 CRC en lecture format Nasa * changement du format de lecture lignes NASA * 24/05/91 déplacement message "Aucune mise jour aprés else * 1.77 28/05/91 CRC en lecture format AMSAT * 1.78 31/10/93 fscanf remplacé par fgets dans AMSAT pour supprimer * plantage programme sur longue ligne sans RC * 1.80 20/11/93 prise en compte de la date_limite des donnés * 1.83 20/11/94 champ ELEMENT SET pour compatibilité * format AMSAT du service REQKEP * 1.84 : 15/02/98 suite plantage par ligne pseudo Satellite * agrandissement tableaux buf1 et buf2 * 1.85 : 12/01/2000 pour le bogue ! * dernières mises au point 9 juin 2000 sous Linux * 1.86 : septembre 2007 * 1.87 : 26/09/2009 * 1.88 Jan-26-2015 changed fgets() lines avoiding compiler warnings * 1.89 Feb-03-2015 changed write() line avoiding compiler warning *************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #define DEBUG */ /* #define FRANCAIS*/ #define VERSION "1.89" /* Tabulation a 4 espaces !! */ #ifdef DEBUG #define d_printf printf #else void d_printf(const char * format, ...); void d_printf(const char * format, ...) { } #endif #define TRUE 1 #define FALSE 0 /* * Record du fichier SATEL */ #define __a2__ __attribute__ ((packed, aligned(2))) typedef struct typ_satel { char dd[18]; /* Nom du satellite */ short y3; /* Annee de reference */ double d3 __a2__; /* Jour de reference */ short n3; /* Mois de reference */ short h3; /* Heure de reference */ short m3; /* Minute de reference */ short s3; /* Seconde de reference */ double i0 __a2__; /* Inclinaison */ double o0 __a2__; /* R.A.A.N. */ double e0 __a2__; /* Excentricite */ double w0 __a2__; /* Argument de perigee */ double m0 __a2__; /* Anomalie moyenne */ double a0 __a2__; /* Contient 0.0 */ double n0 __a2__; /* Mouvement moyen */ double q3 __a2__; /* Derivee du mouv. moy.*/ long k0 __a2__; /* Orbite de reference */ double f1 __a2__; /* Frequence pour le calcul doppler */ double v1 __a2__; /* Contient 0.0 */ short pas; /* Pas des calculs*/ long maj __a2__; /* Date de derniere mise à jour*/ long cat __a2__; /* Catalog Number - anciennement vide */ short set; /* Element set NASA */ short libre[3]; } satel; #define MAXSAT 769 #define LINE 81 /********** Prototypes **************/ int Misajour(satel ** vieux, int vv, satel ** nouv, int nn, char option); int Ecrit_Sat(char *filename, satel ** stru, int nombre); void Amsat(char *filename); void nasa(char *filename); int Lire_Ancien(char *filename); void Print_Sat(satel ** stru, int m); /* Imprime fichier */ void Tri_Cat(satel ** stru, int nombre); void Tri(satel ** stru, int nombre); /* tri a bulle des noms de satellites */ void CopyStru(satel ** stru, int indice, satel * psat); int doublons(int nombre); void avorte(void); int fraicheur(void); /************************************/ char *filename, *str; /* Nom fichier Source et copie */ struct tm *cejour; /* date et time declares dans TIME.H */ char *aujour; /* Date de derniere mise à jour */ int date_limite; /* nombre de jours ancienneté limite pour les données */ satel *vieux[MAXSAT]; satel *nouveaux[MAXSAT]; satel *tampon[MAXSAT]; /* tampon pour mise à jour */ satel sat; /* declaration structure sat de type satel */ int nsat; /* nombre de satellites modifié */ int maxsat; /* nombre de satellites gérable */ char *opt; char *options[5]; char *option; char *dmo; char *dmold; int good_crc; int bad_crc; void sortie(int n) { int i; for (i = 0; i < maxsat; i++) { free(vieux[i]); free(nouveaux[i]); /* * farfree(tampon[i]); */ free(tampon[i]); } free(filename); free(str); free(dmo); free(dmold); exit(n); } void avorte(void) /* * Nom: avorte() Description : Sortie du programme en cas * d'erreur. Commentaire : Efface le fichier provisoire et ferme les * fichiers de travail. */ { remove(dmo); /* efface le fichier provisoire .$$$ */ #ifdef FRANCAIS printf("\nDépassement du nombre de satellites autorisé!\n"); printf(" ou pas assez de mémoire.\n"); #else printf("\nToo much satellites on file !\n"); printf(" or not enough memory for the program.\n"); #endif sortie(1); } int main(int argc, char *argv[]) { int i, j, k, l, m, n = 0; /* long jour; secondes depuis 1er Janv 1970 0 heures GMT */ /* char option1; option format fichier /A AMSAT, /N NASA */ /* char option2='X'; option de mise a jour fusion par défaut*/ /* char option3='X'; option de délai*/ char optionA; char optionB; char optionC; time_t temps; for (i = 0; i < MAXSAT; i++) { vieux[i] = (satel *) (malloc(sizeof(satel))); tampon[i] = (satel *) (malloc(sizeof(satel))); nouveaux[i] = (satel *) (malloc(sizeof(satel))); if (nouveaux[i] == NULL) avorte(); } maxsat = i - 1; for (i = 0; i < 5; i++) options[i] = (char *) (calloc(40, sizeof(char))); option = (char *) (malloc(40 * sizeof(char))); dmo = (char *) (malloc(80 * sizeof(char))); dmold = (char *) (malloc(80 * sizeof(char))); opt = (char *) (malloc(40 * sizeof(char))); str = (char *) (malloc(80 * sizeof(char))); filename = (char *) (malloc(80 * sizeof(char))); strcpy(dmold, "satel.dat"); strcpy(dmo, "satel.$$$"); *options[0] = 'A'; /* défaut format AMSAT */ optionA = 'A'; *options[1] = 'F'; /* fusion des donnés */ optionB = 'F'; date_limite = 100; /* effacer donnés si supéieures é00 jours */ optionC = 'D'; /* * printf("%d arguments\n",argc); for(i=0;i= 2 && argc <= 5) { strcpy(filename, argv[1]); for (i = 0; i < argc-2; i++) { strcpy(option, argv[i + 2]); opt = strstr(option, "/"); if (opt == NULL) break; opt++; *options[i] = toupper(*opt); if (*options[i] == 'D') date_limite = atoi(++opt); } } #ifdef FRANCAIS printf("\nMise à jour des paramètres orbitaux de la banque de données des satellites pour BBS F6FBB\n"); printf("Version %s - février 2015 - Bernard Pidoux, f6bvp@amsat.org\n",VERSION); if ((argc < 2) || (argc > 5)) { printf("Emploi: ajoursat nom_fichier<.txt> \n"); printf("\nOption lecture :"); printf("\n /a format AMSAT (par défaut)"); printf("\n /n format NASA"); printf("\nOption mise à jour :"); printf("\n /f fusion avec les anciennes données (par défaut)"); printf("\n /u uniquement des anciennes données"); printf("\n /s seulement les données réactualisées"); printf("\nOption effacement :"); printf("\n /dxxx supprime les données de plus de xxx jours"); printf("\n (par défaut 100 jours)\n"); printf("\n<>\n", maxsat); sortie(0); } #else printf("\nUpdate of F6FBB's BBS satellite data base orbital parameters\n"); printf("Version %s - February 2015 - Bernard Pidoux, f6bvp@amsat.org\n",VERSION); if ((argc < 2) || (argc > 5)) { printf("Usage: satupdat file_name<.txt> \n"); printf("\nReading option:"); printf("\n /a AMSAT format (default)"); printf("\n /n NASA format"); printf("\nUpdate option:"); printf("\n /f merging new and old data (default)"); printf("\n /u update only satellites being in the data base"); printf("\n /s keep only satellites being in the input file"); printf("\nDelete option:"); printf("\n /dxxx delete data older than xxx days"); printf("\n (default 100 days)\n"); printf("\n<<%d satellites maximum>>\n", maxsat); sortie(0); } #endif time(&temps); cejour = gmtime(&temps); for (i = 0; i < argc - 2; i++) { if (*options[i] == 'A') optionA = 'A'; else if (*options[i] == 'N') optionA = 'N'; else if (*options[i] == 'S') optionB = 'S'; else if (*options[i] == 'U') optionB = 'U'; else if (*options[i] == 'F') optionB = 'F'; else if (*options[i] == 'D') optionC = 'D'; } #ifdef FRANCAIS if (optionA == 'A') printf("Lecture format AMSAT\n"); else if (optionA == 'N') printf("Lecture format NASA avec CRC-10\n"); printf("Mise jour "); if (optionB == 'S') printf("en gardant seulement les satellites de la nouvelle liste\n"); else if (optionB == 'U') printf("uniquement des données des anciens satellites\n"); else if (optionB == 'F') printf("en fusionnant la nouvelle avec l'ancienne liste\n"); if (optionC == 'D') printf("avec suppression des données de plus de %d jours.\n", date_limite); #else if (optionA == 'A') printf("Reading AMSAT format\n"); else if (optionA == 'N') printf("Reading NASA format with CRC-10\n"); printf("Update "); if (optionB == 'S') printf("keeping only satellites being in the input file\n"); else if (optionB == 'U') printf("only satellites being already in the data base\n"); else if (optionB == 'F') printf("merging new list with old list\n"); if (optionC == 'D') printf("deleting data older than %d days.\n", date_limite); #endif n = Lire_Ancien(dmold); if (n > 1) { Tri_Cat(vieux, n); } if (n != -1) { #ifdef FRANCAIS printf("\n%d données de moins de %d jours", n, date_limite); #else printf("\n%d data less than %d days", n, date_limite); #endif } if (strchr(filename, '.') == NULL) { strtok(filename, "."); strcat(filename, ".txt"); } #ifdef FRANCAIS printf("\nLecture du fichier: %s\n\n", filename); #else printf("\nReading file: %s\n\n", filename); #endif if (optionA == 'A') Amsat(filename); else if (optionA == 'N') nasa(filename); m = good_crc; if (good_crc > 0) { /* Il existe au moins une donné nouvelle... */ Tri_Cat(nouveaux, m); printf ("(%d)",m); j = doublons(m); printf ("(%d)",j); k = Misajour(vieux, n, nouveaux, j, optionB); Tri(nouveaux, k); /* tri alphabetique pour liste */ printf ("(%d)",k); /* Print_Sat(nouveaux,j); */ remove("satel.bak"); rename(dmold, "satel.bak"); if ((l = Ecrit_Sat(dmo, nouveaux, k)) != k) #ifdef FRANCAIS printf("\nErreur écriture fichier '%s'\n", dmo); #else printf("\nError writing file '%s'\n", dmo); #endif rename(dmo, dmold); } #ifdef FRANCAIS if (good_crc > 0) printf("\nLes données de %d satellites sur %d ont été réactualisées", nsat, k); else if (good_crc == 0) printf("\nAucune nouvelle donnée"); else if (good_crc == -1) printf("\nFichier %s non trouvé !", filename); #else if (good_crc > 0) printf("\nData of %d satellites over %d have been updated", nsat, k); else if (good_crc == 0) printf("\nNothing to update"); else if (good_crc == -1) printf("\nFile %s not found !", filename); #endif #ifdef FRANCAIS printf(" le %02d/%02d/%02d ", cejour->tm_mday, cejour->tm_mon+1, cejour->tm_year%100); printf("a %02u:%02u:%02u\n", cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #else printf(" on %02d/%02d/%02d ", cejour->tm_mday, cejour->tm_mon+1, cejour->tm_year%100); printf("at %02u:%02u:%02u\n", cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #endif sortie(0); return 0; } /* * fonction validation du checksum NASA revue le 24/01/92 pour nouveau format * NASA avec signe (+) valeur 0 */ int crcdix(char *ligne) { char caract; char *pointeur; int i, crc10, crc, valide; crc10 = 0; pointeur = ligne; /* * printf("\n%s\n",ligne); */ for (i = 0; i < 68; i++) { caract = pointeur[i]; if (caract == '-') crc = 1; else if (caract == '+') crc = 0; else crc = atoi(&caract); crc10 += crc; crc10 = crc10 % 10; } caract = pointeur[68]; crc = atoi(&caract); if (crc == crc10) valide = 1; else valide = -1; return (valide); } /*************************** FORMAT AMSAT *************************/ int crc, crc10; int checksum(char *ligne) { int i; char caract; for (i = 0; i < strlen(ligne); i++) { caract = ligne[i]; if (caract == '-') crc += 1; else if (caract == '+') crc += 2; else crc += atoi(&caract); } /* printf("*%d*\n",crc); */ return (crc); } void Amsat(char *filename) { FILE *fd; char tampon[82]; char ligne[81]; char buf1[41] = "\0"; char buf2[41] = "\0"; char nom[18]; long jour; /* secondes depuis 1er Janv 1970 0 heures GMT */ int k, n, m = 0; int valide; /* validation enregistrement */ fd = fopen(filename, "rt"); if (fd != NULL) { while (!feof(fd)) { crc = valide = 0; do { if (fgets(tampon, LINE, fd) != NULL) { sscanf(tampon, "%s", ligne); d_printf("%s\n",ligne); } } while (strcmp("Satellite:", ligne) && !(feof(fd))); crc = checksum(tampon); k = sscanf(tampon, "%*s %s %s %s", nom, buf1, buf2); if (k > 1) strcat(nom, " "), strncat(nom, buf1, 9); else if (k > 2) strcat(nom, " "), strncat(nom, buf2, 9); strncpy(sat.dd, nom, 17); sat.dd[17] = '\0'; if (!feof(fd)) { k = fscanf(fd, "%80s", ligne); if (strncmp("Catalog", ligne, 7) == 0 && !feof(fd)) valide = 1; for (n = 0; n < 2; n++) k = fscanf(fd, "%80s", ligne); sat.cat = atol(ligne); /* Catalog number */ crc = checksum(ligne); for (n = 0; n < 2; n++) { k = fscanf(fd, "%80s", ligne); d_printf("%s\n",ligne); d_printf("\n*%s*",ligne); } k = fscanf(fd, "%2d", (int *)&sat.y3); d_printf("%s\n", ligne); /* itoa(sat.y3,ligne,10); */ sprintf(ligne, "%2d", sat.y3); crc = checksum(ligne); d_printf("%d ", sat.y3); k = fscanf(fd, "%lf", &sat.d3); d_printf("%s\n",ligne); sprintf(ligne, "%3.8lf", sat.d3); crc = checksum(ligne); d_printf("%lf\n",sat.d3); /* Nouvelle ligne élire */ for (n = 0; n < 2; n++) { k = fscanf(fd, "%80s", ligne); /* Element Set */ d_printf("%s\n",ligne); d_printf("\n*%s*",ligne); } k = fscanf(fd, "%4d", (int *)&sat.set); /* element number */ sprintf(ligne, "%4d", sat.set); crc = checksum(ligne); d_printf("%4d\n",sat.set); k = fscanf(fd, "%80s", ligne); d_printf("*%s*",ligne); k = fscanf(fd, "%lf", &sat.i0); /* inclinaison */ sprintf(ligne, "%3.8lf", sat.i0); d_printf("%lf\n",sat.i0); crc = checksum(ligne); for (n = 0; n < 4; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.o0); /* R.A.A.N. */ sprintf(ligne, "%3.8lf", sat.o0); crc = checksum(ligne); for (n = 0; n < 2; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.e0); /* excentricite */ sprintf(ligne, "%3.8lf", sat.e0); crc = checksum(ligne); for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); } k = fscanf(fd, "%lf", &sat.w0); /* arg. perigee */ sprintf(ligne, "%3.8lf", sat.w0); crc = checksum(ligne); for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); } k = fscanf(fd, "%lf", &sat.m0); /* anomal. moyenne */ sprintf(ligne, "%3.8lf", sat.m0); crc = checksum(ligne); sat.a0 = 0.0; /* * contient 0.0 */ for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.n0); /* mouvement moyen */ sprintf(ligne, "%3.8lf", sat.n0); crc = checksum(ligne); for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.q3); /* deriv. mouvem. moy. */ sprintf(ligne, "%2.7e", sat.q3); crc = checksum(ligne); k = fscanf(fd, "%80s", ligne); /* day ^2 */ crc = checksum(ligne); k = fscanf(fd, "%80s", ligne); /* Epoch */ crc = checksum(ligne); if (strcmp("Epoch", ligne) != 0) valide = 0; k = fscanf(fd, "%80s", ligne); /* rev: */ crc = checksum(ligne); k = fscanf(fd, "%ld", &sat.k0); /* num. orbite referen. */ sprintf(ligne, "%ld", sat.k0); crc = checksum(ligne); k = fscanf(fd, "%80s", ligne); /* * while(strcmp("Checksum:",ligne) && !(feof(fd))) ; */ k = fscanf(fd, "%d", &crc10); d_printf("CRC calcule:%d et lu:%d\n",crc,crc10); sat.f1 = 0.0; sat.v1 = 0.0; sat.pas = 5; time(&jour); sat.maj = jour; if ((sat.cat != 0) && (valide != 0)) { if ((crc == crc10) && (fraicheur())) printf("%3d : %-18s", m + 1, sat.dd); else printf(" %-18s", sat.dd); if (fraicheur()) { if (crc == crc10) { CopyStru(nouveaux, m, &sat); m++; /* incrémente le compteur de satellites mis à jour */ printf(" ok\n"); if (m > maxsat) break;; } else { #ifdef FRANCAIS printf(" erreur de CRC !\n"); #else printf(" bad CRC !\n"); #endif } } else { #ifdef FRANCAIS printf(" données trop anciennes !\n"); #else printf(" data too old !\n"); #endif } } } /* tant que pas fin de fichier */ } /* tant que pas fin de fichier */ fclose(fd); } /* si pas NULL */ else m = -1; /*return (m);*/ good_crc = m; } void CopyStru(satel ** stru, int indice, satel * psat) { *stru[indice] = *psat; } /* * élimination des doublons de satellites * en conservant les donnés les plus récentes * retourne le nombre de satellites */ int doublons(int nombre) { int i, j, k; #ifdef FRANCAIS printf("\nrecherche de doublons"); #else printf("\nlooking for duplicate"); #endif /* * FRANCAIS */ for (i = 0; i < nombre - 1; i++) { printf("."); for (j = i + 1; j < nombre; j++) { if (nouveaux[i]->cat == nouveaux[j]->cat) { if (((nouveaux[i]->y3 == nouveaux[j]->y3) && (nouveaux[i]->d3 > nouveaux[j]->d3)) || (nouveaux[i]->y3 > nouveaux[j]->y3)) { nouveaux[j]->libre[0] = -1; } else { nouveaux[i]->libre[0] = -1; } } } } k = 0; for (i = 0; i < nombre; i++) { if (nouveaux[i]->libre[0] != -1) { CopyStru(tampon, k, nouveaux[i]); k++; } } for (i = 0; i < k; i++) { CopyStru(nouveaux, i, tampon[i]); } return (i); } /* * Ecrit_Sat.c */ int Ecrit_Sat(char *filename, satel **stru, int nombre) { int fd2; int indice, n; char *str; str = (char *) (malloc(30 * sizeof(char))); strtok(filename, "."); strcat(filename, ".dat"); sprintf(str, "%s", filename); strcpy(filename, str); n = nombre; /* * fd2 = open(filename,O_CREAT|O_RDWR|O_BINARY,S_IREAD|S_IWRITE); */ fd2 = open(filename, O_CREAT | O_RDWR, S_IREAD | S_IWRITE | S_IEXEC); if (fd2 != -1) { for (indice = 0; indice < nombre; indice++) { if (stru[indice]->libre[0] != -1) { /* printf("sat:{%s}\n ", stru[indice]->dd); */ if (write(fd2, stru[indice], sizeof(satel)) == 0) #ifdef FRANCAIS printf("Impossible d'écrire dans le fichier %s !\n", filename); #else printf("Could not write into file %s !\n", filename); #endif } else n--; } close(fd2); } free(str); return (n); } /* LIRVIEUX.C * Relecture de la base de donné des parametres képlériens * avec suppression des donnés qui dépassent la date_limite */ int fd2; int openfile(char *filename) /* * Nom: openfile() Description : Ouvre le fichier source. * Commentaire : Les fichiers doivent être dans le réertoire FICHIERS */ { char *str; str = (char *) (malloc(30 * sizeof(char))); strtok(filename, "."); strcat(filename, ".dat"); sprintf(str, "%s", filename); strcpy(filename, str); /* * fd2 = open(filename,O_BINARY); */ fd2 = open(filename, O_RDWR, S_IREAD | S_IWRITE | S_IEXEC); if (fd2 == -1) { #ifdef FRANCAIS printf("fichier %s non trouvé - nouvelle banque créée !\n", filename); #else printf("file %s not found - new data base created !\n", filename); #endif fd2 = open(filename, O_CREAT | O_RDWR, S_IREAD | S_IWRITE | S_IEXEC); } #ifdef FRANCAIS printf("lecture fichier %s\n", filename); #else printf("reading file %s\n", filename); #endif return (fd2); } int Lire_Ancien(char *filename) { int n, m, lg; if ((n = openfile(filename)) != -1) { m = 0; while (m < maxsat) { lg = read(fd2, &sat, sizeof(sat)); if (lg <= 0) break; if (fraicheur()) { CopyStru(vieux, m, &sat); m++; } } if (m > maxsat) avorte(); close(fd2); return (m); } else return (n); } /* * MISAJOUR.C version 28 Avril 1991 * retourne le nombre de satellites dans la nouvelle liste * le compteur nsat est égal au nombre de satellites réactualisé * libère la mémoire tampon en sortie */ int Misajour(satel ** vieux, int vv, satel ** nouv, int nn, char option) { int i, j, nnn, vvv; long jour; /* secondes depuis 1er Janv 1970 0 heures GMT */ i = 0; nsat = 0; nnn = 0; vvv = 0; --nn; --vv; time(&jour); switch (option) { /* Option de fusion anciennes & nouvelles données */ case 'F': /* on compare anciennes et nouvelles données * en fonction du numéro de catalogue */ while ((nnn <= nn) && (vvv <= vv)) { if (nouv[nnn]->cat < vieux[vvv]->cat) { CopyStru(tampon, i, nouv[nnn]); nnn++; nsat++; } else if (nouv[nnn]->cat == vieux[vvv]->cat) { /* Objet courant déja au catalogue */ if (((nouv[nnn]->y3 == vieux[vvv]->y3) && (nouv[nnn]->d3 > vieux[vvv]->d3)) || (nouv[nnn]->y3 > vieux[vvv]->y3)) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); memcpy(&tampon[i]->f1, &vieux[vvv]->f1, sizeof(sat.f1)); memcpy(&tampon[i]->pas, &vieux[vvv]->pas, sizeof(sat.pas)); nsat++; } else { CopyStru(tampon, i, vieux[vvv]); } nnn++; vvv++; } else if (nouv[nnn]->cat > vieux[vvv]->cat) { CopyStru(tampon, i, vieux[vvv]); vvv++; } i++; } if (nnn >= nn) { while (vvv <= vv) { CopyStru(tampon, i, vieux[vvv]); vvv++; i++; } } if (vvv >= vv) { while (nnn <= nn) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); nnn++; i++; nsat++; } } break; case 'S': while ((nnn <= nn) && (vvv <= vv)) { if (nouv[nnn]->cat < vieux[vvv]->cat) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); nnn++; i++; nsat++; } else if (nouv[nnn]->cat == vieux[vvv]->cat) { if (((nouv[nnn]->y3 == vieux[vvv]->y3) && (nouv[nnn]->d3 > vieux[vvv]->d3)) || (nouv[nnn]->y3 > vieux[vvv]->y3)) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); /* On conserve la fréuence balise et le pas du calcul */ memcpy(&tampon[i]->f1, &vieux[vvv]->f1, sizeof(sat.f1)); memcpy(&tampon[i]->pas, &vieux[vvv]->pas, sizeof(sat.pas)); nsat++; } else { CopyStru(tampon, i, vieux[vvv]); } nnn++; vvv++; i++; } else if (nouv[nnn]->cat > vieux[vvv]->cat) { vvv++; } } if (vvv >= vv) { while (nnn <= nn) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); nnn++; i++; nsat++; } } break; case 'U': /* mettre à jour seulement les données des satellites déja connus */ while ((nnn <= nn) && (vvv <= vv)) { if (nouv[nnn]->cat < vieux[vvv]->cat) { nnn++; } else if (nouv[nnn]->cat == vieux[vvv]->cat) { if (((nouv[nnn]->y3 == vieux[vvv]->y3) && (nouv[nnn]->d3 > vieux[vvv]->d3)) || (nouv[nnn]->y3 > vieux[vvv]->y3)) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); memcpy(&tampon[i]->f1, &vieux[vvv]->f1, sizeof(sat.f1)); memcpy(&tampon[i]->pas, &vieux[vvv]->pas, sizeof(sat.pas)); nsat++; } else { CopyStru(tampon, i, vieux[vvv]); } nnn++; vvv++; i++; } else if (nouv[nnn]->cat > vieux[vvv]->cat) { CopyStru(tampon, i, vieux[vvv]); vvv++; i++; } } if (nnn >= nn) { while (vvv <= vv) { CopyStru(tampon, i, vieux[vvv]); vvv++; i++; } } break; } for (j = 0; j < i; j++) CopyStru(nouv, j, tampon[j]); return i; } /******************************** * NASA.C * * * * Version 1.6 du 23/10/94 * retourne -1 si fichier non trouvé * * * avec CRC10 * ********************************/ int crcdix(char *ligne); int fraicheur() { double anciennete; /* ancienneté des prévisions en nombre de jours */ double jours; /* différence de jours */ int annees; /* nombre d'annés */ jours = (double) cejour->tm_yday - sat.d3; annees = (cejour->tm_year - sat.y3) % 100; /* nombre d'années */ if (annees == 0) { anciennete = jours; d_printf(" %d jours d'ancienneté ",(int)(jours + 0.5)); } else { /* jours éoulé */ anciennete = (365.0 - sat.d3) + (double) (annees - 1) * 365.0 + (double) cejour->tm_yday; d_printf(" = %02d années écoulées; %d jours d'ancienneté",annees,(int)(anciennete+0.5)); } if (anciennete < date_limite) return 1; else return 0; } char *epure(char *ligne) { int len = strlen(ligne); char *ptr; while (len > 0) { ptr = ligne + len - 1; if (isgraph(*ptr)) break; *ptr = '\0'; --len; } return ligne; } void nasa(char *filename) { int i, m, r; /* m = number of sat entries - r number of rejected entries */ int twolinemodel; /* 2Line model */ int ligne1valide, ligne2valide; /* enregistrement valide 1 sinon 0 */ char *ligne; /* tampon pour lire ligne du fichier */ long jour; /* secondes depuis 1er Janv 1970 0 heures GMT */ double i0; /* Inclinaison */ double o0; /* R.A.A.N. */ double e0; /* Excentricite */ double w0; /* Argument de perigee */ double m0; /* Anomalie moyenne */ double n0; /* Mouvement moyen */ long k0; /* Orbite de reference */ int set; /* Element Number */ long catalog, cat; /* Catalog Number - anciennement vide */ int y3; /* Annee de reference */ double d3; /* Jour de reference */ double q3; /* Derivee du mouv. moy. */ char caract[13]; char *pointe, *pointeur; satel *satp; FILE *fd; satp = &sat; ligne = (char *) (malloc(82 * sizeof(char))); if (ligne == NULL) avorte(); m = r = 0; fd = fopen(filename, "rt"); if (fd != NULL) { while (!feof(fd)) { twolinemodel = FALSE; ligne1valide = TRUE; ligne2valide = TRUE; catalog = -1; strcpy(ligne, " "); pointe = strchr(ligne, '1'); pointeur = strchr(ligne, 'U'); while ((pointe - ligne != 0) || (pointeur - ligne != 7)) { strncpy(sat.dd, ligne, 17); sat.dd[17] = '\0'; if (strncmp (sat.dd, "DECODE 2-LINE", 13) == 0) twolinemodel = TRUE; if (fgets(ligne, LINE, fd) == NULL) break; epure(ligne); pointe = strchr(ligne, '1'); pointeur = strchr(ligne, 'U'); } if (feof(fd)) break; ligne1valide = crcdix(ligne); if (!feof(fd)) { caract[5] = '\0'; for (i = 2; i < 7; i++) caract[i - 2] = ligne[i]; cat = atol(caract); /* numéro catalogue */ caract[2] = '\0'; caract[0] = ligne[18]; caract[1] = ligne[19]; y3 = atoi(caract); /* année */ caract[12] = '\0'; for (i = 20; i < 32; i++) caract[i - 20] = ligne[i]; d3 = atof(caract); /* jour julien */ caract[10] = '\0'; for (i = 33; i < 43; i++) caract[i - 33] = ligne[i]; q3 = atof(caract); /* 1ère dérivée mouvement moyen */ caract[4] = '\0'; for (i = 64; i < 68; i++) caract[i - 64] = ligne[i]; set = atoi(caract); /* Element Set */ sat.set = set; /* Element Number */ sat.cat = cat; /* numéro catalogue */ sat.y3 = y3; /* année */ sat.d3 = d3; /* jour julien */ sat.q3 = q3; /* 1ère dérivée mouvement moyen */ if (fgets(ligne, LINE, fd) != NULL) ligne2valide = crcdix(ligne); epure(ligne); if (ligne[0] != '2') ligne2valide = 0; /* deuxième ligne */ caract[5] = '\0'; for (i = 2; i < 7; i++) caract[i - 2] = ligne[i]; catalog = atol(caract); /* numéro catalogue */ if (catalog != cat) ligne1valide = 0; caract[8] = '\0'; for (i = 8; i < 16; i++) caract[i - 8] = ligne[i]; i0 = atof(caract); /* inclinaison */ caract[8] = '\0'; for (i = 17; i < 25; i++) caract[i - 17] = ligne[i]; o0 = atof(caract); /* R.A.A.N. */ caract[7] = '\0'; for (i = 26; i < 33; i++) caract[i - 26] = ligne[i]; e0 = atof(caract); /* excentricité*/ e0 /= 10e+06; caract[8] = '\0'; for (i = 34; i < 42; i++) caract[i - 34] = ligne[i]; w0 = atof(caract); /* arg. périgé */ caract[8] = '\0'; for (i = 43; i < 51; i++) caract[i - 43] = ligne[i]; m0 = atof(caract); /* anomal. moyenne */ caract[11] = '\0'; for (i = 52; i < 63; i++) caract[i - 52] = ligne[i]; n0 = atof(caract); /* mouvement moyen */ caract[5] = '\0'; for (i = 63; i < 68; i++) caract[i - 63] = ligne[i]; k0 = atol(caract); /* numéro orbite */ sat.i0 = i0; /* inclinaison */ sat.o0 = o0; /* R.A.A.N. */ sat.e0 = e0; /* excentricité*/ sat.w0 = w0; /* arg. périgé */ sat.m0 = m0; /* anomal. moyenne */ sat.n0 = n0; /* mouvement moyen */ sat.k0 = k0; /* numéro orbite */ sat.a0 = 0.0; /* contient 0.0 */ sat.f1 = 0.0; sat.v1 = 0.0; sat.pas = 5; time(&jour); sat.maj = jour; if (twolinemodel == FALSE) { if ((ligne1valide == -1) || (ligne2valide == -1) || !fraicheur()) printf(" %-18s", sat.dd); else printf("%3d : %-18s", m + 1, sat.dd); if (ligne1valide == TRUE && ligne2valide == TRUE) { if (fraicheur()) { CopyStru(nouveaux, m, satp); m++; /* incrémente le compteur de satellites mis à jour */ printf(" ok\n"); if (m > maxsat) break; } else { #ifdef FRANCAIS printf(" données trop anciennes !\n"); #else printf(" data too old !\n"); #endif } } else { r++; #ifdef FRANCAIS printf(" erreur de CRC !\n"); #else printf(" CRC error !\n"); #endif } } ligne1valide = TRUE; ligne2valide = TRUE; } /* tant que pas fin de fichier */ } /* tant que pas fin de fichier */ fclose(fd); } else m = -1; /* si nul=fichier non trouvé*/ free(ligne); good_crc = m; bad_crc = r; } /* tri a bulle des noms de satellites */ void Tri(satel ** stru, int nombre) { int i, j; satel *tampon; /* tampon pour comparaison */ #ifdef FRANCAIS printf("\ntri alphabétique"); #else printf("\nsorting by name"); #endif /* on trie les pointeurs */ for (i = 0; i < nombre - 1; i++) { printf("."); for (j = i + 1; j < nombre; j++) { if (strcmp(stru[i]->dd, stru[j]->dd) > 0) { tampon = stru[i]; stru[i] = stru[j]; stru[j] = tampon; } } } } /* tri à bulle des numéros de catalogue de satellites */ void Tri_Cat(satel ** stru, int nombre) { int i, j; satel *tampon; /* tampon pour comparaison */ #ifdef FRANCAIS printf("\ntri par numéro de catalogue"); #else printf("\nsorting by catalog number"); #endif /* on trie les pointeurs */ for (i = 0; i < nombre - 1; i++) { printf("."); for (j = i + 1; j < nombre; j++) { if (stru[i]->cat > stru[j]->cat) { tampon = stru[i]; stru[i] = stru[j]; stru[j] = tampon; } } } } fbb-7.0.10/src/warning.c0000644000175000017500000001110313613360505011647 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* Module gerant les messages "warning" */ /* * Demande de message warning : * * 1 - PingPong * 2 - Route inconnue * 3 - NTS inconnu * */ void dde_warning (int type) { pvoie->warning |= type; } void tst_warning (bullist * ptmes) { char wtexte[256]; char nom[128]; unsigned warning = pvoie->warning; while (warning) { if (warning & W_PPG) { #ifdef ENGLISH sprintf (wtexte, "Duplicate reverse forward of # %ld to %s, route to %s", ptmes->numero, ptmes->desti, ptmes->bbsv ); if (w_mask & W_PINGPONG) mess_warning (admin, "*** PING-PONG ***", wtexte); #else sprintf (wtexte, "Presentation en retour du # %ld a %s, routage vers %s", ptmes->numero, ptmes->desti, ptmes->bbsv ); if (w_mask & W_PINGPONG) mess_warning (admin, "*** PING-PONG ***", wtexte); #endif warning &= ~(W_PPG); } else if (warning & W_ROU) { #ifdef ENGLISH sprintf (wtexte, "Unknown route to %s. \rMessage #%ld written by %s received %s \r", ptmes->bbsv, ptmes->numero, ptmes->exped, strdate (time (NULL)) ); if (w_mask & W_NO_ROUTE) mess_warning (admin, "*** UNKNOWN ROUTE *** ", wtexte); #else sprintf (wtexte, "Acheminement vers %s inconnu.\rMessage %ld demande par %s recu le %s\r", ptmes->bbsv, ptmes->numero, ptmes->exped, strdate (time (NULL)) ); if (w_mask & W_NO_ROUTE) mess_warning (admin, "*** ACHEMINEMENT INCONNU ***", wtexte); #endif warning &= ~(W_ROU); } else if (warning & W_NTS) { #ifdef ENGLISH sprintf (wtexte, "Unknown NTS %s. \rMessage #%ld written by %s received %s\r", ptmes->desti, ptmes->numero, ptmes->exped, strdate (time (NULL)) ); if (w_mask & W_NO_NTS) mess_warning (admin, "*** UNKNOWN NTS ***", wtexte); #else sprintf (wtexte, "NTS %s inconnu.\rMessage %ld demande par %s recu le %s \r", ptmes->desti, ptmes->numero, ptmes->exped, strdate (time (NULL)) ); if (w_mask & W_NO_NTS) mess_warning (admin, "*** NTS INCONNU ***", wtexte); #endif warning &= ~(W_NTS); } else if (warning & W_ASC) { mess_name (MESSDIR, ptmes->numero, nom); #ifdef ENGLISH sprintf (wtexte, "Ascii file %s not found \r", nom ); if (w_mask & W_MESSAGE) mess_warning (admin, "*** ASCII FILE NOT FOUND ***", wtexte); #else sprintf (wtexte, "Fichier ascii %s pas trouve\r", nom ); if (w_mask & W_MESSAGE) mess_warning (admin, "*** ERREUR FICHIER ASCII ***", wtexte); #endif warning &= ~(W_ASC); } else if (warning & W_BIN) { mess_name (MBINDIR, ptmes->numero, nom); #ifdef ENGLISH sprintf (wtexte, "Binary file %s not found \r", nom ); if (w_mask & W_MESSAGE) mess_warning (admin, "*** BIN FILE NOT FOUND ***", wtexte); #else sprintf (wtexte, "Fichier binaire %s pas trouve\r", nom ); if (w_mask & W_MESSAGE) mess_warning (admin, "*** ERREUR FICHIER BIN ***", wtexte); #endif warning &= ~(W_BIN); } } pvoie->warning = 0; } void mess_warning (char *w_desti, char *w_titre, char *w_texte) { int nb, sav_voie = voiecur, sav_lang = vlang; if (voiecur == MWARNING) return; /* Deja en warning */ deb_io (); selvoie (MWARNING); if (FOR (svoie[sav_voie]->mode)) pvoie->mode |= F_FOR; entete_saisie (); ini_champs (voiecur); strn_cpy (6, ptmes->desti, w_desti); strcpy (ptmes->exped, mycall); ptmes->type = 'P'; swapp_bbs (ptmes); reacheminement (); strn_cpy (60, ptmes->titre, w_titre); pvoie->mode = F_FOR; nb = strlen (w_texte); w_texte[nb] = '\032'; get_mess_fwd ('\0', w_texte, nb + 1, 2); selvoie (sav_voie); vlang = sav_lang; fin_io (); } fbb-7.0.10/src/mblutil.c0000644000175000017500000005470013613360505011664 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MBLUTIL.C * */ #include #include #ifdef TRACE static int fd_trace = -1; open_trace () { fd_trace = open ("TRACE.MON", O_WRONLY | O_APPEND | O_CREAT | O_TEXT, S_IREAD | S_IWRITE); } close_trace () { if (fd_trace != -1) close (fd_trace); } static trace (char *chaine, int lg, int date) { char *ptr = chaine; int i; long temps; struct tm *sdate; char cdate[20]; static char ret = '\n'; if (fd_trace == -1) return; for (i = 0; i < lg; i++) { if (*ptr == '\r') *ptr = '\n'; ++ptr; } write (fd_trace, chaine, lg); if (date) { temps = time (NULL); sdate = localtime (&temps); sprintf (cdate, " (%02d:%02d:%02d)", sdate->tm_hour, sdate->tm_min, sdate->tm_sec); write (fd_trace, cdate, 11); } } #endif void force_deconnexion (int voie, int mode) { df ("force_deconnexion", 2); if ((p_port[no_port (voie)].typort == TYP_HST) && (P_TOR (voie))) { /* WinDebug("Immediate disconnect request\r\n"); */ tnc_commande (voie, "!DD", SNDCMD); dec_voie (voie); } else { deconnexion (voie, mode); deconnexion (voie, mode); } ff (); } void debug_mode (void) { if (debug_on) { if (!debug_fptr) debug_fptr = fopen ("DEBUG.BUG", "at"); } else { if (debug_fptr) fclose (debug_fptr); debug_fptr = NULL; } } int virt_canal (int nocan) { int canal; if (nocan > 1) canal = nocan - 1; else if (nocan == 1) canal = 99; else canal = 0; return (canal); } void aff_chaine (int color, int xpos, int ypos, char *chaine) { #ifdef __FBBDOS__ struct text_info sav_fen; df ("aff_chaine", 5); deb_io (); gettext_info (&sav_fen); fen_haut (color); curoff (); gotoxy (xpos, ypos); cputs (chaine); puttext_info (&sav_fen); fin_io (); ff (); #endif } int nbport (void) { int nbp = 0, port; df ("nbport", 0); for (port = 1; port < NBPORT; port++) if (p_port[port].pvalid) nbp++; ff (); return (nbp); } int read_only (void) { if (pvoie->read_only) { outln ("*** Error : read-only mode", 26); /* texte(T_ERR + 0); */ return (1); } return (0); } char *lf_to_cr (char *texte) { char *ptr = texte; char *optr = texte; while (*ptr) { if ((*ptr == '\r') && (*(ptr + 1) == '\n')) { ++ptr; } else { if (*ptr == '\n') *optr++ = '\r'; else *optr++ = *ptr; ++ptr; } } *optr = '\0'; return (texte); } void while_space (void) { while (isspace (*indd)) ++indd; } int strmatch (char *chaine, char *masque) { while (1) { switch (*masque) { case '\0': return (toupper (*masque) == toupper (*chaine)); case '&': if ((*chaine == '\0') || (*chaine == '.')) return (1); break; case '?': if (!isalnum (*chaine)) return (0); break; case '#': if ((*chaine != '#') && (!isdigit (*chaine))) return (0); break; case '@': if (!isalpha (*chaine)) return (0); break; case '=': if (!ISGRAPH (*chaine)) return (0); break; case '*': while (*++masque == '*') ; if (*masque == '\0') return (1); while (!strmatch (chaine, masque)) if (*++chaine == '\0') return (0); break; default: if ((toupper (*chaine)) != (toupper (*masque))) return (0); break; } ++chaine; ++masque; } } void ch_niv3 (int niveau) { maj_niv (pvoie->niv1, pvoie->niv2, niveau); } void ch_niv2 (int niveau) { maj_niv (pvoie->niv1, niveau, 0); } void ch_niv1 (int niveau) { maj_niv (niveau, 0, 0); } int droits (unsigned int droit) { if (voiecur == CONSOLE) return (1); return (droit & pvoie->droits); } void ch_bit (ind_noeud * noeud, info * frec, unsigned bit, char rep) { FILE *fptr; int c = toupper (rep); if ((c != Oui) && (c != Non) && (c != '\0')) return; if (pvoie->read_only) return; fptr = ouvre_nomenc (); fseek (fptr, (long) noeud->coord * sizeof (info), 0); fread (frec, sizeof (info), 1, fptr); rep = toupper (rep); if (c == Oui) { frec->flags |= bit; } else if (c == Non) { frec->flags &= (~bit); } else if (c == '\0') { if (frec->flags & bit) { frec->flags &= (~bit); } else { frec->flags |= bit; } } if (noeud->coord == 0xffff) dump_core (); fseek (fptr, (long) noeud->coord * sizeof (info), 0); fwrite (frec, sizeof (info), 1, fptr); ferme (fptr, 42); noeud->val = (uchar) (EXC (frec->flags) == 0); } void cmd_err (char *ptri) { int i = 0; char *ptr = varx[0]; while (ISGRAPH (*ptri)) { if (++i == 40) break; else *ptr++ = *ptri++; } *ptr = '\0'; texte (T_ERR + 1); *varx[0] = '\0'; if ((FOR (pvoie->mode)) || (++pvoie->nb_err == MAX_ERR)) pvoie->deconnect = 6; else retour_menu (pvoie->niv1); } void strn_cpy (int longueur, char *dest, char *orig) { while (longueur--) { if (!ISPRINT (*orig)) break; *dest++ = toupper (*orig); ++orig; } *dest = '\0'; } void n_cpy (int longueur, char *dest, char *orig) { while (longueur--) { if (*orig == '\0') break; *dest++ = *orig++; } *dest = '\0'; } void init_recliste (int voie) { tlist *ptlist = &svoie[voie]->recliste; ptlist->l = FALSE; ptlist->type = '\0'; ptlist->status = '\0'; ptlist->route = '\0'; *ptlist->exp = '\0'; *ptlist->dest = '\0'; *ptlist->bbs = '\0'; *ptlist->find = '\0'; ptlist->debut = 0L; ptlist->fin = 0x7fffffffL; ptlist->avant = 0L; ptlist->apres = 0x7fffffffL; ptlist->last = 0x7fffffffL; if (*svoie[voie]->finf.filtre) strn_cpy (6, ptlist->dest, svoie[voie]->finf.filtre); } int droit_ok (bullist * lbul, int mode) { /* * mode 1 : consultation (lecture) * mode 2 : suppression (ecriture) * mode 3 : archivage * mode 4 : idem mode 2 mais autorise tuer le message "Non lu" */ int kill_new = 0; if (mode == 4) { mode = 2; kill_new = 1; } if (mode == 3) { if (lbul->status == 'A') return (0); else return (1); } if (lbul->status == 'K') { if (mode == 2) return (0); } if (droits (SUPMES)) return (1); if ((mode == 1) && (droits (CONSMES) || PRV (pvoie->finf.flags))) if ((strcmp (lbul->desti, "KILL") != 0) && (lbul->status != 'H')) return (1); if (lbul->status == 'H') { if ((SYS (pvoie->finf.flags)) || indcmp (lbul->exped, pvoie->sta.indicatif.call)) return (1); else return (0); } if (strcmp (lbul->desti, "WP") == 0) return (0); switch (lbul->type) { case 'A': case 'P': switch (mode) { case 2: if (indcmp (lbul->desti, pvoie->sta.indicatif.call)) { if ((kill_new) || (lbul->status != 'N')) { return (1); } } if (indcmp (lbul->exped, pvoie->sta.indicatif.call)) return (1); break; case 1: if ((indcmp (lbul->desti, pvoie->sta.indicatif.call)) || (indcmp (lbul->exped, pvoie->sta.indicatif.call))) return (1); break; } break; case ' ': case 'B': if (mode == 2) { if ((indcmp (lbul->exped, pvoie->sta.indicatif.call)) || (indcmp (lbul->desti, pvoie->sta.indicatif.call))) return (1); } else if (lbul->status == 'A') return (0); else if (strcmp (lbul->desti, "KILL") != 0) return (1); break; case 'T': if (lbul->status == 'A') return (0); else return (1); default: return (0); } return (0); } void retour_mbl (void) { libere_tread (voiecur); libere_tlist (voiecur); pvoie->mbl = 1; pvoie->private_dir = 0; set_bs (voiecur, TRUE); retour_menu (N_MBL); } int teste_rep (char *chaine) { if (iscntrl (*chaine)) return (0); if (*chaine == ' ') return (1); else { texte (T_ERR + 2); return (0); } } long lit_chiffre (int ajuste) { long chif; char *ptr; if (*indd == '\0') return (0L); teste_espace (); if (isdigit (*indd)) { ptr = indd; while ((*indd) && (isdigit (*indd))) ++indd; chif = atol (ptr); if ((ajuste) && (chif < ECART)) chif += (1000L * (long) pvoie->finf.on_base); return (chif); } else if (*indd) { if (*indd == '#') { ++indd; return (ptmes->numero); } else texte (T_ERR + 3); } return (0L); } int is_espace (char *ptr) { int espace = (*ptr == ' '); while ((*ptr) && (*ptr == ' ')) ++ptr; if (ISPRINT (*ptr)) return (espace); else return (1); } int teste_espace (void) { int ok = 0; if (*indd) { if (*indd == ' ') ok = 1; while ((*indd) && (!ISGRAPH (*indd))) ++indd; } return (ok); } long supp_header (FILE * fptr, int ok) { int c, first = 1, nb = 0, call = 0; char ligne[90]; char *ptr = ligne; int flag = FALSE; long record = 0L; short int postexte = 0; record = ftell (fptr); while ((c = fgetc (fptr)) != EOF) { if ((flag) && (c == '\n')) { record = ftell (fptr); postexte = 0; call = 0; flag = FALSE; } else { switch (call) { case 0: break; case 1: if (isalnum (c)) { *ptr++ = c; nb++; call = 2; } break; case 2: if (isalnum (c)) { *ptr++ = c; nb++; } else { *ptr++ = '!'; nb++; call = 0; if (nb >= 65) { outln (ligne, nb); nb = 0; ptr = ligne; first = 2; } } break; } if (postexte == 0) { if (c != 'R') /*return(record) */ break; else flag = TRUE; } if ((postexte == 1) && (flag) && (c != ':')) /*return(record) */ break; ++postexte; } if ((ok) && (flag) && (c == '@')) { if (first) { if (first == 1) out ("Path: !", 7); else out (" !", 7); first = 0; } call = 1; } } if (nb) outln (ligne, nb); /* return(ftell(fptr)) ; */ return (record); } bullist *ch_record (bullist * list, long no, char status) { mess_noeud *lptr; static bullist ltemp; bullist *lbul; ind_noeud *noeud; char temp = '\0'; int ok = 0; int kill_new = 0; int no_type = 0; if (status == 'Z') { no_type = 1; status = 'A'; } if (status & 0x80) { kill_new = 1; status &= 0x7f; } if (list) lbul = list; else lbul = <emp; lbul->numero = no; if ((lptr = findmess (no)) != NULL) { ouvre_dir (); read_dir (lptr->noenr, lbul); if (lbul->type) { if (status == 'Y') { ++lbul->nblu; temp = lbul->status; } if ((status) && (status != lbul->status)) { switch (status) { case 'Y': if ((lbul->status == 'N') || (lbul->status == '$')) { if ((lbul->type == 'P') || (lbul->type == 'A')) { if (indcmp (pvoie->sta.indicatif.call, lbul->desti)) { noeud = cher_noeud (lbul->desti); --(pvoie->ncur->nbnew); } else break; } else { if ((lbul->status == '$') || (indcmp (pvoie->sta.indicatif.call, lbul->exped))) break; } temp = lbul->status; lbul->status = status; } break; case 'F': if (lbul->status == 'K') break; if (lbul->status == 'X') break; if (lbul->status == 'A') break; noeud = cher_noeud (lbul->desti); if (lbul->status == 'N') --(noeud->nbnew); if ((lbul->type == 'P') && (lbul->status == '$')) --(noeud->nbnew); chg_mess (0xffff, no); temp = lbul->status; lbul->status = status; break; case 'A': lbul->datech = 0L; case 'K': if ((!kill_new) && (lbul->datech)) { if (!droit_ok (lbul, 2)) break; else if (!droit_ok (lbul, 3)) break; } noeud = cher_noeud (lbul->desti); if ((!kill_new) && (!droits (SUPMES))) { if ((indcmp (pvoie->sta.indicatif.call, lbul->desti))) { if (lbul->status == 'N') break; } } if (lbul->status == 'N') { if (noeud->nbnew > 0) --(noeud->nbnew); } /* if (lbul->status == 'H') { --nb_hold; } */ if ((lbul->status != 'K') && (lbul->status != 'A')) { if (noeud->nbmess > 0) --(noeud->nbmess); chg_mess (0xffff, no); } temp = lbul->status; lbul->status = status; break; case 'H': if (!droit_ok (lbul, 2)) break; noeud = cher_noeud (lbul->desti); if (((lbul->status != 'N') || (lbul->type != 'P')) && ((lbul->status != '$') || (lbul->type != 'B'))) break; if (lbul->status == 'N') { --(noeud->nbnew); } if ((lbul->status != 'K') && (lbul->status != 'A')) { --(noeud->nbmess); /* chg_mess(0xffff, no); */ } temp = lbul->status; lbul->status = status; break; } } if (temp) { if (lbul->datech) lbul->datech = time (NULL); if (no_type) lbul->type = '\0'; write_dir (lptr->noenr, lbul); lbul->status = temp; aff_msg_cons (); } ok = 1; } ferme_dir (); } *ptmes = *lbul; if (ok) return (lbul); else return (NULL); } int entete_liste (void) { return (texte (T_MBL + 36)); } int indcmp (char *ind1, char *ind2) { char *ptr1 = ind1; char *ptr2 = ind2; if (*ptr1 != *ptr2) return (FALSE); ++ptr1; ++ptr2; if ((!isalnum (*ptr1)) && (!isalnum (*ptr2))) return (TRUE); if (*ptr1++ != *ptr2++) return (FALSE); while ((isalnum (*ptr1)) || (isalnum (*ptr2))) { if (*ptr1++ != *ptr2++) return (FALSE); } return (TRUE); } /* * teste si ind2 est compris dans ind1 * en tenant compte des champs de hierarchie * */ int hiecmp (char *ind1, char *ind2) { char str[80]; char *ptr; strcpy (str, ind1); for (;;) { if (strcmpi (str, ind2) == 0) return (TRUE); ptr = strrchr (str, '.'); if (ptr == NULL) break; *ptr = '\0'; } return (FALSE); } char *sup_ln (char *buf) { int nb = strlen (buf); if (nb > 0) { while (nb--) { if (ISGRAPH (buf[nb])) break; if (buf[nb]) buf[nb] = '\0'; } } return (buf); } char *ch_slash (char *chaine) { char *ptr = chaine; while (*ptr) { if (*ptr == '/') *ptr = '\\'; ++ptr; } return (chaine); } char *tot_path (char *nom_fic, char *source) { int lg; char vdisk; static char temp[256]; *temp = '\0'; /* char *ptr; ptr = nom_fic; while (*ptr) { if (islower (*ptr)) *ptr = toupper (*ptr); ++ptr; } */ vdisk = pvoie->vdisk; if (nom_fic[1] == ':') { if (((voiecur == CONSOLE) || (pvoie->kiss == -2)) && (!pvoie->cmd_new)) { vdisk = nom_fic[0] - 'A'; } else { vdisk = nom_fic[0] - 'A'; if (vdisk == 15) vdisk = 8; if (vdisk > 8) vdisk = 0; if ((vdisk < 8) && (*PATH[(int)vdisk] == '\0')) vdisk = 0; } nom_fic += 2; } if ((pvoie->kiss == -2) || ((droits (ACCESDOS)) && (pvoie->temp1 != N_YAPP) && (!pvoie->cmd_new))) { sprintf (temp, "%c:", vdisk + 'A'); #ifdef __linux__ if (*nom_fic != '/') #else if (*nom_fic != '\\') #endif strcat (temp, source); } else { if (pvoie->temp1 == N_YAPP) { strcpy (temp, YAPPDIR); } else { if (vdisk == 8) { if (pvoie->finf.priv[1] != ':') sprintf (temp, "%c:%s", 'A' + getdisk (), pvoie->finf.priv); else strcpy (temp, pvoie->finf.priv); } else strcpy (temp, PATH[(int)vdisk]); } #ifdef __linux__ if (((lg = strlen (temp)) > 1) && (temp[lg - 1] == '/')) temp[lg - 1] = '\0'; if (*nom_fic != '/') #else if (((lg = strlen (temp)) > 1) && (temp[lg - 1] == '\\')) temp[lg - 1] = '\0'; if (*nom_fic != '\\') #endif strcat (temp, source); } /* DEBUG F6BVP printf ("tot_path() temp '%s' source '%s' nom_fic '%s'\n", temp, source, nom_fic);*/ strcat (temp, nom_fic); strcpy(temp, long_filename(NULL, temp)); vir_path (temp); return temp; } void tester_masque (void) { char *t = pvoie->ch_temp; int cpt = 0; if (*indd == '\0') *t++ = '*'; else { while (isalnum (*indd)) { if (cpt++ < 7) { *t++ = toupper (*indd); ++indd; } else break; } } *t = '\0'; } char *comp_bid (char *bid) { static char out_bid[BIDCOMP]; char in_bid[BIDLEN]; char *ibid, *obid; int i, fin = 0; for (i = 0; i < BIDLEN; i++) { if ((!fin) && (*bid)) { in_bid[i] = (*bid - 32) & 0x3f; } else { fin = 1; in_bid[i] = '\0'; } ++bid; } ibid = in_bid; obid = out_bid; for (i = 0; i < BIDCOMP; i += 3) { obid[0] = (ibid[0] << 2) + (ibid[1] >> 4); obid[1] = (ibid[1] << 4) + (ibid[2] >> 2); obid[2] = (ibid[2] << 6) + (ibid[3]); ibid += 4; obid += 3; } return (out_bid); } void var_cpy (int novar, char *texte) { if ((novar >= 0) && (novar < 10)) n_cpy (80, varx[novar], texte); } void fbb_log (int voie, char event, char *texte) { if (svoie[voie]->log) port_log (voie, 1, event, texte); } void port_log (int voie, int val, char event, char *texte) { int lvoie; struct tm *sdate; char *ptr; long temps = time (NULL); char com[256], buf[80]; if (comlog) { lvoie = (val) ? voie : 0; sdate = localtime (&temps); n_cpy (66, buf, sup_ln (texte)); ptr = buf; while (*ptr) { /* Supression des caracteres de controle */ if (iscntrl (*ptr)) *ptr = '_'; ++ptr; } sprintf (com, "%02d%02d%02d%02d%02d%02d%c%s\r\n", sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min, sdate->tm_sec, lvoie, event, buf); if (log_ptr == NULL) ouvre_log (); if (log_ptr) fputs (com, log_ptr); } } /* Table de conversion engendrée mécaniquement par Free «recode» 3.5 pour séquence «IBM850..ISO-8859-1 (réversible)». */ unsigned char const IBM850_ISO_8859_1[256] = { 0, 1, 2, 3, 4, 5, 6, 7, /* 0 - 7 */ 8, 9, 10, 11, 12, 13, 14, 15, /* 8 - 15 */ 16, 17, 18, 19, 20, 21, 22, 23, /* 16 - 23 */ 24, 25, 26, 27, 28, 29, 30, 31, /* 24 - 31 */ 32, 33, 34, 35, 36, 37, 38, 39, /* 32 - 39 */ 40, 41, 42, 43, 44, 45, 46, 47, /* 40 - 47 */ 48, 49, 50, 51, 52, 53, 54, 55, /* 48 - 55 */ 56, 57, 58, 59, 60, 61, 62, 63, /* 56 - 63 */ 64, 65, 66, 67, 68, 69, 70, 71, /* 64 - 71 */ 72, 73, 74, 75, 76, 77, 78, 79, /* 72 - 79 */ 80, 81, 82, 83, 84, 85, 86, 87, /* 80 - 87 */ 88, 89, 90, 91, 92, 93, 94, 95, /* 88 - 95 */ 96, 97, 98, 99, 100, 101, 102, 103, /* 96 - 103 */ 104, 105, 106, 107, 108, 109, 110, 111, /* 104 - 111 */ 112, 113, 114, 115, 116, 117, 118, 119, /* 112 - 119 */ 120, 121, 122, 123, 124, 125, 126, 127, /* 120 - 127 */ 199, 252, 233, 226, 228, 224, 229, 231, /* 128 - 135 */ 234, 235, 232, 239, 238, 236, 196, 197, /* 136 - 143 */ 201, 230, 198, 244, 246, 242, 251, 249, /* 144 - 151 */ 255, 214, 220, 248, 163, 216, 215, 159, /* 152 - 159 */ 225, 237, 243, 250, 241, 209, 170, 186, /* 160 - 167 */ 191, 174, 172, 189, 188, 161, 171, 187, /* 168 - 175 */ 155, 157, 141, 129, 139, 193, 194, 192, /* 176 - 183 */ 169, 150, 132, 140, 148, 162, 165, 151, /* 184 - 191 */ 156, 145, 147, 128, 142, 143, 227, 195, /* 192 - 199 */ 131, 144, 146, 133, 138, 153, 158, 164, /* 200 - 207 */ 240, 208, 202, 203, 200, 134, 205, 206, /* 208 - 215 */ 207, 137, 130, 136, 154, 166, 204, 152, /* 216 - 223 */ 211, 223, 212, 210, 245, 213, 181, 254, /* 224 - 231 */ 222, 218, 219, 217, 253, 221, 175, 180, /* 232 - 239 */ 173, 177, 149, 190, 182, 167, 247, 184, /* 240 - 247 */ 176, 168, 183, 185, 179, 178, 135, 160, /* 248 - 255 */ }; /* Conversion table generated mechanically by Free `recode' 3.5 for sequence ISO-8859-1..IBM850 (reversible). */ unsigned char const ISO_8859_1_IBM850[256] = { 0, 1, 2, 3, 4, 5, 6, 7, /* 0 - 7 */ 8, 9, 10, 11, 12, 13, 14, 15, /* 8 - 15 */ 16, 17, 18, 19, 20, 21, 22, 23, /* 16 - 23 */ 24, 25, 26, 27, 28, 29, 30, 31, /* 24 - 31 */ 32, 33, 34, 35, 36, 37, 38, 39, /* 32 - 39 */ 40, 41, 42, 43, 44, 45, 46, 47, /* 40 - 47 */ 48, 49, 50, 51, 52, 53, 54, 55, /* 48 - 55 */ 56, 57, 58, 59, 60, 61, 62, 63, /* 56 - 63 */ 64, 65, 66, 67, 68, 69, 70, 71, /* 64 - 71 */ 72, 73, 74, 75, 76, 77, 78, 79, /* 72 - 79 */ 80, 81, 82, 83, 84, 85, 86, 87, /* 80 - 87 */ 88, 89, 90, 91, 92, 93, 94, 95, /* 88 - 95 */ 96, 97, 98, 99, 100, 101, 102, 103, /* 96 - 103 */ 104, 105, 106, 107, 108, 109, 110, 111, /* 104 - 111 */ 112, 113, 114, 115, 116, 117, 118, 119, /* 112 - 119 */ 120, 121, 122, 123, 124, 125, 126, 127, /* 120 - 127 */ 195, 179, 218, 200, 186, 203, 213, 254, /* 128 - 135 */ 219, 217, 204, 180, 187, 178, 196, 197, /* 136 - 143 */ 201, 193, 202, 194, 188, 242, 185, 191, /* 144 - 151 */ 223, 205, 220, 176, 192, 177, 206, 159, /* 152 - 159 */ 255, 173, 189, 156, 207, 190, 221, 245, /* 160 - 167 */ 249, 184, 166, 174, 170, 240, 169, 238, /* 168 - 175 */ 248, 241, 253, 252, 239, 230, 244, 250, /* 176 - 183 */ 247, 251, 167, 175, 172, 171, 243, 168, /* 184 - 191 */ 183, 181, 182, 199, 142, 143, 146, 128, /* 192 - 199 */ 212, 144, 210, 211, 222, 214, 215, 216, /* 200 - 207 */ 209, 165, 227, 224, 226, 229, 153, 158, /* 208 - 215 */ 157, 235, 233, 234, 154, 237, 232, 225, /* 216 - 223 */ 133, 160, 131, 198, 132, 134, 145, 135, /* 224 - 231 */ 138, 130, 136, 137, 141, 161, 140, 139, /* 232 - 239 */ 208, 164, 149, 162, 147, 228, 148, 246, /* 240 - 247 */ 155, 151, 163, 150, 129, 236, 231, 152, /* 248 - 255 */ }; uchar *ansi_to_ibm(uchar *buffer, int len) { uchar *ptr = buffer; while (len--) { *ptr = ISO_8859_1_IBM850[(int)*ptr]; ++ptr; } return buffer; } uchar *ibm_to_ansi(uchar *buffer, int len) { uchar *ptr = buffer; while (len--) { *ptr = IBM850_ISO_8859_1[(int)*ptr]; ++ptr; } return buffer; } #undef fopen #undef fclose #undef fprintf /* void debuglog(char *fmt,...) { time_t temps = time(NULL); va_list argptr; FILE *fptr = fopen("/tmp/debug.log", "a+"); if (!fptr) return; fprintf (fptr, "\n%s", asctime (localtime (&temps))); va_start (argptr, fmt); vfprintf (fptr, fmt, argptr); va_end (argptr); fclose(fptr); } */ fbb-7.0.10/src/yapp.c0000644000175000017500000007044513743324722011176 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ /* * MODULE TRANSFERT BINAIRE PROTOCOLE YAPP */ #include typedef struct { char nom[FBB_NAMELENGTH+1]; char attr; unsigned date; long size; } Fichier; #include "yapp.h" char *nom_yapp (void); static int dir_ok (char *); static void ack1 (void); static void ack2 (void); static void ack3 (void); static void ack4 (void); static void ack5 (void); static void bin_hdr (char *, long); static void canwait (void); static void canrecd (void); static void change_label (void); static void fin_yapp (void); /* static void not_ready(char *); */ static void reprise_yapp (void); static void sendeof (void); static void sendinit (void); static void sendinit_retry (void); static void wrbuf (void); static void yapp_timer (void); static void yapp_xfer (void); static uchar etat[12][17] = { {AB, SH, SD, AB, AB, AB, AB, AB, SA, C, AB, S, DP, S1, AB, AB, AB}, {AB, SH, SD, AB, AB, AB, AB, AB, SA, C, AB, S, DP, S1, AB, AB, AB}, {AB, AB, SD, AB, AB, AB, AB, AB, RP, C, AB, AB, DP, AB, AB, AB, AB}, {AB, AB, AB, AB, AB, AB, AB, AB, AB, C, AB, AB, DP, AB, AB, AB, SD}, {AB, AB, AB, AB, AB, AB, AB, AB, AB, C, AB, AB, DP, AB, ST, AB, AB}, {SA, SA, SA, SA, SA, SA, SA, SA, SA, C, SA, SA, DP, SA, SA, SA, AB}, {AB, AB, AB, E1, AB, AB, AB, AB, AB, C, AB, AB, DP, AB, AB, AB, AB}, {AB, AB, AB, RH, E2, AB, AB, E4, AB, C, AB, AB, DP, AB, AB, AB, AB}, {AB, AB, AB, AB, AB, E6, E3, AB, AB, C, AB, AB, DP, AB, AB, AB, AB}, {SA, CW, CW, CW, CW, CW, CW, CW, CW, C, CW, CW, CW, CW, CW, CW, AB}, {SA, CW, CW, CW, CW, CW, CW, CW, CW, E5, SA, CW, DP, SA, CW, CW, AB}, {AB, SA, SA, SA, SA, SA, SA, SA, SA, C, SA, SA, SA, SA, SA, SA, AB} }; void display_perf (int voie) { int save_voie; ltoa (svoie[voie]->size_trans, varx[0], 10); if (svoie[voie]->time_trans == 0) svoie[voie]->time_trans = 1; ltoa (svoie[voie]->size_trans / svoie[voie]->time_trans, varx[1], 10); if (pvoie->kiss == -2) { save_voie = voiecur; selvoie (CONSOLE); texte (T_DOS + 5); selvoie (save_voie); } else texte (T_DOS + 5); } static void reprise_yapp (void) { int lg = 0xff & (int) *(indd + 1); if ((lg == 0) || (*(indd + 2) != 'R') || (*(indd + 3) != '\0')) { ch_niv2 (SA); fin_yapp (); } else { pvoie->type_yapp = 0; indd += 4; lg -= 2; pvoie->enrcur = atol (indd); /* Position in the file */ while (*indd) { --lg; ++indd; } if (lg > 1) { ++indd; --lg; if (*indd == 'C') pvoie->type_yapp = 1; /* Yapp checksum */ aff_yapp (voiecur); } time_yapp[voiecur] = -1; pvoie->time_trans = time (NULL); if (senddata (2)) { sendeof (); ch_niv2 (SE); } else ch_niv2 (SD); } } char *vir_path (char *nomfic) { int i; int len; char *nptr; char fn[256]; static char filename[256]; if (nomfic[1] == ':') { nptr = nomfic; } else { fn[0] = getdisk () + 'A'; fn[1] = ':'; strcpy (fn + 2, nomfic); nptr = slash2back(fn); } for (i = 0; i < NB_PATH; i++) { len = strlen (PATH[i]); /* Cherche l'unite virtuelle */ if ((len) && (strncmpi (PATH[i], nptr, len) == 0)) { /* Transforme le nom physique en nom virtuel */ filename[0] = i + 'A'; filename[1] = ':'; filename[2] = '\\'; strcpy (filename + 3, nptr + len); return (filename); } } /* Pas trouve d'unite virtuelle */ return (NULL); } void t_label (void) { FILE *fptr; Rlabel rlabel; long record_old = 0L; long record_new = 0L; struct stat st; char filename[82]; if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "r+b")) == NULL) return; while (fread (&rlabel, sizeof (Rlabel), 1, fptr)) { if (*rlabel.nomfic) { int vdisk; vdisk = rlabel.nomfic[0] - 'A'; strcpy (filename, PATH[vdisk]); strcat (filename, rlabel.nomfic + 3); if (stat (long_filename(NULL, filename), &st) == 0) { if (record_old != record_new) { fseek (fptr, record_new, 0); fwrite (&rlabel, sizeof (Rlabel), 1, fptr); } record_new += sizeof (Rlabel); } } record_old += sizeof (Rlabel); fseek (fptr, record_old, 0); } /* Cleans the rest of the file */ memset (&rlabel, 0, sizeof (Rlabel)); while (record_new < record_old) { fseek (fptr, record_new, 0); fwrite (&rlabel, sizeof (Rlabel), 1, fptr); record_new += sizeof (Rlabel); } fclose (fptr); } void w_label (char *nomfic, char *label) { int nouveau; long record = 0L; long record_free = -1L; FILE *fptr; Rlabel rlabel; bullist rmess; char *ptr = vir_path (nomfic); /* Pas de nom virtuel ... Pas de mise a jour ! */ if (ptr == NULL) return; if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "r+b")) == NULL) { if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "wb")) == NULL) return; fclose (fptr); if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "r+b")) == NULL) { return; } } nouveau = 1; while (fread (&rlabel, sizeof (Rlabel), 1, fptr)) { if (*(rlabel.nomfic) == '\0') record_free = record; else if (strncmp (ptr, rlabel.nomfic, LABEL_FIC - 1) == 0) { record_free = record; nouveau = 0; break; } record += (long) sizeof (Rlabel); } if (record_free >= 0L) fseek (fptr, record_free, 0); if (nouveau) { memset (&rlabel, 0, sizeof (Rlabel)); n_cpy (LABEL_NOM - 1, rlabel.label, label); n_cpy (LABEL_FIC - 1, rlabel.nomfic, ptr); n_cpy (LABEL_OWN - 1, rlabel.owner, pvoie->sta.indicatif.call); rlabel.date_creation = time (NULL); /* Next message number */ rlabel.index = ++nomess; /* Update the message number */ memset (&rmess, 0, sizeof (bullist)); rmess.numero = nomess; ouvre_dir (); write_dir (0, &rmess); ferme_dir (); } else { n_cpy (LABEL_NOM - 1, rlabel.label, label); } fwrite (&rlabel, sizeof (Rlabel), 1, fptr); fclose (fptr); } static void fin_yapp (void) #define DELAY_PROMPT 3 /* environ 3 secondes */ { pvoie->time_trans = time (NULL) - pvoie->time_trans; clear_inbuf (voiecur); time_yapp[voiecur] = DELAY_PROMPT; ch_niv2 (50); } void retour_niveau (void) { if (pvoie->temp1 == N_DOS) { maj_niv (9, 0, 0); } else { maj_niv (N_MBL, 0, 0); pvoie->mbl = 1; } } void retour_appel (void) { int save_voie; if (pvoie->kiss == -2) { pvoie->kiss = CONSOLE; save_voie = voiecur; /* Retour au gateway */ selvoie (pvoie->kiss); texte (T_GAT + 5); maj_niv (N_TELL, 0, 3); /* Remet la voie I/O en attente */ selvoie (save_voie); svoie[voiecur]->sta.connect = 17; maj_niv (0, 0, 0); #ifdef __FBBDOS__ trait (0, " "); #endif } else { retour_niveau (); retour_menu (pvoie->niv1); } } void yapp_message (int numero) { int save_voie; if (pvoie->kiss == -2) { save_voie = voiecur; selvoie (CONSOLE); texte (numero); aff_etat ('E'); send_buf (CONSOLE); selvoie (save_voie); } else { texte (numero); } } static void yapp_timer (void) { if ((pvoie->niv2 == S) || (pvoie->niv2 == S1)) time_yapp[voiecur] = 20; /* 20 s */ else time_yapp[voiecur] = 120; /* 120 s */ } static void sendinit (void) { int nb; uchar buf[20]; /* cprintf("Sendinit\r\n") ; */ pvoie->send_count = 0; buf[0] = ENQ; buf[1] = 1; nb = 2; outs (buf, nb); } void cancel (char *texte) { int nb = strlen (texte); uchar buf[257]; buf[0] = CAN; buf[1] = nb; strcpy (buf + 2, texte); outs (buf, nb + 2); ch_niv2 (CW); fin_yapp (); } /* static void not_ready(char *texte) { int nb = strlen(texte) ; uchar buf[257] ; buf[0] = NAK ; buf[1] = nb ; strcpy(buf + 2, texte) ; outs(buf, nb + 2) ; } */ static void sendeof (void) { uchar buf[2]; buf[0] = ETX; buf[1] = 1; outs (buf, 2); } void sendeot (uchar chck) { uchar buf[2]; buf[0] = EOT; buf[1] = chck; outs (buf, 2); } static void sendinit_retry (void) { uchar buf[2]; if (++pvoie->send_count > 6) { cancel ("Retry count excessive\r"); } else { buf[0] = ENQ; buf[1] = 1; outs (buf, 2); } } long file_size (char *fichier) { struct stat statbuf; if (stat (fichier, &statbuf) != -1) return (statbuf.st_size); return (0L); } static void bin_hdr (char *filename, long filesize) { int nb = 0; int fd; uchar buf[257]; uchar *ptr = buf; union { unsigned long ytime; struct ftime ftime; } fdir; *ptr++ = SOH; ++ptr; strcpy (ptr, filename); while (*ptr++) ++nb; ++nb; sprintf (ptr, "%7ld", filesize); while (*ptr++) ++nb; ++nb; if (pvoie->type_yapp) { /* Yapp Checksum ? */ if ((fd = open (pvoie->sr_fic, O_RDONLY)) != -1) { getftime (fd, &(fdir.ftime)); sprintf (ptr, "%08lX", fdir.ytime); while (*ptr++) ++nb; ++nb; close (fd); } } buf[1] = nb; outs (buf, nb + 2); } static void sendhdr (char *header) { pvoie->tailm = file_size (pvoie->sr_fic); bin_hdr (header, pvoie->tailm); } static void compute_CRC (int ch, int *crc) { int hibit; int shift; for (shift = 0x80; shift; shift >>= 1) { hibit = *crc & 0x8000; *crc <<= 1; *crc |= (ch & shift ? 1 : 0); if (hibit) *crc ^= 0x1021; } } int senddata (unsigned int type) { int fd, mode, retour = 0, nb = 0; int i; int lg_buf = 250; uchar checksum; uchar *uptr; uchar buf[300]; /* * Type = 0 : Ascii * 1 : Binaire * 2 : YAPP */ if (type == 0) mode = O_TEXT; else mode = O_BINARY; if ((fd = open (pvoie->sr_fic, mode | O_RDONLY)) != -1) { pvoie->sr_mem = 1; lseek (fd, pvoie->enrcur, 0); if (type == 2) aff_yapp (voiecur); while (1) { nb = read (fd, buf + 2, lg_buf); if (nb > 0) { pvoie->size_trans += (long) nb; if (type == 2) { buf[0] = STX; buf[1] = (nb == 256) ? 0 : nb; if (pvoie->type_yapp) { uptr = buf + 2; checksum = 0; for (i = 0; i < nb; i++) checksum += *uptr++; *uptr = checksum; outs (buf, nb + 3); } else { outs (buf, nb + 2); } } else { uptr = buf + 2; if (pvoie->type_yapp == 4) { for (i = 0; i < nb; i++) { compute_CRC ((int) *uptr, (int *) &pvoie->checksum); ++uptr; } } outs (buf + 2, nb); } if (pvoie->memoc >= MAXMEM) break; } /* if (eof (fd)) { pvoie->sr_mem = 0; retour = 1; break; } */ else /* EOF or error */ { pvoie->sr_mem = 0; retour = 1; break; } } pvoie->enrcur = tell (fd); close (fd); } else retour = 1; return (retour); } static void ack1 (void) { uchar buf[2]; buf[0] = ACK; buf[1] = 1; outs (buf, 2); pvoie->time_trans = time (NULL); ch_niv2 (RH); } static void ack2 (void) { int i; int nbcar = 0xff & (int) data[1]; uchar buf[2]; /* decoder le header */ while (*indd++) ; pvoie->tailm = atol (indd); while (*indd++) --nbcar; --nbcar; if (nbcar) { /* teste Yapp Chck */ for (i = 0; i < 4; i++) { if (!isxdigit (*indd)) break; ++indd; } pvoie->type_yapp = (i == 4); aff_yapp (voiecur); } buf[0] = ACK; if (pvoie->type_yapp) { buf[1] = ACK; } else { buf[1] = 2; } outs (buf, 2); pvoie->time_trans = time (NULL); ch_niv2 (RD); } static void ack3 (void) { uchar buf[2]; /* le fichier est valide */ buf[0] = ACK; buf[1] = 3; pvoie->xferok = 2; /* pvoie->time_trans = time(NULL) - pvoie->time_trans; */ write_mess_temp (O_BINARY, voiecur); if (test_temp (voiecur)) { rename_temp (voiecur, pvoie->sr_fic); /* Le fichier est mis en place */ wr_dir (pvoie->sr_fic, pvoie->sta.indicatif.call); } outs (buf, 2); ch_niv2 (RH); } static void ack4 (void) { uchar buf[2]; buf[0] = ACK; buf[1] = 4; outs (buf, 2); fin_yapp (); } static void ack5 (void) { uchar buf[2]; buf[0] = ACK; buf[1] = 5; outs (buf, 2); ch_niv2 (CW); } /* static int write_fich(char *fichier, char *texte, int nbcar) { FILE * fd ; if (fd = fopen(fichier, "ab")) { fwrite(texte, nbcar, 1, fd) ; fclose(fd) ; return(1) ; } return(0) ; } */ /* static int write_temp(char *texte, int nbcar) { FILE * fd ; char temp[128]; if (fd = fopen(temp_name(voiecur, temp), "ab")) { fwrite(texte, nbcar, 1, fd) ; fclose(fd) ; return(1) ; } return(0) ; } */ void wrbuf (void) { uchar checksum = 0; int i; int ncars; int ok = 1; int nbcar = (data[1]) ? data[1] & 0xff : 256; uchar *uptr; obuf *msgtemp; char *ptcur; char *ptr; if (pvoie->type_yapp) { uptr = data + 2; for (i = 0; i < nbcar; i++) checksum += *uptr++; if (*uptr != checksum) { cancel ("Checksum error\r"); return; } } #if 0 /* if (write_fich(pvoie->sr_fic, data + 2, nbcar)) { */ if (write_temp (data + 2, nbcar)) { pvoie->enrcur += (long) nbcar; /* cprintf("Recoit paquet de %d octets - Nbtrait = %d\r\n", (int) data[1] & 0xff, nb_trait) ; */ ch_niv2 (RD); } else { cancel ("File write error\r"); } #else pvoie->enrcur += (long) nbcar; pvoie->size_trans += (long) nbcar; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue (sizeof (obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; ptr = data + 2; while (nbcar--) { ++pvoie->memoc; *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue (sizeof (obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } msgtemp->nb_car = ncars; if (pvoie->memoc > MAXMEM) { ok = write_mess_temp (O_BINARY, voiecur); } if (ok) { /* cprintf("Recoit paquet de %d octets - Nbtrait = %d\r\n", (int) data[1] & 0xff, nb_trait) ; */ ch_niv2 (RD); } else { cancel ("File write error\r"); } #endif } static void canwait (void) { } static void canrecd (void) { uchar buf[2]; clear_outbuf (voiecur); buf[0] = ACK; buf[1] = 5; outs (buf, 2); fin_yapp (); } void out_txt (void) { int lg = 0xff & (int) data[1]; if (lg && !svoie[CONSOLE]->sta.connect) { aff_header (voiecur); aff_bas (voiecur, W_RCVT, data + 2, lg); } } static void yapp_xfer (void) { int old_niv2 = pvoie->niv2; pvoie->lignes = -1; /* Pas de pagination */ ch_niv2 (etat[pvoie->niv2][ptype]); yapp_timer (); switch (pvoie->niv2) { case SA: pvoie->finf.download += (int) (pvoie->size_trans / 1024L); fin_yapp (); break; case S: sendinit (); break; case S1: sendinit_retry (); break; case SH: sendhdr (pvoie->appendf); break; case SD: time_yapp[voiecur] = -1; if (pvoie->kiss == -2) init_timout (CONSOLE); if (senddata (2)) { sendeof (); ch_niv2 (SE); } break; case SE: sendeof (); break; case ST: sendeot (1); break; case CW: canwait (); break; case C: canrecd (); break; case E1: ack1 (); break; case E2: ack2 (); break; case E3: ack3 (); break; case E4: ack4 (); break; case E5: ack5 (); break; case E6: wrbuf (); break; case AB: cancel ("Abort\r"); break; case RP: reprise_yapp (); break; case DP: out_txt (); ch_niv2 (old_niv2); break; case RH: break; default: cancel ("Protocol error\r"); break; } aff_yapp (voiecur); } int dir_ok (char *masque) { int n; char temp[80]; #ifdef __linux__ static char chaine[] = "\\*"; #else static char chaine[] = "\\*.*"; #endif strcpy (temp, tot_path (ch_slash (masque), pvoie->dos_path)); n = strlen (temp); if ((n > 3) && (temp[n - 1] == '\\')) temp[n - 1] = '\0'; if (is_dir (temp)) { if (temp[n - 1] == '\\') temp[n - 1] = '\0'; strcat (temp, chaine); } if (findfirst (temp, &(pvoie->dirblk), FA_DIREC)) { texte (T_DOS + 2); return (FALSE); } if (*pvoie->dirblk.ff_name == '.') { findnext (&(pvoie->dirblk)); if (findnext (&(pvoie->dirblk))) { texte (T_DOS + 2); return (FALSE); } } return (TRUE); } static int dir_new_suite (void) { Rlabel rlabel; FILE *fptr; int aff = 0; int lg; char *ptr; char *scan; char cur_dir[80]; pvoie->sr_mem = pvoie->seq = FALSE; /* sprintf(cur_dir, "%c:%s", pvoie->vdisk, pvoie->dos_path); */ if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "rb")) == NULL) return (2); for (; pvoie->vdisk < 9; ++pvoie->vdisk) { if (*PATH[(int)pvoie->vdisk] == '\0') continue; if ((pvoie->vdisk == 8) && (*pvoie->finf.priv == '\0')) continue; if ((pvoie->temp1 == N_YAPP) && (strncmp (YAPPDIR, PATH[(int)pvoie->vdisk], strlen (PATH[(int)pvoie->vdisk])) != 0)) if (pvoie->temp1 == N_YAPP) { ptr = back2slash(PATH[(int)pvoie->vdisk]); if (strncmp (YAPPDIR, ptr, strlen(ptr)) != 0) continue; } sprintf (cur_dir, "%c:%s", pvoie->vdisk + 'A', pvoie->dos_path); lg = strlen (cur_dir); fseek (fptr, pvoie->enrcur, 0); while (fread (&rlabel, sizeof (Rlabel), 1, fptr)) { int ok = 1; if (rlabel.date_creation < pvoie->noenr_menu) ok = 0; else if (strncmp (rlabel.nomfic, cur_dir, lg) != 0) ok = 0; if ((ok) && (findfirst (tot_path (rlabel.nomfic, pvoie->dos_path), &(pvoie->dirblk), 0) == 0)) { ptr = strrchr (rlabel.nomfic, '\\'); if (ptr == NULL) continue; *ptr = '\0'; scan = rlabel.nomfic; ptr = scan + lg - 1; *scan++ = (pvoie->vdisk == 8) ? 'P' : pvoie->vdisk + 'A'; ++scan; if (strlen (ptr) > 1) { while ((*scan++ = *ptr++) != '\0'); } else *(scan + 1) = '\0'; if (strcmp (rlabel.nomfic, pvoie->appendf) != 0) { strcpy (pvoie->appendf, rlabel.nomfic); cr (); if (pvoie->temp1 == N_YAPP) { out ("YAPP:", 5); out (pvoie->appendf + 2, strlen (pvoie->appendf) - 2); } else { out (pvoie->appendf, strlen (pvoie->appendf)); } cr (); /* outln (":", 1); */ } sprintf (varx[0], "%-20s", pvoie->dirblk.ff_name); if ((pvoie->dirblk.ff_attrib & FA_DIREC) != 0) { var_cpy (1, " "); } else { sprintf (varx[1], "%7ld", pvoie->dirblk.ff_fsize); } var_cpy (2, dir_date (pvoie->dirblk.ff_fdate)); *varx[3] = *varx[4] = '\0'; n_cpy (LABEL_NOM, varx[4], rlabel.label); out (" ", 2); texte (T_YAP + 4); aff = 1; } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; pvoie->enrcur = ftell (fptr); fclose (fptr); return (0); } } strcpy (pvoie->dos_path, "\\"); pvoie->enrcur = 0; } fclose (fptr); if (!aff) return (2); return (1); } int dir_new (void) { int fin = 0; switch (pvoie->niv3) { case 0: pvoie->temp3 = pvoie->vdisk; pvoie->cmd_new = 1; pvoie->vdisk = 0; pvoie->noenr_menu = pvoie->finf.lastyap; pvoie->enrcur = 0; *pvoie->appendf = '\0'; strcpy (pvoie->dos_path, "\\"); switch (dir_new_suite ()) { case 2: texte (T_DOS + 2); case 1: fin = 1; break; case 0: ch_niv3 (1); break; } break; case 1: if (dir_new_suite () != 0) fin = 1; break; } if (fin) { pvoie->vdisk = pvoie->temp3; retour_dos (); pvoie->temp3 = 0; pvoie->cmd_new = 0; } pvoie->l_yapp = time (NULL); return (1); } static void aff_liste_labels (Fichier * fichier, char *path, int n) { char *ptr; char *lptr; FILE *fptr; Rlabel rlabel; int i; char chemin[80]; char *path_ptr = vir_path (path); /* for (i = 0; i < n; i++) printf("Fichier={%s} Path={%s} n=%d\n", fichier[i].nom, path, n); */ if (path_ptr) { if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "rb")) != NULL) { while (fread (&rlabel, sizeof (Rlabel), 1, fptr)) { ptr = rlabel.nomfic; n_cpy (79, chemin, ptr); lptr = strrchr (chemin, '\\'); if (lptr == NULL) continue; *(lptr + 1) = '\0'; lptr = strrchr (ptr, '\\'); ++lptr; if (strcmpi (path_ptr, chemin) != 0) continue; for (i = 0; i < n; i++) { if (strcmpi (fichier[i].nom, lptr) == 0) { sprintf (varx[0], "%-20s", fichier[i].nom); if ((fichier[i].attr & FA_DIREC) != 0) { var_cpy (1, " "); } else { sprintf (varx[1], "%7ld", fichier[i].size); } var_cpy (2, dir_date (fichier[i].date)); *varx[3] = *varx[4] = '\0'; n_cpy (LABEL_NOM, varx[4], rlabel.label); texte (T_YAP + 4); fichier[i].nom[0] = '\0'; break; } } } fclose (fptr); } } /* Affiche les fichiers non labelises */ for (i = 0; i < n; i++) { if (*fichier[i].nom) { sprintf (varx[0], "%-20s", fichier[i].nom); if ((fichier[i].attr & FA_DIREC) != 0) { var_cpy (1, " "); } else { sprintf (varx[1], "%7ld", fichier[i].size); } var_cpy (2, dir_date (fichier[i].date)); *varx[3] = *varx[4] = '\0'; texte (T_YAP + 4); } } } #define MAX_FILES 1000 int dir_yapp (char *masque) { int aff = 0; int n; char temp[128]; char *ptr; Fichier *fichier; fichier = (Fichier *) m_alloue (MAX_FILES * sizeof (Fichier)); strcpy (temp, tot_path (ch_slash (masque), pvoie->dos_path)); n = strlen (temp); if ((n > 3) && (temp[n - 1] == '\\')) temp[n - 1] = '\0'; if (is_dir (temp)) { strcat (temp, "\\"); } else { ptr = strrchr (temp, '\\'); if (ptr) *++ptr = '\0'; } if ((*masque == '\0') || (dir_ok (masque))) { n = 0; while (1) { strcpy (fichier[n].nom, pvoie->dirblk.ff_name); fichier[n].size = pvoie->dirblk.ff_fsize; fichier[n].date = pvoie->dirblk.ff_fdate; fichier[n].attr = pvoie->dirblk.ff_attrib; aff = 1; if (++n == MAX_FILES) break; if (findnext (&(pvoie->dirblk))) break; } #ifdef __linux__ ptr = slash2back (temp); #else ptr = temp; #endif aff_liste_labels (fichier, ptr, n); if (!aff) texte (T_DOS + 2); } m_libere (fichier, MAX_FILES * sizeof (Fichier)); return (0); } void yapp (void) { char ptr[256]; char *scan; switch (pvoie->niv2) { case 40: scan = get_nextparam(); if (scan) strcpy (ptr, scan); else #ifdef __linux__ strcpy (ptr, "*"); #else strcpy (ptr, "*.*"); #endif dir_suite (ptr); retour_dir ((YAPPDIR[1] == ':') ? (YAPPDIR[0] - 'A') : getdisk ()); break; case 42: scan = get_nextparam(); if (scan) strcpy (ptr, scan); else #ifdef __linux__ strcpy (ptr, "*"); #else strcpy (ptr, "*.*"); #endif dir_yapp (ptr); retour_dir ((YAPPDIR[1] == ':') ? (YAPPDIR[0] - 'A') : getdisk ()); break; case 43: maj_niv (9, 12, 0); dir_new (); break; case 50: set_binary (voiecur, 0); if (!pvoie->xferok) del_temp (voiecur); else if (pvoie->xferok == 2) { /* ltoa(pvoie->enrcur, varx[0], 10) ; texte(T_DOS + 5) ; */ display_perf (voiecur); } aff_yapp (voiecur); pvoie->xferok = 1; aff_header (voiecur); retour_appel (); break; case 51: var_cpy (0, "YAPP"); new_label (); pvoie->tailm = pvoie->enrcur = 0L; pvoie->size_trans = 0L; ch_niv2 (R); texte (T_YAP + 1); set_binary (voiecur, 1); pvoie->xferok = 0; del_temp (voiecur); yapp_timer (); aff_yapp (voiecur); break; case 52: change_label (); retour_appel (); break; default: yapp_xfer (); break; } } char *nom_yapp (void) { char fichier[MAXPATH], dr[MAXDIR], di[MAXDIR], fi[FBB_NAMELENGTH], ex[MAXEXT]; *fichier = '\0'; *dr = '\0'; *di = '\0'; *fi = '\0'; *ex = '\0'; teste_espace (); n_cpy (MAXPATH, fichier, indd); fichier[strcspn(fichier, "\r")] = 0; // remove input trailing CR if (!tst_point (fichier)) *pvoie->sr_fic = '\0'; else { #ifdef __linux__ strcpy (pvoie->sr_fic, back2slash (tot_path (fichier, pvoie->dos_path))); #else strcpy (pvoie->sr_fic, tot_path (ch_slash (fichier), pvoie->dos_path)); #endif fnsplit (fichier, dr, di, fi, ex); strcpy (pvoie->appendf, fi); strcat (pvoie->appendf, ex); } return (pvoie->sr_fic); } static void change_label (void) { char *ptr; ptr = get_nextparam(); if (ptr) { w_label (pvoie->sr_fic, ptr); cr(); dir_yapp(pvoie->appendf); } } void new_label (void) { while ((*indd) && (!ISPRINT (*indd))) ++indd; w_label (pvoie->sr_fic, sup_ln (indd)); n_cpy (LABEL_NOM - 1, pvoie->label, sup_ln (indd)); } int menu_yapp (void) { struct stat bufstat; char buf[80]; int ok = 1; int c, fd; if (ISGRAPH (*(indd + 1))) return (0); if (pvoie->temp1 != N_DOS) strcpy (pvoie->dos_path, "\\"); var_cpy (0, "YAPP"); limite_commande (); // strupr (sup_ln (indd - 1)); n_cpy (78, buf, indd); c = *indd++; switch (toupper(c)) { case 'D': if ((voiecur == CONSOLE) || ((!P_YAPP (voiecur)) && (!SYS (pvoie->finf.flags)))) { /* ok = 0; */ yapp_message (T_YAP + 2); retour_appel (); break; } #ifdef MULTI if (ymodem_files ()) { ch_niv2 (S); if (pvoie->kiss != -2) texte (T_YAP + 0); pvoie->tailm = pvoie->enrcur = 0L; pvoie->size_trans = 0L; set_binary (voiecur, 1); pvoie->xferok = 1; pvoie->type_yapp = 1; sendinit (); yapp_timer (); aff_yapp (voiecur); } #else if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) != -1) && ((bufstat.st_mode & S_IFREG) != 0)) { ch_niv2 (S); if (pvoie->kiss != -2) texte (T_YAP + 0); pvoie->tailm = pvoie->enrcur = 0L; pvoie->size_trans = 0L; set_binary (voiecur, 1); pvoie->xferok = 1; pvoie->type_yapp = 1; sendinit (); yapp_timer (); aff_yapp (voiecur); } else { /* ok = 0; */ yapp_message (T_ERR + 11); retour_appel (); } #endif break; case 'U': if (!is_room ()) { outln ("*** Disk full !", 15); retour_appel (); break; } if ((voiecur == CONSOLE) || ((!P_YAPP (voiecur)) && (!SYS (pvoie->finf.flags)))) { yapp_message (T_YAP + 2); /* ok = 0; */ retour_appel (); break; } if (read_only ()) { retour_appel (); } else if (!isspace (*indd)) { /* ok = 0; */ yapp_message (T_ERR + 20); retour_appel (); } else { if ((tst_point (indd)) && (stat (nom_yapp (), &bufstat) == -1)) { /* fd = creat (pvoie->sr_fic, S_IREAD | S_IWRITE); */ fd = open (pvoie->sr_fic, O_CREAT | O_WRONLY | O_TRUNC, S_IREAD | S_IWRITE); if (fd > 0) { close (fd); unlink (pvoie->sr_fic); if (pvoie->kiss != -2) { yapp_message (T_YAP + 3); ch_niv2 (51); } else { pvoie->tailm = pvoie->enrcur = 0L; pvoie->size_trans = 0L; ch_niv2 (R); set_binary (voiecur, 1); pvoie->xferok = 0; pvoie->type_yapp = 0; yapp_timer (); aff_yapp (voiecur); } } else { /* ok = 0; */ yapp_message (T_ERR + 30); retour_appel (); } } else { /* ok = 0; */ yapp_message (T_ERR + 23); retour_appel (); } } break; case 'W': ch_niv2 (40); pvoie->noenr_menu = 0L; yapp (); break; case 'N': ch_niv2 (43); pvoie->noenr_menu = pvoie->finf.lastyap; yapp (); pvoie->l_yapp = time (NULL); break; case 'I': ch_niv2 (42); pvoie->noenr_menu = 0L; yapp (); break; case 'L': teste_espace(); if (droits (MODLABEL)) { if (*indd == '\0') { texte (T_ERR + 20); retour_appel (); } else if (!aut_ecr (indd, 0)) { retour_appel (); } else { if (stat (nom_yapp (), &bufstat) != 0) { texte (T_ERR + 11); retour_appel (); } else { texte (T_YAP + 3); ch_niv2 (52); } } } else { /* retour_niveau(); cmd_err(indd - 2) ; */ ok = 0; } break; case 'Z': strcpy (pvoie->appendf, indd); nom_yapp (); if (aut_dir (pvoie->sr_fic, pvoie->sta.indicatif.call)) { if (stat (pvoie->sr_fic, &bufstat) != -1) { if (unlink (pvoie->sr_fic) == 0) texte (T_DOS + 10); else texte (T_ERR + 23); retour_appel (); } else { texte (T_ERR + 11); retour_appel (); } } else { texte (T_ERR + 23); /* ok = 0; */ retour_niveau (); } break; default: /* retour_niveau(); cmd_err(indd - 2) ; */ --indd; ok = 0; break; } if (ok) fbb_log (voiecur, 'Y', buf); return (ok); } fbb-7.0.10/src/error.c0000644000175000017500000000766113613360505011351 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #undef fopen /* * Writes an error message in ERROR.SYS file * * Do not Overlay ! * */ static int error_type = 0; static int erreur = 0; void boot_prg (void) { FILE *fichier; if ((fichier = fopen ("ERROR.SYS", "a+")) != NULL) { #ifdef ENGLISH fprintf (fichier, "> *** System boot on %s *** \n", strdate (time (NULL))); #else fprintf (fichier, "> *** Boot systeme le %s ***\n", strdate (time (NULL))); #endif fclose (fichier); } } void err_alloc (unsigned numero) { fbb_error (ERR_MEMORY, "malloc", numero); } static void fbb_w (unsigned type, char *texte, unsigned numero) { FILE *fichier; int nbfiles = 0; static char *type_error[] = { "WARNING :", "FATAL :", "EXCEPTION :", }; static char *text_error[] = { "Cannot open file", "Cannot create file", "Cannot close file", "Cannot resynchronize TNC", "Not enough memory", "Wrong channel selection", "Wrong procedure level", "Cannot write to file", "Syntax error", "Error communication/TNC", "Pointer already allocated", "XMS/EMS error", "Divide by zero", "Memory exception", }; if (error_type == 1) nbfiles = fbb_fcloseall (); if ((fichier = fopen ("ERROR.SYS", "a+")) != NULL) { fprintf (fichier, "> %s Station %s, Ch:%d (%d-%d-%d) %s\n Version %s (%s)\n", type_error[error_type], pvoie->sta.indicatif.call, voiecur, pvoie->niv1, pvoie->niv2, pvoie->niv3, strdate (time (NULL)), version(), date ()); if (error_type == 1) fprintf (fichier, " %d open files\n", nbfiles); fprintf (fichier, " %s %u, errno %d=%s %s\n\n", texte, numero, erreur, strerror (erreur), text_error[type]); /* #if FBB_DEBUG fbb_printfiles(fichier); if (error_type) { print_stack(numero, fichier); } #endif */ fclose (fichier); } } void fbb_error (unsigned type, char *texte, unsigned numero) { erreur = errno; error_type = 2; fbb_w (type, texte, numero); port_log (0, 0, 'S', "Q *** BBS Quit"); ferme_log (); #ifdef __WINDOWS__ fbb_quit (0); #else sleep (5); exit (0); #endif } void fbb_except (unsigned type, char *texte, unsigned numero) { erreur = errno; error_type = 1; port_log (0, 0, 'S', "Q *** BBS Quit"); fbb_w (type, texte, numero); ferme_log (); } void fbb_warning (unsigned type, char *texte, unsigned numero) { erreur = errno; error_type = 0; fbb_w (type, texte, numero); } void win_message (int temps, char *texte) { #ifdef __WINDOWS__ WinMessage (temps, texte); #endif #ifdef __linux__ WinMessage (temps, texte); #endif #ifdef __FBBDOS__ fen *fen_ptr; deb_io (); fen_ptr = open_win (15, 7, 15 + strlen (texte) + 3, 9, INIT, "message"); _wscroll = 0; cputs (texte); putch ('\a'); _wscroll = 1; sleep_ (temps); close_win (fen_ptr); fin_io (); #endif } void write_error (char *filename) { int i; char text[256]; sprintf (text, "Cannot access to %s", filename); for (i = 0; i < 5; i++) { deb_io (); win_message (2, text); #ifdef __FBBDOS__ putch ('\a'); #endif fin_io (); } fbb_error (ERR_WRITE, filename, 0); } fbb-7.0.10/src/balise.c0000644000175000017500000003356513613360505011461 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * BALISE.C Gestion de la balise * */ #include #define INT14 0x14 #define INT7F 0x7f typedef struct typ_ddes { char indic[8]; long numero; int port; struct typ_ddes *suiv; } Ddes; static Beacon *tete_beacon[NBPORT]; static long current_bcl[NBPORT]; /* Message BCL en cours */ static Ddes *t_ddes[NBPORT]; static char *broadcast_bloc (int); static char *broadcast_line (long); static char *via (char *); static void broadcast_port (int, char *); static void mode_binaire (int); static void send_broadcast (int, char *, int); static void set_beacon (char *, Beacon *); static void set_bcall (char *, indicat *); static void free_beacon (int port) { Beacon *ptemp; Beacon *pb = tete_beacon[port]; while (pb) { ptemp = pb; pb = pb->next; m_libere (ptemp, sizeof (Beacon)); } tete_beacon[port] = NULL; } void end_beacon (void) { int port; for (port = 0; port < NBPORT; port++) free_beacon (port); } static void add_beacon (int port, char *texte) { Beacon *pb = tete_beacon[port]; if (pb) { while (pb->next) { pb = pb->next; } pb->next = (Beacon *) m_alloue (sizeof (Beacon)); pb = pb->next; } else { pb = tete_beacon[port] = (Beacon *) m_alloue (sizeof (Beacon)); } set_beacon (texte, pb); pb->next = NULL; } static void set_bcall (char *callsign, indicat * call_str) { int i = 0; char *ptr = call_str->call; df ("set_bcall", 4); call_str->num = 0; if (callsign == NULL) { *ptr = '\0'; ff (); return; } strupr (callsign); while ((*callsign) && (!isalnum (*callsign))) ++callsign; while (isalnum (*callsign)) if (i++ < 6) *ptr++ = *callsign++; *ptr = '\0'; while ((*callsign) && (!isdigit (*callsign))) ++callsign; i = 0; while (isdigit (*callsign)) { i *= 10; i += (*callsign++ - '0'); } if ((i >= 0) && (i <= 15)) call_str->num = i; ff (); } static void set_beacon (char *path, Beacon * beacon) { int i = 0; char *ptr; beacon->nb_digi = 0; ptr = strtok (path, " ,\r\n"); set_bcall (ptr, &beacon->desti); ptr = strtok (NULL, " ,\r\n"); if (ptr) { strupr (ptr); if (((strlen (ptr) == 1) && (*ptr == 'V')) || ((strlen (ptr) == 3) && (strcmp (ptr, "VIA") == 0))) { ptr = strtok (NULL, " ,\r\n"); } } for (i = 0; i < 8; i++) { if (ptr) ++beacon->nb_digi; set_bcall (ptr, &beacon->digi[i]); ptr = strtok (NULL, " ,\r\n"); } } static void aff_ui (int port, char *line) { int nbcar; nbcar = strlen (line); put_ui (line, W_CNST, nbcar); } void dde_synchro (char *indic, long num, int port) { Ddes *ptemp; char line[80]; sprintf (line, "[%d] Broadcast SYNC #%ld asked fm %s", port, num, indic); aff_ui (port, line); if (p_port[port].moport & 0x20) { if (t_ddes[port]) { ptemp = t_ddes[port]; while (ptemp->suiv) ptemp = ptemp->suiv; ptemp->suiv = (Ddes *) m_alloue (sizeof (Ddes)); ptemp = ptemp->suiv; } else { ptemp = t_ddes[port] = (Ddes *) m_alloue (sizeof (Ddes)); } ptemp->suiv = NULL; strn_cpy (6, ptemp->indic, indic); ptemp->numero = num; ptemp->port = port; } else { sprintf (line, "[%d] Port %d not allowed for unproto lists !", port, port); aff_ui (port, line); } } void send_balise (int port) { static int first = 1; FILE *fptr; char *ptr; char sbuffer[600]; int c, var, nb, pos = 0; int maxcar; int debut = 1; Beacon *pb; df ("send_balise", 1); aff_etat ('B'); if (first) { first = 0; for (nb = 0; nb < NBPORT; nb++) { t_ddes[nb] = NULL; tete_beacon[nb] = NULL; current_bcl[nb] = nomess; } } free_beacon (port); if (p_port[port].pvalid) { sprintf (sbuffer, "BEACON%d.SYS", port); if ((fptr = fopen (c_disque (sbuffer), "rt")) != NULL) { maxcar = p_port[port].beacon_paclen; if (maxcar == 0) maxcar = 128; nb = 0; vlang = 0; /* langue primaire */ var = FALSE; ptr = NULL; while (1) { if (var) { if (*ptr) { sbuffer[nb] = *ptr++; nb++; } else var = FALSE; } else { if ((c = fgetc (fptr)) == EOF) break; if ((pos == 0) && (c == '%')) { fscanf (fptr, "%d", &t_balise[port]); t_balise[port] *= 60; fgetc (fptr); } else if ((pos == 0) && (c == '!')) { fgets (sbuffer, 80, fptr); add_beacon (port, sbuffer); nb = 0; } else { if (tete_beacon[port] == NULL) { strcpy(sbuffer, "MAIL"); add_beacon (port, sbuffer); } if ((debut) && (p_port[port].moport & 0x20)) { if (current_bcl[port] == nomess) { sprintf (sbuffer, "%-6ld !!\r", nomess); send_broadcast (port, sbuffer, strlen (sbuffer)); } debut = 0; } ++pos; if (c == '$') { if ((c = fgetc (fptr)) == EOF) break; ptr = variable (c); var = TRUE; } else if (c == '%') { if ((c = fgetc (fptr)) == EOF) break; ptr = alt_variable (c); var = TRUE; } else { if (c == '\n') { sbuffer[nb] = '\r'; ++nb; pos = 0; } else if (c != '\r') { sbuffer[nb] = c; nb++; } } } } if (nb == maxcar) { for (pb = tete_beacon[port]; pb ; pb = pb->next) { snd_drv (port, UNPROTO, sbuffer, nb, pb); } nb = 0; } } ferme (fptr, 12); if (nb) { for (pb = tete_beacon[port]; pb ; pb = pb->next) { snd_drv (port, UNPROTO, sbuffer, nb, pb); } } } } ff (); } static char *via (char *bbsv) { int lg = 0; static char buffer[40]; char *ptr = buffer; if (*bbsv) { *ptr++ = '@'; ++lg; } while (isalnum (*bbsv)) { *ptr++ = *bbsv++; if (++lg == 7) break; } while (lg++ < 7) *ptr++ = ' '; *ptr = '\0'; return (buffer); } static void send_broadcast (int port, char *buffer, int len) { indicat sav_beacon; Beacon *pb = tete_beacon[port]; if ((len == 0) || (*buffer == '\0')) return; while (pb) { sav_beacon = pb->desti; strcpy (pb->desti.call, "FBB"); pb->desti.num = 0; snd_drv (port, UNPROTO, buffer, len, pb); pb->desti = sav_beacon; pb = pb->next; } } void broadcast_port (int port, char *chaine) { int len; int lt; char bloc[256]; char tampon[90]; char *optr; int maxcar = p_port[port].pk_t; if (maxcar == 0) maxcar = 128; *bloc = '\0'; len = 0; while (*chaine) { optr = tampon; lt = 0; for (;;) { *optr++ = *chaine; ++lt; if ((*chaine++ == '\r') || (lt == 89)) { break; } } *optr = '\0'; if ((len + lt) > maxcar) { if (*bloc) { send_broadcast (port, bloc, len); *bloc = '\0'; len = 0; } else { send_broadcast (port, tampon, lt); *tampon = '\0'; lt = 0; } } strcat (bloc, tampon); len += lt; } send_broadcast (port, bloc, len); } static char *broadcast_line (long numero) { static char sbuffer[90]; char titre[40]; bullist bull; bullist *sav; int ok = 0; sav = ptmes; ptmes = • if (ch_record (NULL, numero, '\0')) { ok = 1; } if (ok && (strcmp (ptmes->desti, "KILL") == 0)) ok = 0; if (ok && (strcmp (ptmes->desti, "WP") == 0)) ok = 0; if (ok && (ptmes->type == 'A') && (!ack_unproto)) ok = 0; if (ok && (ptmes->type != 'B')) { if ((*ptmes->bbsv == '\0') && (!priv_unproto)) ok = 0; } if (ok && (ptmes->type != 'B')) { if ((*ptmes->bbsv) && (!via_unproto)) ok = 0; } if (ok && ((ptmes->status == 'A') || (ptmes->status == 'K'))) ok = 0; if (ok) { if ((mute_unproto) && (ptmes->type == 'P')) strcpy (titre, "***"); else n_cpy (34, titre, ptmes->titre); sprintf (sbuffer, "%-6ld %c %6ld %-6s%s %-6s %s %s\r", ptmes->numero, ptmes->type, (ptmes->taille > 1000000L) ? 999999L : ptmes->taille, ptmes->desti, via (ptmes->bbsv), ptmes->exped, date_mbl (ptmes->date), titre); } else sprintf (sbuffer, "%-6ld #\r", numero); ptmes = sav; return (sbuffer); } static char *broadcast_bloc (int port) { FILE *fptr; info frec; int back_mess = 0; int offset; long dde_bcl; char *ptr; Ddes *ptemp; ind_noeud *exp; bloc_mess *bptr; mess_noeud *mptr; unsigned num_indic; bullist bul; static char beacon_buffer[256]; char line[80]; *beacon_buffer = '\0'; *line = '\0'; while (t_ddes[port]) { /* Demande de synchro */ dde_bcl = t_ddes[port]->numero; if ((nomess - dde_bcl) > nb_unproto) dde_bcl = nomess - nb_unproto; else back_mess = 1; /* cherche les prives eventuels et envoie le premier ... */ exp = insnoeud (t_ddes[port]->indic, &num_indic); if (exp->coord != 0xffff) { fptr = ouvre_nomenc (); fseek (fptr, (long) exp->coord * sizeof (frec), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 79); if (!UNP (frec.flags)) { sprintf (beacon_buffer, "%-6ld / %s\r", current_bcl[port], t_ddes[port]->indic); sprintf (line, "[%d] U Flag not set for %s, stopped !", port, t_ddes[port]->indic); aff_ui (port, line); back_mess = 1; } else { if (nomess <= dde_bcl) { sprintf (beacon_buffer, "%-6ld !!\r", nomess); sprintf (line, "[%d] %s asked %ld, end of list %ld !", port, t_ddes[port]->indic, dde_bcl, nomess); aff_ui (port, line); back_mess = 1; } else { ouvre_dir (); bptr = tete_dir; offset = 0; if (dde_bcl < current_bcl[port]) { current_bcl[port] = dde_bcl; } sprintf (line, "[%d] %s allowed, resync to %ld", port, t_ddes[port]->indic, current_bcl[port]); aff_ui (port, line); while (bptr) { mptr = &(bptr->st_mess[offset]); if ((mptr->noenr) && (mptr->no_indic == num_indic)) { read_dir (mptr->noenr, &bul); /* if ((bul.status != 'K') && (bul.status != 'H') && (bul.status != 'A')) { */ if (bul.status == 'N') { if ((bul.numero > t_ddes[port]->numero) && (bul.numero <= current_bcl[port])) { sprintf (line, "[%d] %s unread private %ld", port, t_ddes[port]->indic, bul.numero - 1); aff_ui (port, line); sprintf (beacon_buffer, "%-6ld ! %s\r", bul.numero - 1, t_ddes[port]->indic); ptr = broadcast_line (bul.numero); strcat (beacon_buffer, ptr); back_mess = 1; break; } } } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } ferme_dir (); } } } else { sprintf (line, "[%d] Unknown callsign %s, stopped !", port, t_ddes[port]->indic); aff_ui (port, line); sprintf (beacon_buffer, "%-6ld / %s\r", current_bcl[port], t_ddes[port]->indic); back_mess = 1; } if (back_mess == 0) { sprintf (line, "[%d] %s, end of list %ld", port, t_ddes[port]->indic, current_bcl[port]); aff_ui (port, line); sprintf (beacon_buffer, "%-6ld ! %s\r", current_bcl[port], t_ddes[port]->indic); } ptemp = t_ddes[port]; t_ddes[port] = t_ddes[port]->suiv; m_libere (ptemp, sizeof (Ddes)); } if (back_mess == 0) { for (;;) { if (current_bcl[port] == nomess) break; ptr = broadcast_line (current_bcl[port] + 1); if ((strlen (beacon_buffer) + strlen (ptr)) > 250) { break; } strcat (beacon_buffer, ptr); ++current_bcl[port]; } } return (beacon_buffer); } void broadcast_list (void) { int port; char *ptr; df ("broadcast_list", 0); for (port = 1; port < NBPORT; port++) { if ((p_port[port].pvalid) && (p_port[port].moport & 0x20)) { if ((t_ddes[port] == NULL) && (current_bcl[port] == nomess)) continue; ptr = broadcast_bloc (port); if (*ptr == '\0') { ff (); return; } broadcast_port (port, ptr); } } ff (); } static void mode_binaire (int voie) { if (svoie[voie]->binary == 0) { clear_inbuf (voie); time_yapp[voie] = -1; set_binary(voie, 1); } } void send_bin_message (void) { switch (pvoie->niv3) { case 5: env_message (); break; case 6: if (bin_message (pvoie->t_read) == 0) { ch_niv3 (5); env_message (); } break; } if (pvoie->niv3 == 2) { retour_mbl (); pvoie->temp1 = -2; } } void send_binary_mess (void) { long no; long seek_offset; int nb = 0; bullist *pbul; rd_list *ptemp = NULL; init_fb_mess (voiecur); incindd (); pvoie->fbb = 1; if ((no = lit_chiffre (0)) != 0) { seek_offset = 0L; if (*indd == '!') { ++indd; pvoie->fbb = 2; seek_offset = lit_chiffre (0); } if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_read = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->pmess = &(pvoie->fb_mess[nb]); ptemp->suite = NULL; ptemp->nmess = no; ptemp->verb = 1; if ((pbul = ch_record (NULL, no, 'Y')) != NULL) { if (droit_ok (pbul, 1)) { pvoie->fb_mess[nb] = *pbul; pvoie->fb_mess[nb].taille = seek_offset; } else { ptemp->verb = 0; } } else { ptemp->verb = 0; } } mode_binaire (voiecur); pvoie->enrcur = 0L; maj_niv (N_RBIN, 0, 5); send_bin_message (); pvoie->temp1 = -2; /* Demande la suppression des messages apres envoi */ } fbb-7.0.10/src/nomenc.c0000644000175000017500000002612613613360505011474 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE NOMENC.C */ #include static int ecrire_indic (tri *, int); static void affich_nom (info *); static void menu_nomenclature (void); static void fin_liste_indic (void); static void parcours_liste (void); static void affich_indic (info * pinfo) { int i = 0; char s[40]; sprintf (varx[0], "%-6s-%d", pinfo->indic.call, pinfo->indic.num); texte (T_NOM + 3); if (*(pinfo->relai[i].call)) { out ("via ", 4); while ((i < 8) && *(pinfo->relai[i].call)) { if (i == 4) out ("$W ", 6); sprintf (s, " %-6s-%d", pinfo->relai[i].call, pinfo->relai[i].num); out (s, strlen (s)); ++i; } out ("$W", 2); } } static void affich_coord (info * pinfo) { affich_indic (pinfo); affich_nom (pinfo); ptmes->date = pinfo->hcon; texte (T_NOM + 4); } static void affich_nom (info * pinfo) { var_cpy (0, pinfo->nom); var_cpy (1, pinfo->prenom); var_cpy (2, pinfo->adres); var_cpy (3, pinfo->ville); var_cpy (4, pinfo->qra); var_cpy (5, pinfo->teld); var_cpy (6, pinfo->telp); var_cpy (7, pinfo->home); var_cpy (8, pinfo->zip); texte (T_NOM + 5); } static void rech_nomenc (void) { unsigned r; FILE *fptr; info buf_info; *varx[0] = '\0'; if (*indd == '\0') { texte (T_NOM + 3); } else { if (find (sup_ln (indd))) { if ((r = chercoord (indd)) == 0xffff) { var_cpy (0, indd); texte (T_NOM + 13); } else { fptr = ouvre_nomenc (); fseek (fptr, (long) r * sizeof (info), 0); fread ((char *) &buf_info, sizeof (info), 1, fptr); ferme (fptr, 11); affich_coord (&buf_info); } maj_niv (5, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { var_cpy (0, indd); texte (T_NOM + 13); maj_niv (5, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } } } static void lit_coord (unsigned record, info * frec) { FILE *fptr; fptr = ouvre_nomenc (); fseek (fptr, (long) record * sizeof (info), 0); fread (frec, sizeof (info), 1, fptr); ferme (fptr, 39); } static void ecrit_coord (unsigned record, info * frec) { FILE *fptr; if (record == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, (long) record * sizeof (info), 0); fwrite (frec, sizeof (info), 1, fptr); ferme (fptr, 39); } static void modif_nomenc (void) { unsigned num_indic; int err = 0; info frec; char c; char s[80]; char temp[80]; char *ptr; char *scan; if (read_only ()) { prompt (pvoie->finf.flags, pvoie->niv1); maj_niv (5, 0, 0); return; } if (pvoie->niv3 > 1) lit_coord (pvoie->emis->coord, &frec); switch (pvoie->niv3) { case 0: incindd (); if ((*indd) && (droits (COSYSOP))) { if (find (sup_ln (indd))) { pvoie->emis = insnoeud (indd, &num_indic); if (pvoie->emis->coord == 0xffff) err = 1; } else err = 1; if (err) { var_cpy (0, indd); texte (T_NOM + 13); prompt (pvoie->finf.flags, pvoie->niv1); maj_niv (5, 0, 0); return; } } else { pvoie->emis = pvoie->ncur; } lit_coord (pvoie->emis->coord, &frec); affich_nom (&frec); texte (T_QST + 1); ch_niv3 (1); break; case 1: c = toupper (*indd); if (c == Oui) { /* majinfo(voiecur, 1) ; */ texte (T_MBL + 9); ch_niv3 (2); } else if ((c == 'A') || (c == 'F') || (c == Non)) { maj_niv (5, 0, 0); incindd (); menu_nomenclature (); } else { texte (T_ERR + 0); texte (T_QST + 1); } break; case 2: if (ISGRAPH (*indd)) { epure (frec.prenom, 12); scan = frec.prenom; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } } texte (T_NOM + 6); ch_niv3 (3); break; case 3: if (ISGRAPH (*indd)) epure (frec.nom, 17); texte (T_NOM + 7); ch_niv3 (4); break; case 4: if (ISGRAPH (*indd)) epure (frec.adres, 60); texte (T_MBL + 54); ch_niv3 (5); break; case 5: if (ISGRAPH (*indd)) { epure (frec.zip, 8); scan = frec.zip; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } } texte (T_NOM + 8); ch_niv3 (6); break; case 6: if (ISGRAPH (*indd)) epure (frec.ville, 30); texte (T_NOM + 9); ch_niv3 (7); break; case 7: if (ISGRAPH (*indd)) epure (frec.teld, 12); texte (T_NOM + 10); ch_niv3 (8); break; case 8: if (ISGRAPH (*indd)) epure (frec.telp, 12); texte (T_MBL + 53); ch_niv3 (9); break; case 9: if (ISGRAPH (*indd)) { strupr (epure (s, 40)); ptr = strchr (s, '.'); if (ptr) *ptr = '\0'; ptr = strchr (s, '-'); if (ptr) { *ptr = '\0'; } strcpy (temp, s); if (find (temp)) { strcpy (frec.home, s); texte (T_NOM + 11); ch_niv3 (10); } else { texte (T_ERR + 7); texte (T_MBL + 53); } } else { texte (T_NOM + 11); ch_niv3 (10); } break; case 10: if (ISGRAPH (*indd)) { strupr (epure (s, 6)); if (tstqra (s)) { strcpy (frec.qra, s); ecrit_coord (pvoie->emis->coord, &frec); } else { texte (T_NOM + 11); break; } } user_wp (&frec); texte (T_QST + 2); prompt (pvoie->finf.flags, pvoie->niv1); maj_niv (5, 0, 0); break; default: fbb_error (ERR_NIVEAU, "MODIF-NOMENC", pvoie->niv3); break; } if (pvoie->niv3 > 2) { ecrit_coord (pvoie->emis->coord, &frec); if (pvoie->emis == pvoie->ncur) pvoie->finf = frec; } } /* * LISTE DES INDICATIFS */ static void fin_liste_indic (void) { itoa (pvoie->temp1, varx[0], 10); texte (T_NOM + 12); } int ecrire_indic (tri * inf_ptr, int nb) /* * en sortie : vrai si l'indicatif a ete ecrit * faux sinon */ { char s[81]; bloc_indic *temp; int ind, val; int i, j, pos = 0; for (i = 0; i < nb; i++) { ind = 0; val = inf_ptr->pos; if (val == 0) break; temp = racine; while ((ind + T_BLOC_INFO) <= val) { ind += T_BLOC_INFO; temp = temp->suiv; } j = val - ind; sprintf (s, "%-6s ", temp->st_ind[j].indic); out (s, strlen (s)); if (++pos == 11) { pos = 0; out ("\n", 1); } ++inf_ptr; } return (TRUE); } static void parcours_liste (void) { bloc_indic *bptr; tri *inf_ptr = NULL, *pos_ptr = NULL; unsigned offset; unsigned num_indic; int pass; int nb = 0; tri t_ptr; pvoie->temp1 = 0; for (pass = 0; pass <= 1; ++pass) { bptr = racine; offset = num_indic = 0; if (pass == 0) pos_ptr = &t_ptr; while (bptr) { if (*(bptr->st_ind[offset].indic) == '\0') break; if (bptr->st_ind[offset].coord != 0xffff) { if (bptr->st_ind[offset].val) { if (strmatch (bptr->st_ind[offset].indic, indd)) { if (pass) { pos_ptr->pos = num_indic; n_cpy (6, pos_ptr->ind, bptr->st_ind[offset].indic); ++pos_ptr; } ++nb; } } } if (++offset == T_BLOC_INFO) { offset = 0; bptr = bptr->suiv; } ++num_indic; } if (nb == 0) break; if (pass == 0) { pvoie->temp1 = nb; pos_ptr = inf_ptr = (tri *) m_alloue (nb * sizeof (tri)); nb = 0; } } if (nb) qsort ((void *) inf_ptr, (size_t) nb, (size_t) sizeof (tri), (int (*)(const void *, const void *)) strcmp); ecrire_indic (inf_ptr, nb); if (nb) m_libere (inf_ptr, nb * sizeof (tri)); } void liste_indic (void) { pvoie->temp2 = pvoie->temp1 = 0; strupr (sup_ln (indd)); if (*indd == '\0') { *indd = '*'; *(indd + 1) = '\0'; } parcours_liste (); fin_liste_indic (); retour_menu (pvoie->niv1); } void saisie_infos (void) { int change = 0; char s[80]; char temp[80]; char *ptr; char *scan; switch (pvoie->niv3) { case 0: break; case 1: if (ISGRAPH (*indd)) { epure (pvoie->finf.prenom, 12); scan = pvoie->finf.prenom; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } change = 1; } break; case 2: if (ISGRAPH (*indd)) { epure (pvoie->finf.ville, 30); change = 1; } break; case 3: if (ISGRAPH (*indd)) { strupr (epure (s, 40)); /* Seul l'indicatif est enregistre */ ptr = strchr (s, '.'); if (ptr) *ptr = '\0'; ptr = strchr (s, '-'); if (ptr) { *ptr = '\0'; } strcpy (temp, s); if (find (temp)) { strcpy (pvoie->finf.home, extend_bbs (s)); } else { texte (T_ERR + 7); } change = 1; } break; case 4: if (ISGRAPH (*indd)) { epure (pvoie->finf.zip, 8); scan = pvoie->finf.zip; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } change = 1; } break; default: fbb_error (ERR_NIVEAU, "SAISIE-INFO", pvoie->niv3); break; } if (*pvoie->finf.prenom == '\0') { texte (T_MBL + 9); ch_niv3 (1); } else if (*pvoie->finf.ville == '\0') { texte (T_NOM + 8); ch_niv3 (2); } else if (*pvoie->finf.home == '\0') { texte (T_MBL + 53); ch_niv3 (3); } else if (*pvoie->finf.zip == '\0') { texte (T_MBL + 54); ch_niv3 (4); } else { if (change) { if (pvoie->ncur) { ecrit_coord (pvoie->ncur->coord, &pvoie->finf); user_wp (&pvoie->finf); } texte (T_QST + 2); } finentete (); ptr = pvoie->sta.indicatif.call; if (pvoie->sniv1 == N_CONF) { pvoie->niv1 = pvoie->sniv1; pvoie->niv2 = pvoie->sniv2; pvoie->niv3 = pvoie->sniv3; pvoie->conf = 1; } else { maj_niv (N_MBL, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } } } /* * MENUS - PREMIER NIVEAU NOMENCLATURE */ static void menu_nomenclature (void) { int error = 0; char com[80]; limite_commande (); sup_ln (indd); while (*indd && (!ISGRAPH (*indd))) indd++; strn_cpy (70, com, indd); switch (toupper (*indd)) { case 'N': maj_niv (5, 1, 0); modif_nomenc (); break; case 'R': maj_niv (5, 3, 0); incindd (); rech_nomenc (); break; case 'I': maj_niv (5, 4, 0); incindd (); liste_indic (); break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; case 'F': maj_niv (0, 1, 0); incindd (); choix (); break; case '\0': prompt (pvoie->finf.flags, pvoie->niv1); break; default: if (!defaut ()) error = 1; break; } if (error) { cmd_err (indd); } } void nomenclature (void) { switch (pvoie->niv2) { case 0: menu_nomenclature (); break; case 1: modif_nomenc (); break; case 3: rech_nomenc (); break; case 4: liste_indic (); break; case 5: saisie_infos (); break; default: fbb_error (ERR_NIVEAU, "NOMENC", pvoie->niv2); break; } } fbb-7.0.10/src/modem.c0000644000175000017500000005061013613360505011311 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE MODEM */ #include #include #ifdef __linux__ #include #include #include #include #include #endif static int ok_pass_modem (void); static void init_md (void) { buf_md.ptr_r = buf_md.ptr_l = buf_md.ptr_a = 0; buf_md.buf_vide = 1; buf_md.nblig = 0; buf_md.nbcar = 0; buf_md.flush = 0; } int md_send (int port, char *chaine) { int ctrl = 0; char c; df ("md_send", 2); while ((c = *chaine++) != 0) { switch (c) { case '~': deb_io (); #if defined(__WINDOWS__) || defined(__linux__) WinMSleep (500); #endif #ifdef __FBBDOS__ tempo = 10; /* #pragma warn -eff */ while (tempo); /* #pragma warn .eff */ #endif fin_io (); break; case '^': ctrl = 1; break; default: if (ctrl) { c -= '@'; ctrl = 0; } #ifdef __FBBDOS__ { RSEGS rsegs; BufReel[0] = c; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.CX = 1; rsegs.DX = (int) p_port[port].ccom - 1; rsegs.DI = 0; rsegs.ES = BufSeg; rsegs.DS = BufSeg; while (rsegs.CX) { rsegs.AX = 0x0a00; int14real (&rsegs); } } #else send_tnc (port, c); #endif break; } ff (); } return (1); } static void md_etoiles (int voie) { int port = no_port (voie); #ifdef __linux__ struct termios tty; defcom *ptrcom = &p_com[(int)p_port[port].ccom]; tcgetattr (ptrcom->comfd, &tty); tty.c_lflag &= ~ECHO; tty.c_lflag |= ECHONL; tcsetattr (ptrcom->comfd, TCSANOW, &tty); #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { defcom *ptrcom = &p_com[p_port[port].ccom]; #ifdef __WIN32__ int val = 2; sta_drv (voie, ECHOCMD, (void *) &val); #else if (EscapeCommFunction (ptrcom->comfd, SETSTAR) < 0) ShowError ("Driver error", "Unknown command :", SETSTAR); #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0c01; int14real (&rsegs); } #endif } void md_echo (int voie) { #ifdef __linux__ int port = no_port (voie); struct termios tty; defcom *ptrcom = &p_com[(int)p_port[port].ccom]; tcgetattr (ptrcom->comfd, &tty); tty.c_lflag |= ECHO; tcsetattr (ptrcom->comfd, TCSANOW, &tty); #endif } void md_no_echo (int voie) { modem_no_echo (no_port (voie)); } void modem_no_echo (int port) { #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { defcom *ptrcom = &p_com[p_port[port].ccom]; #ifdef __WIN32__ int val = 0; sta_drv (port, ECHOCMD, (void *) &val); #else if (EscapeCommFunction (ptrcom->comfd, CLRECHO) < 0) ShowError ("Driver error", "Unknown command :", CLRECHO); #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0c02; int14real (&rsegs); } #endif } void init_modem (int port) { #ifdef __linux__ if (BIOS (port) == P_LINUX) { struct termios tty; int comfd; initcom_linux (p_port[port].ccom); default_tty (p_port[port].ccom); comfd = p_com[(int)p_port[port].ccom].comfd; tcflow (comfd, TCOON); tcgetattr (comfd, &tty); tty.c_iflag = (IGNBRK | IXON | IXOFF | ICRNL); tty.c_oflag = (ONLCR | OPOST); tty.c_lflag = (ICANON | ECHO); tty.c_cflag |= (CREAD | CRTSCTS); tty.c_cc[2] = '\b'; tcsetattr (comfd, TCSANOW, &tty); } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { #ifdef __WIN32__ SetModemLine (port, 1); #else defcom *ptrcom = &p_com[p_port[port].ccom]; initcom_windows (p_port[port].ccom, INQUE, OUTQUE, XON | CTS); if (EscapeCommFunction (ptrcom->comfd, SETDTR) < 0) ShowError ("Driver error", "Unknown command :", SETDTR); if (EscapeCommFunction (ptrcom->comfd, SETRTS) < 0) ShowError ("Driver error", "Unknown command :", SETRTS); #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0e00; int14real (&rsegs); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0900 | (p_com[p_port[port].ccom].options & 0xff); int14real (&rsegs); } #endif } void modem_stop (int port) { #ifdef __linux__ { int comfd = p_com[(int)p_port[port].ccom].comfd; tcflow (comfd, TCOOFF); } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { #ifdef __WIN32__ SetModemLine (port, 0); #else defcom *ptrcom = &p_com[p_port[port].ccom]; if (EscapeCommFunction (ptrcom->comfd, CLRDTR) < 0) ShowError ("Driver error", "Unknown command :", CLRDTR); if (EscapeCommFunction (ptrcom->comfd, CLRRTS) < 0) ShowError ("Driver error", "Unknown command :", CLRRTS); #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0500; int14real (&rsegs); } #endif } void modem_start (int port) { char s[80]; FILE *fpinit; #ifdef __FBBDOS__ RSEGS rsegs; fen *fen_ptr; #endif if (save_fic) return; #ifdef ENGLISH sprintf (s, "Modem Port %d Set-up", port); #else sprintf (s, " Init modem port %d ", port); #endif #ifdef __FBBDOS__ fen_ptr = open_win (4, 2, 50, 8, INIT, s); #endif #ifdef __linux__ if (BIOS (port) == P_LINUX) { struct termios tty; int comfd; initcom_linux (p_port[port].ccom); default_tty (p_port[port].ccom); comfd = p_com[(int)p_port[port].ccom].comfd; tcgetattr (comfd, &tty); tty.c_iflag = (IGNBRK | IXON | IXOFF | ICRNL); tty.c_oflag = (ONLCR | OPOST); tty.c_lflag = (ICANON | ECHO); tty.c_cflag |= (CREAD | CRTSCTS); tty.c_cc[2] = '\b'; tcsetattr (comfd, TCSANOW, &tty); } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { #ifdef __WIN32__ SetModemLine (port, 1); #else /* Initialisation du modem */ initcom_windows (p_port[port].ccom, INQUE, OUTQUE, XON | DSR); #endif } #endif #ifdef __FBBDOS__ { memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0e00; int14real (&rsegs); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0900 | (p_com[p_port[port].ccom].options & 0xff); int14real (&rsegs); modem_no_echo (port); rsegs.DX = port - 1; rsegs.AX = 0x0600; int14real (&rsegs); /* Initialisation du modem */ initcom_combios (p_port[port].ccom); } #endif sprintf (s, "INITTNC%d.SYS", port); if ((fpinit = fopen (c_disque (s), "rb")) != NULL) { while (fgets (s, 80, fpinit)) { sup_ln (s); if ((*s) && (*s != '#')) { tnc_commande (port, s, PORTCMD); } } ferme (fpinit, 2); } #ifdef __FBBDOS__ close_win (fen_ptr); #endif } void md_reset (int voie) { #ifdef __WINDOWS__ int port = no_port (voie); xmodem_off (voie); if (BIOS (port) == P_WINDOWS) { /* Initialisation du modem */ /* initcom_windows(p_port[port].ccom); */ } #endif #ifdef __FBBDOS__ int port = no_port (voie); xmodem_off (voie); { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0900 | (p_com[p_port[port].ccom].options & 0xff); int14real (&rsegs); } #endif } void md_defaut (int voie) { int port = no_port (voie); #ifdef __linux__ if (BIOS (port) == P_LINUX) { struct termios tty; defcom *ptrcom = &p_com[(int)p_port[port].ccom]; /* Revalide l'echo ... */ tcgetattr (ptrcom->comfd, &tty); tty.c_lflag = ICANON | ECHO; tcsetattr (ptrcom->comfd, TCSANOW, &tty); } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { defcom *ptrcom = &p_com[p_port[port].ccom]; #ifdef __WIN32__ int val = 1; sta_drv (voie, ECHOCMD, (void *) &val); #else if (EscapeCommFunction (ptrcom->comfd, SETECHO) < 0) ShowError ("Driver error", "Unknown command :", SETECHO); #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.DX = (int) p_port[port].ccom - 1; rsegs.AX = 0x0d03; int14real (&rsegs); } #endif } int modem_vide (int voie) { int nbtot; int port = no_port (voie); #ifdef __linux__ if (BIOS (port) == P_LINUX) { defcom *ptrcom = &p_com[(int)p_port[port].ccom]; ioctl (ptrcom->comfd, TIOCOUTQ, &nbtot); } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { #ifdef __WIN32__ int total; GetModemStat (no_port (voie), &total, &nbtot); #else COMSTAT cstat; defcom *ptrcom = &p_com[p_port[port].ccom]; GetCommError (ptrcom->comfd, &cstat); nbtot = cstat.cbOutQue; #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); rsegs.CX = 0; rsegs.DX = (int) p_port[port].ccom - 1; rsegs.DI = 0; rsegs.ES = BufSeg; rsegs.DS = BufSeg; rsegs.AX = 0x0a00; int14real (&rsegs); nbtot = (int) ((rsegs.BX >> 8) - (rsegs.BX & 0xff)); } #endif return (nbtot == 0); } void md_inbuf (int voie, char *ptr, int nb) /* Entree de caracteres dans le buffer modem */ { in_buf (voie, ptr, nb); #ifdef __linux__ { defcom *ptrcom = &p_com[(int)p_port[port].ccom]; struct termios tty; /* Revalide l'echo ... */ tcgetattr (ptrcom->comfd, &tty); if ((tty.c_lflag & ECHO) == 0) { tty.c_lflag = ECHO; tcsetattr (ptrcom->comfd, TCSANOW, &tty); } } #endif } int md_busy (char *ptr, int nb) /* test de lignes recues */ { ptr[nb] = '\0'; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; ptr[250] = '\0'; if ((strstr (ptr, "NO CARRIER")) || (strstr (ptr, "BUSY")) || (strstr (ptr, "VOICE")) || (strstr (ptr, "ERROR")) || (strstr (ptr, "NO ANSWER")) || (strstr (ptr, "NO DIALTONE"))) { return (1); } return (0); } void connect_modem (int voie) { df ("connect_modem", 1); init_timout (voie); init_md (); connect_fen (); svoie[voie]->ncur = NULL; svoie[voie]->aut_linked = 1; svoie[voie]->log = 1; svoie[voie]->sta.stat = svoie[voie]->sta.connect = 4; svoie[voie]->deconnect = FALSE; svoie[voie]->private_dir = 0; svoie[voie]->ret = 0; svoie[voie]->sid = 0; svoie[voie]->pack = 0; svoie[voie]->read_only = 0; svoie[voie]->vdisk = 2; svoie[voie]->tstat = svoie[voie]->debut = time (NULL); svoie[voie]->nb_err = svoie[voie]->seq = svoie[voie]->stop = svoie[voie]->sr_mem = 0; svoie[voie]->tmach = 0L; svoie[voie]->l_mess = 0L; svoie[voie]->l_yapp = 0L; svoie[voie]->sta.ack = 0; svoie[voie]->maj_ok = 0; svoie[voie]->ch_mon = svoie[voie]->cross_connect = -1; svoie[voie]->conf = 0; set_binary (voie, 0); svoie[voie]->msg_held = 0; svoie[voie]->mess_recu = svoie[voie]->xferok = 1; svoie[voie]->mbl = 1; svoie[voie]->entmes.numero = 0L; svoie[voie]->entmes.theme = 0; svoie[voie]->finf.lang = langue[0]->numlang; svoie[voie]->r_tete = NULL; svoie[voie]->mode = 0; svoie[voie]->rev_mode = 1; svoie[voie]->mbl_ext = 1; svoie[voie]->nb_egal = 0; svoie[voie]->paclen = p_port[no_port (voie)].pk_t; if (fbb_fwd) svoie[voie]->mode |= F_NFW; curseur (); if (svoie[voie]->niv1 == 0) { strcpy (svoie[voie]->sta.indicatif.call, "MODEM"); svoie[voie]->sta.indicatif.num = '\0'; svoie[voie]->niv1 = N_MOD; svoie[voie]->niv2 = 0; svoie[voie]->niv3 = 0; } else { if (svoie[voie]->curfwd) svoie[voie]->curfwd->no_con = 8; connect_log (voie, " {MODEM}"); if (cher_noeud (svoie[voie]->sta.indicatif.call)) { connexion (voie); new_om = nouveau (voie); /* getvoie(voie)->mode = getvoie(voie)->finf.flags ; */ svoie[voie]->mode = 0; if (fbb_fwd) { svoie[voie]->mode |= F_NFW; } } } aff_nbsta (); #ifdef __WINDOWS__ window_connect (voie); #endif change_droits (voie); strcpy (svoie[voie]->dos_path, "\\"); aff_event (voie, 1); ff (); return; } void deconnect_modem (int voie) { int port; long temps; if (DEBUG) return; port = no_port (voie); /* Attend que le buffer soit vide */ #ifdef __linux__ { int tempo = 100; /* attend 10s le vidage du modem */ while (!modem_vide (voie)) { WinMSleep (50); if (tempo > 0) --tempo; if (tempo == 0) break; } } #endif #ifdef __WINDOWS__ { int tempo = 100; /* attend 10s le vidage du modem */ while (!modem_vide (voie)) { WinMSleep (50); if (tempo > 0) --tempo; if (tempo == 0) break; } WinMSleep (500); } #endif #ifdef __FBBDOS__ tempo = 180; /* attend 10s le vidage du modem */ while (!modem_vide (voie)) { if (tempo == 0) break; } sleep_ (1); #endif modem_stop (port); modem_no_echo (port); temps = time (NULL) + 2; #ifdef __linux__ if (BIOS (port) == P_LINUX) { defcom *ptrcom = &p_com[(int)p_port[port].ccom]; if (ptrcom->comfd < 0) return; /* Attend la descente du DCD */ for (;;) { int mcs; ioctl (ptrcom->comfd, TIOCMGET, &mcs); if (mcs & TIOCM_CAR) { if (time (NULL) > temps) { md_send (port, "~~~+++~~~ATH0^M"); break; } } else break; } } #endif #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) { defcom *ptrcom = &p_com[p_port[port].ccom]; if (ptrcom->comfd < 0) return; #ifdef __WIN32__ while (GetModemDCD (port)) { if (time (NULL) > temps) { md_send (port, "~~~+++~~~ATH0^M"); break; } } #else while (GetCommStatus (ptrcom->comfd) & 0x80) { if (time (NULL) > temps) { md_send (port, "~~~+++~~~ATH0^M"); break; } } #endif } #endif #ifdef __FBBDOS__ { RSEGS rsegs; memset (&rsegs, 0, sizeof (RSEGS)); do { rsegs.AX = 0x300; rsegs.DX = (int) p_port[port].ccom - 1; int14real (&rsegs); if ((time (NULL) > temps) && (rsegs.AX & 0x80)) { if (!getvoie (CONSOLE)->sta.connect) cprintf ("\r\nModem time-out\r\n"); md_send (port, "~~~+++~~~ATH0^M"); break; } } while (rsegs.AX & 0x80); } #endif svoie[voie]->niv1 = svoie[voie]->niv2 = svoie[voie]->niv3 = 0; svoie[voie]->timout = time_n; ff (); } void re_init_modem (int voie) { int port; if (DEBUG) return; df ("re_init_modem", 1); port = no_port (voie); modem_start (port); ff (); } void accueil_modem (void) { bipper (); md_defaut (voiecur); cr (); pvoie->lignes = -1; p_port[no_port (voiecur)].echo = TRUE; if (!outfich (c_disque ("LANG\\MODEM.ENT"))) out ("$W$O BBS. Phone access$W$W", 25); fprintf (stderr, "%s", (c_disque ("LANG\\MODEM.ENT"))); out ("Callsign :", 10); pvoie->temp1 = pvoie->temp2 = 0; pvoie->maj_ok = 0; pvoie->l_mess = 0L; pvoie->l_yapp = 0L; pvoie->read_only = 0; ch_niv2 (1); } #define READ_ONLY_0 "\rThe callsign \"%s\" is not registered.\rYou have a read-only access.\rYou may leave a message to SYSOP.\r\rGo on anyway (Y/N) " #define READ_ONLY_1 "\rThere is no password for \"%s\".\rYou have a read-only access.\rYou may leave a message to SYSOP.\r\r" static void read_only_alert (int mode, char *callsign) { char chaine[256]; pvoie->read_only = 1; switch (mode) { case 0: sprintf (chaine, READ_ONLY_0, callsign); break; case 1: sprintf (chaine, READ_ONLY_1, callsign); break; } out (chaine, strlen (chaine)); aff_etat ('E'); send_buf (voiecur); } void indic_modem (void) { int i, rejet = 0, dde_call = 0; char chaine[128]; char *st; indd[40] = '\0'; while ((*indd) && (!isgraph (*indd))) ++indd; if (*indd == '.') { pvoie->temp2 = 1; p_port[no_port (voiecur)].echo = FALSE; ++indd; } if (pvoie->read_only) { if (toupper (*indd) == 'Y') { if (cher_noeud (pvoie->sta.indicatif.call)) { *pvoie->passwd = '\0'; pvoie->mode = 0; if (fbb_fwd) { pvoie->mode |= F_NFW; } connexion (voiecur); #ifdef __WINDOWS__ window_connect (voiecur); #endif change_droits (voiecur); new_om = nouveau (voiecur); } else { init_info (&pvoie->finf, &pvoie->sta.indicatif); strn_cpy (6, pvoie->sta.indicatif.call, "MODEM"); pvoie->read_only = 1; *pvoie->passwd = '\0'; connexion (voiecur); strcpy (pvoie->finf.prenom, "..."); pvoie->droits = d_droits; } cr (); init_langue (voiecur); st = idnt_fwd (); outs (st, strlen (st)); texte (T_MES + 2); finentete (); retour_mbl (); } else { pvoie->temp1 = pvoie->temp2 = 0; p_port[no_port (voiecur)].echo = TRUE; pvoie->read_only = 0; md_echo (voiecur); out ("\rCallsign :", 11); } strcpy (pvoie->dos_path, "\\"); return; } if (*indd == '\0') { md_echo (voiecur); out ("Callsign :", 10); return; } if ((strncmp (indd, "CONNECT", 7) == 0) || (strncmp (indd, "CARRIER", 7) == 0) || (strncmp (indd, "PROTOCO", 7) == 0) || (strncmp (indd, "COMPRES", 7) == 0)) { return; } ++pvoie->temp1; sup_ln (indd); if (!find (indd)) { sprintf (chaine, "Invalid callsign \"%s\" !", indd); outln (chaine, strlen (chaine)); md_echo (voiecur); if (pvoie->temp1 == 10) rejet = 1; else dde_call = 1; pvoie->temp2 = 0; p_port[no_port (voiecur)].echo = TRUE; } else { strn_cpy (6, pvoie->sta.indicatif.call, indd); pvoie->sta.indicatif.num = 0; for (i = 0; i < 8; i++) *(pvoie->sta.relais[i].call) = '\0'; connect_log (voiecur, " {MODEM}"); if (cher_noeud (pvoie->sta.indicatif.call)) { *pvoie->passwd = '\0'; /* pvoie->mode = pvoie->finf.flags ; */ pvoie->mode = 0; if (fbb_fwd) { pvoie->mode |= F_NFW; /* if (bin_fwd) pvoie->mode |= F_BIN ; */ } connexion (voiecur); new_om = nouveau (voiecur); #ifdef __WINDOWS__ window_connect (voiecur); #endif change_droits (voiecur); strcpy (pvoie->dos_path, "\\"); if (MOD (pvoie->finf.flags)) { if (*pvoie->finf.pass) { ch_niv2 (2); out ("Password :", 10); pvoie->temp1 = 0; md_etoiles (voiecur); } else { read_only_alert (1, indd); md_echo (voiecur); maj_niv (0, 0, 0); premier_niveau (); } } else if (pvoie->temp1 == 5) rejet = 1; else { if (P_READ (voiecur)) { read_only_alert (0, indd); return; } else { sprintf (chaine, "Invalid callsign \"%s\" !", indd); outln (chaine, strlen (chaine)); md_echo (voiecur); dde_call = 1; } } } else if (pvoie->temp1 == 5) rejet = 1; else { if (P_READ (voiecur)) { if (pvoie->temp1 == 10) rejet = 1; else { read_only_alert (0, indd); return; } } else { sprintf (chaine, "Unregistered callsign \"%s\" !", indd); outln (chaine, strlen (chaine)); md_echo (voiecur); dde_call = 1; } } } if (rejet) { outln ("Sorry, you are not a registered user ! ", 42); outln ("Disconnected", 12); md_echo (voiecur); pvoie->deconnect = 4; pvoie->maj_ok = 0; } if (dde_call) { pvoie->read_only = 0; md_echo (voiecur); out ("Callsign :", 10); } } void passwd_modem (void) { while ((*indd) && (!isgraph (*indd))) ++indd; indd[20] = '\0'; if (++pvoie->temp1 == 3) { outln ("Password error !", 16); outln ("Disconnected", 12); md_echo (voiecur); pvoie->deconnect = 5; pvoie->maj_ok = 0; } else if (ok_pass_modem ()) { if (pvoie->temp2) md_no_echo (voiecur); /* else md_echo(voiecur); */ else md_echo (voiecur); if (!pvoie->read_only) outln ("$WLogon Ok. Type NP to change password.$W", 41); maj_niv (0, 0, 0); premier_niveau (); } else { out ("Password :", 10); md_etoiles (voiecur); } } int ok_pass_modem (void) { if (pvoie->read_only) return (1); return (strncmp (pvoie->finf.pass, strupr (sup_ln (indd)), 12) == 0); } void passwd_change (void) { while_space (); switch (pvoie->niv3) { case 0: if (ok_pass_modem ()) { out ("Enter new password :", 20); ch_niv3 (1); } else { outln ("Password error !", 16); retour_menu (N_MBL); } break; case 1: strn_cpy (12, pvoie->ch_temp, sup_ln (indd)); out ("Once more :", 12); ch_niv3 (2); break; case 2: strupr (sup_ln (indd)); if (strcmp (pvoie->ch_temp, indd) == 0) { strn_cpy (12, pvoie->finf.pass, indd); majinfo (voiecur, 2); md_echo (voiecur); } else outln ("Password error !", 16); md_echo (voiecur); retour_menu (N_MBL); break; } } fbb-7.0.10/src/mbl_stat.c0000644000175000017500000002140113615603431012011 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module status BBS */ extern Desc *desc; static char *intf (int port) { static char interf[10]; switch (p_com[(int)p_port[port].ccom].combios) { case 1: strcpy (interf, "ESS/COM."); break; case 2: strcpy (interf, "BPQ-HOST"); break; case 3: strcpy (interf, "FBBIOS "); break; case 4: strcpy (interf, "DRSI "); break; case 5: strcpy (interf, "TFPCR "); break; case 6: strcpy (interf, "WINDOWS "); break; case 7: strcpy (interf, "ETHERNET"); break; case 8: strcpy (interf, "TFWIN "); break; case 9: strcpy (interf, "LINUX "); break; default: strcpy (interf, "??? "); break; } return (interf); } static char *mode_port (int port) { static char mode[10]; int val; int i; char *ptr = mode; for (i = 0; i < 5; i++) *ptr++ = ' '; *ptr = '\0'; val = p_port[port].moport; ptr = mode; if (val & 0x01) *ptr++ = 'G'; else if (val & 0x02) *ptr++ = 'B'; else *ptr++ = 'U'; if (val & 0x04) *ptr++ = 'Y'; if (val & 0x08) *ptr++ = 'M'; if (val & 0x10) *ptr++ = 'W'; if (val & 0x20) *ptr++ = 'L'; return (mode); } static char *typort (int port) { static char protocole[10]; if (p_com[(int)p_port[port].ccom].combios == 3) { /* Modem */ strcpy (protocole, "FBBIOS"); } else { switch (p_port[port].typort) { case TYP_DED: strcpy (protocole, "WA8DED"); break; case TYP_PK: strcpy (protocole, "PK232 "); break; case TYP_KAM: strcpy (protocole, "KAM "); break; case TYP_BPQ: strcpy (protocole, "BPQ "); break; case TYP_MOD: strcpy (protocole, "MODEM "); break; case TYP_TCP: strcpy (protocole, "TCP-IP"); break; case TYP_SCK: strcpy (protocole, "S_AX25"); break; case TYP_AGW: strcpy (protocole, "AGW-PE"); break; case TYP_ETH: strcpy (protocole, "ETHER "); break; case TYP_HST: strcpy (protocole, "PTC-II"); break; case TYP_FLX: strcpy (protocole, "FLEX "); break; default: strcpy (protocole, "??? "); break; } } return (protocole); } #if 0 #ifndef __WINDOWS__ typedef struct { unsigned size; unsigned nb; } bloc; static int sort_function (const void *a, const void *b) { bloc *ab = (bloc *) a; bloc *bb = (bloc *) b; if (ab->size > bb->size) return (1); if (ab->size < bb->size) return (-1); return (0); } #endif #endif void mbl_stat (void) { int i; int ok; int voie; char call[20]; char freq[20]; char ligne[200]; int occ; long tot; int reste; int machine; long temps = time (NULL); cr (); sprintf (ligne, "Software FBB Version %s (%s) compiled on %s", version (), os (), date ()); outln (ligne, strlen (ligne)); sprintf (ligne, "Mem Us:%ld Mem Ok:%ld Bid:%d Lang:%d Ports:%d Ch:%d FBB %s BIN %s", mem_alloue, tot_mem, maxbbid, maxlang, nbport (), NBVOIES - 2, (fbb_fwd) ? "Ok" : "No", (bin_fwd) ? "Ok" : "No" ); outln (ligne, strlen (ligne)); /* #ifndef __DPMI16__ if (high_memory_type () == XMS) { sprintf (ligne, "Free XMS memory = %u KB", xms_free ()); outln (ligne, strlen (ligne)); } #endif */ cr (); occ = 0; tot = 0L; sprintf (ligne, "Available disks : "); out (ligne, strlen (ligne)); for (i = 0; i < 8; i++) { if (*PATH[i]) { sprintf (ligne, "%c: ", i + 'A'); out (ligne, strlen (ligne)); } } cr (); cr (); sprintf (ligne, "%s", typ_exms ()); outln (ligne, strlen (ligne)); cr (); if (*ligne != 'N') { for (i = 0; i < NB_EMS; i++) { if (t_ems[i].flag == 0) continue; ok = 0; if (desc[i].tot_bloc) { sprintf (ligne, " %s : %2d page(s) (%3ld KB)", t_ems[i].ctype, desc[i].tot_bloc, desc[i].size >> 10); occ += desc[i].tot_bloc; tot += desc[i].size; ok = 1; } else { if ((i != HROUTE) || ((i == HROUTE) && (!EMS_WPG_OK ()))) { sprintf (ligne, " %s : Unused", t_ems[i].ctype); ok = 1; } } if (ok) outln (ligne, strlen (ligne)); } sprintf (ligne, " Total :%3d page(s) (%3ld KB)", occ, tot >> 10); outln (ligne, strlen (ligne)); cr (); } sprintf (ligne, "Ch Callsign N1 N2 N3 Cnect Cmput T-Out Used Status Buf Freq" ); outln (ligne, strlen (ligne)); for (voie = 2; voie < NBVOIES; voie++) { occ = 0; reste = 0; machine = 0; if (svoie[voie]->sta.connect) { sprintf (call, "%-6s-%2d", svoie[voie]->sta.indicatif.call, svoie[voie]->sta.indicatif.num); occ = (int) (temps - svoie[voie]->debut); reste = (int) time_att[voie]; machine = (int) svoie[voie]->tmach; } else { continue; } if ((!svoie[voie]->sta.connect) && (DRSI (no_port (voie)))) strcpy (freq, "DRSI"); else if ((!svoie[voie]->sta.connect) && (BPQ (no_port (voie)))) strcpy (freq, "BPQ"); else strcpy (freq, p_port[no_port (voie)].freq); sprintf (ligne, "%02d %s %02d %02d %02d %4d:%02d %2d:%02d %2d:%02d %5d %s %4d %s", voie - 1, call, svoie[voie]->niv1, svoie[voie]->niv2, svoie[voie]->niv3, occ / 60, occ % 60, machine / 60, machine % 60, reste / 60, reste % 60, svoie[voie]->memoc + svoie[voie]->inbuf.nbcar, stat_voie (voie), svoie[voie]->sta.ack, freq ); outln (ligne, strlen (ligne)); } cr (); } void wreq_cfg (FILE * fptr) { int i; int occ; long tot; serlist *lptr; char buffer[256]; fprintf (fptr, "ReqCfg %s BBS\r\n", mycall); fprintf (fptr, "\r\nReqCfg V 1.2 (C) F6FBB 1992 - BBS %s\r\n\r\n", mycall); fprintf (fptr, "\r\nSoftware FBB Version %s (%s) compiled on %s\r\n\r\n", version (), os (), date ()); fprintf (fptr, "\r\nMem Us:%ld Mem Ok:%ld Bid:%d Ports:%d Ch:%d FBB %s BIN %s\r\n\r\n", mem_alloue, tot_mem, maxbbid, nbport (), NBVOIES - 2, (fbb_fwd) ? "Ok" : "No", (bin_fwd) ? "Ok" : "No" ); fprintf (fptr, "Available volumes : "); for (i = 0; i < 8; i++) { if (*PATH[i]) { fprintf (fptr, "%c: ", i + 'A'); } } fprintf (fptr, "\r\n\r\n"); occ = 0; tot = 0L; sprintf (buffer, "%s\r\n\r\n", typ_exms ()); fprintf (fptr, "%s", buffer); if (*buffer != 'N') { for (i = 0; i < NB_EMS; i++) { if (t_ems[i].flag == 0) continue; if (desc[i].tot_bloc) { fprintf (fptr, " %s : %2d page(s) (%3ld KB)\r\n", t_ems[i].ctype, desc[i].tot_bloc, desc[i].size >> 10); occ += desc[i].tot_bloc; tot += desc[i].size; } else if ((i != HROUTE) || ((i == HROUTE) && (!EMS_WPG_OK ()))) { fprintf (fptr, " %s : Unused\r\n", t_ems[i].ctype); } } fprintf (fptr, " Total :%3d page(s) (%3ld KB)\r\n", occ, tot >> 10); } fprintf (fptr, "\r\nLanguages\r\n\r\n"); for (i = 0; i < maxlang; i++) { fprintf (fptr, " %2d : %-10s\n", i + 1, nomlang + i * LG_LANG); } fprintf (fptr, "\r\nServers\r\n\r\n"); lptr = tete_serv; while (lptr) { fprintf (fptr, " %6s : %s\r\n", lptr->nom_serveur, lptr->com_serveur); lptr = lptr->suiv; } fprintf (fptr, "\r\nPort Interface Emulat. Ch Mode Frequency\r\n"); for (port = 1; port < NBPORT; port++) { if (!p_port[port].pvalid) continue; fprintf (fptr, "%d %s %s %-2d %s %s\r\n", port, intf (port), typort (port), p_port[port].nb_voies, mode_port (port), p_port[port].freq); } } int req_cfg (char *filename) { FILE *fptr; char buffer[256]; char sender[80]; char route[80]; fptr = fopen (filename, "rt"); /* Open the received message */ if (fptr == NULL) return (1); fgets (buffer, 80, fptr); /* Read the command line */ sscanf (buffer, "%*s %*s %*s %s\n", sender); *route = '\0'; fgets (buffer, 80, fptr); /* Read the subject */ strupr (buffer); /* Capitalize */ sscanf (buffer, "%*[^@\n]%[^\n]", route); /* Scan route */ fclose (fptr); /* All needed is read */ fptr = fappend (MAILIN, "b"); if (fptr == NULL) return (1); fprintf (fptr, "#\r\n"); /* Tell that this is a message from this BBS */ fprintf (fptr, "SP %s %s < %s\r\n", sender, route, mycall); wreq_cfg (fptr); fprintf (fptr, "\r\n/EX\r\n"); fclose (fptr); return (0); } fbb-7.0.10/src/qraloc.c0000644000175000017500000002612413613360505011474 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include static char qral[7]; #define MILES 1.609 static int tstll (double x) { return ((x > -180) && (x < 180)); } static int end (char *s) { strupr (s); return ((strcmp (s, "Q") == 0) || (strcmp (s, "F") == 0)); } void lonlat (char *qra, double *w, double *l) { *w = 180.0 - ((double) (qra[0] - 'A')) * 20.0 - ((double) (qra[2] - '0')) * 2.0 - ((double) qra[4] - 64.5) / 12.0; *l = -90.0 + ((double) (qra[1] - 'A')) * 10.0 + ((double) (qra[3] - '0')) + ((double) qra[5] - 64.5) / 24.0; } static char *qra_loc (double w, double l) { qral[0] = 'A' + (int) (w = (180 - w) / 20); qral[1] = 'A' + (int) (l = (90 + l) / 10); qral[2] = '0' + (int) (w = (w - floor (w)) * 10); qral[3] = '0' + (int) (l = (l - floor (l)) * 10); qral[4] = 'A' + (int) ((w - floor (w)) * 24); qral[5] = 'A' + (int) ((l - floor (l)) * 24); qral[6] = '\0'; return (qral); } static double dist (double w, double l, double wa, double la) { double x1, y1; y1 = cos (l / DEGRAD) * cos (la / DEGRAD) * cos ((w - wa) / DEGRAD) + sin (l / DEGRAD) * sin (la / DEGRAD); if (y1 > 1) y1 = 1; if (y1 < -1) y1 = -1; x1 = atan (sqrt (1 - y1 * y1) / y1); if (y1 < 0) x1 = 180 / DEGRAD + x1; return (6371.3 * x1); } static double azimut (double w, double l, double wa, double la) { double x1, y1, z1; x1 = dist (w, l, wa, la) / 6371.3; if (x1) { y1 = (sin (la / DEGRAD) - sin (l / DEGRAD) * cos (x1)) / (cos (l / DEGRAD) * sin (x1)); if (y1 > 1) y1 = 1; if (y1 < -1) y1 = -1; z1 = fabs (DEGRAD * atan (sqrt (1 - y1 * y1) / y1)); if (y1 < 0) z1 = 180 - z1; if (sin ((w - wa) / DEGRAD) < 0) z1 = 360 - z1; return (z1); } else return (0); } #if 0 double litllat (chaine) char *chaine; { char ligne[81]; char *scan = chaine, *ptr = ligne; char Sud, Est; double temp; Sud = *(langue[vlang]->plang[T_DEB + 7 - 1]); Est = *(langue[vlang]->plang[T_DEB + 8 - 1]); /* Nord = *(langue[vlang]->plang[T_DEB+6-1]) ; Ouest = *(langue[vlang]->plang[T_DEB+9-1]) ; */ while (isdigit (*scan) || (*scan == '.') || (*scan == ',')) { if (*scan == ',') *scan = '.'; *ptr++ = *scan++; } *ptr = '\0'; temp = atof (ligne); while (*scan && !ISGRAPH (*scan)) scan++; if (toupper (*scan) == 'G') { temp *= 0.9; while (ISGRAPH (*scan)) ++scan; } else { if (toupper (*scan) == 'D') { while (ISGRAPH (*scan)) ++scan; while (*scan && !ISGRAPH (*scan)) ++scan; ptr = ligne; if (isdigit (*scan)) { while (isdigit (*scan) || (*scan == '.') || (*scan == ',')) { if (*scan == ',') *scan = '.'; *ptr++ = *scan++; } *ptr = '\0'; temp += (atof (ligne) / 60.0); while (*scan && !ISGRAPH (*scan)) scan++; if (*scan == '\'') ++scan; } } else return (1000.0); } if (!tstll (temp)) return (1000.0); while (*scan && !ISGRAPH (*scan)) ++scan; if ((toupper (*scan) == Est) || (toupper (*scan) == Sud)) temp = -temp; else if ((toupper (*scan) != Oui) && (toupper (*scan) != Non)) return (1000.0); return (temp); } #endif static double litllat (char *chaine, int mode) { int deg, min, sec, grade = 1; char ctemp; char *scan = chaine; char Nord = 'N', Sud = 'S', Est = 'E', Ouest = 'W'; double temp; if (mode) { /* longitude */ Nord = *(langue[vlang]->plang[T_DEB + 6 - 1]); Sud = *(langue[vlang]->plang[T_DEB + 7 - 1]); } else { /* Lattitude */ Est = *(langue[vlang]->plang[T_DEB + 8 - 1]); Ouest = *(langue[vlang]->plang[T_DEB + 9 - 1]); } while (*scan) { if (*scan == ',') *scan = '.'; if (*scan == ':') grade = 0; scan++; } if (grade) { if (sscanf (chaine, "%lg %c", &temp, &ctemp) != 2) return (1000.0); temp *= 0.9; } else { if (sscanf (chaine, "%d:%d:%d %c", °, &min, &sec, &ctemp) != 4) return (1000.0); if ((deg > 180) || (min >= 60) || (sec >= 60)) return (1000.0); temp = (double) deg + (double) min / 60.0 + (double) sec / 3600.0; } if (!tstll (temp)) return (1000.0); ctemp = toupper (ctemp); if (mode) { if (ctemp == Sud) temp = -temp; else if (ctemp != Nord) temp = (1000.0); } else { if (ctemp == Est) temp = -temp; else if (ctemp != Ouest) temp = (1000.0); } return (temp); } static void longla (void) { double w, l, wdeg, wmn, ldeg, lmn; char s[81], longi[6], latit[6]; switch (pvoie->niv3) { case 0: texte (T_QRA + 3); maj_niv (2, 1, 1); break; case 1: epure (s, 7); if (tstqra (strupr (s))) { lonlat (s, &w, &l); if (w >= 0) n_cpy (5, longi, langue[vlang]->plang[T_DEB + 9 - 1]); else { w = fabs (w); n_cpy (5, longi, langue[vlang]->plang[T_DEB + 8 - 1]); } if (l >= 0) n_cpy (5, latit, langue[vlang]->plang[T_DEB + 6 - 1]); else { l = fabs (l); n_cpy (5, latit, langue[vlang]->plang[T_DEB + 7 - 1]); } wmn = modf (w, &wdeg) * 60.0; if (wmn >= 59.5) { wmn = 0; wdeg++; } w /= 0.9; lmn = modf (l, &ldeg) * 60.0; if (lmn >= 59.5) { lmn = 0; ldeg++; } l /= 0.9; texte (T_QRA + 4); sprintf (varx[0], "%3.0f", wdeg); sprintf (varx[1], "%02.0f", wmn); var_cpy (2, longi); sprintf (varx[3], "%5.1f", w); texte (T_QRA + 5); sprintf (varx[0], "%3.0f", ldeg); sprintf (varx[1], "%02.0f", lmn); var_cpy (2, latit); sprintf (varx[3], "%5.1f", l); texte (T_QRA + 6); maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else if (end (s)) { maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 3); } break; default: fbb_error (ERR_NIVEAU, "LONG-LATT", pvoie->niv3); break; } } static void calcul_qra (void) { double l; char s[81]; switch (pvoie->niv3) { case 0: texte (T_QRA + 7); texte (T_QRA + 8); maj_niv (2, 2, 1); break; case 1: epure (s, 80); if ((pvoie->w = litllat (s, 0)) != 1000.0) { texte (T_QRA + 9); maj_niv (2, 2, 2); } else if (end (s)) { maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 7); texte (T_QRA + 8); } break; case 2: epure (s, 80); if ((l = litllat (s, 1)) != 1000.0) { var_cpy (0, qra_loc (pvoie->w, l)); texte (T_QRA + 10); maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else if (end (s)) { maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 9); } break; default: fbb_error (ERR_NIVEAU, "COMPUT-QRA", pvoie->niv3); break; } } static void disazi (void) { char s[81]; double d, wa, la, azim, deg, mn; switch (pvoie->niv3) { case 0: texte (T_QRA + 11); maj_niv (2, 3, 1); break; case 1: epure (s, 7); if (tstqra (strupr (s))) { lonlat (s, &(pvoie->w), &(pvoie->l)); texte (T_QRA + 12); maj_niv (2, 3, 2); } else if (end (s)) { maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 11); } break; case 2: epure (s, 7); if (tstqra (strupr (s))) { lonlat (s, &wa, &la); azim = azimut (pvoie->w, pvoie->l, wa, la); mn = modf (azim, °) * 60.0; if (mn >= 59.5) { mn = 0; deg++; } azim /= 0.9; d = dist (pvoie->w, pvoie->l, wa, la); sprintf (varx[0], "%1.1f", d); sprintf (varx[1], "%1.1f", d / MILES); texte (T_QRA + 14); sprintf (varx[0], "%1.0f", deg); sprintf (varx[1], "%1.0f", mn); sprintf (varx[2], "%1.1f", azim); texte (T_QRA + 13); maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else if (end (s)) { maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 12); } break; default: fbb_error (ERR_NIVEAU, "DIST-AZIM", pvoie->niv3); break; } } static void cumul_disazi (void) { char s[81]; double wa, la, azim, deg, mn, d; switch (pvoie->niv3) { case 0: texte (T_QRA + 15); maj_niv (2, 4, 1); break; case 1: epure (s, 7); if (tstqra (strupr (s))) { lonlat (s, &(pvoie->w), &(pvoie->l)); texte (T_QRA + 16); maj_niv (2, 4, 2); } else if (end (s)) { maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 15); } break; case 2: epure (s, 7); if (tstqra (strupr (s))) { lonlat (s, &wa, &la); azim = azimut (pvoie->w, pvoie->l, wa, la); mn = modf (azim, °) * 60.0; if (mn >= 59.5) { mn = 0; deg++; } azim /= 0.9; d = dist (pvoie->w, pvoie->l, wa, la); if (d == 0.) d = 1.; sprintf (varx[0], "%1.1f", d); sprintf (varx[1], "%1.1f", d / MILES); texte (T_QRA + 14); pvoie->noenr_menu++; pvoie->cumul_dist += d; ltoa (pvoie->noenr_menu, varx[0], 10); sprintf (varx[1], "%1.0f", pvoie->cumul_dist); sprintf (varx[2], "%1.0f", pvoie->cumul_dist / MILES); texte (T_QRA + 17); texte (T_QRA + 16); } else { if (end (s)) { texte (T_QRA + 18); maj_niv (2, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QRA + 17); texte (T_QRA + 16); } } break; default: fbb_error (ERR_NIVEAU, "CUMUL-DISAZI", pvoie->niv3); break; } } static void menu_qraloc (void) { int error = 0; char com[80]; limite_commande (); while (*indd && (!ISGRAPH (*indd))) indd++; strn_cpy (70, com, indd); switch (toupper (*indd)) { case 'Q': maj_niv (2, 1, 0); longla (); break; case 'L': maj_niv (2, 2, 0); calcul_qra (); break; case 'D': maj_niv (2, 3, 0); disazi (); break; case 'C': pvoie->noenr_menu = 0; pvoie->cumul_dist = 0.0; maj_niv (2, 4, 0); cumul_disazi (); break; case 'F': maj_niv (0, 1, 0); incindd (); choix (); break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; case '\0': prompt (pvoie->finf.flags, pvoie->niv1); break; default: if (!defaut ()) error = 1; break; } if (error) { cmd_err (indd); } } void qraloc (void) { switch (pvoie->niv2) { case 0: menu_qraloc (); break; case 1: longla (); break; case 2: calcul_qra (); break; case 3: disazi (); break; case 4: cumul_disazi (); break; default: fbb_error (ERR_NIVEAU, "QRA-LOC", pvoie->niv2); break; } } fbb-7.0.10/src/tncio.c0000644000175000017500000010721613657545532011346 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE TNCIO.C : ENTREES-SORTIE */ #include #include #define INT10 0x10 static void clear_marque (int); static void aff_bas_suite (int, int, char *, int); #ifndef dump_core static void dump_data (char *title, FILE * fptr, char *ptr, int len) { int i; int j; fprintf (fptr, "\r\nDump of %s\r\n", title); for (i = 0; i < len; i += 16) { fprintf (fptr, "%05d ", i); for (j = 0; j < 16; j++) { if ((i + j) < len) fprintf (fptr, "%02x ", ptr[i + j] & 0xff); else fprintf (fptr, " "); } for (j = 0; j < 16; j++) { if ((i + j) < len) fprintf (fptr, "%c", (ptr[i + j] >= 0x20) ? ptr[i + j] : '.'); } fprintf (fptr, "\r\n"); } } void dump_core (void) { time_t temps = time (NULL); struct tm *tm = localtime (&temps); FILE *fptr = fopen ("debug.bug", "ab"); if (!fptr) return; fprintf (fptr, "\r\n\r\nOn %02d/%02d %02d:%02d:%02d\r\n\r\n", tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); fprintf (fptr, "Channel %d\r\n\r\n", voiecur - 1); wreq_cfg (fptr); dump_data ("svoie", fptr, (char *) svoie[voiecur], sizeof (Svoie)); fclose (fptr); /* *((char *)NULL) = 0; */ exit (999); } #endif #ifdef __WINDOWS__ void BWinSleep (int temps) { long cur; long fin; long ncur; temps /= 50; if (temps == 0) temps = 1; cur = btime (); fin = cur + (long) temps; for (;;) { deb_io (); ncur = btime (); if (ncur > fin) break; fin_io (); } } #endif int aff_ok(int voie) { if (svoie[voie]->binary) return 0; if (voie == CONSOLE) return 0; if ((voie == INEXPORT) && !aff_inexport) return 0; if (POP(no_port(voie)) && !aff_popsmtp) return 0; return 1; } static void outbuf (int mod, char *si, int nb) { obuf *optr = pvoie->outptr; char *ptr, *sv, *debut; int nbout, c, ncars, var = 0, fin_buf = 0, nbbuf = 0; /* * mod = 0 : sans variables * mod = 1 : avec variables * mod = 2 : sans variables + cr * mod = 3 : avec variables + cr */ df ("outbuf", 4); if (optr) { while (optr->suiv) { optr = optr->suiv; ++nbbuf; } } else { int i; pvoie->memoc += 250; optr = (obuf *) m_alloue (sizeof (obuf)); pvoie->outptr = optr; optr->nb_car = optr->no_car = 0; for (i = 0; i < NB_MARQUES; i++) optr->marque[i] = -1; optr->suiv = NULL; } ncars = optr->nb_car; ptr = optr->buffer + ncars; nbout = 0; debut = ptr; for (;;) { if (nb == 0) { if (mod & 2) { c = '\r'; mod = 0; } else break; } else { nb--; c = *si++; } if ((c == '\r') && (!pvoie->binary)) pvoie->ret = TRUE; else if ((c == '\n') && (!pvoie->binary)) { if (!pvoie->ret) c = '\r'; else continue; } else pvoie->ret = FALSE; if ((var == 1) && (c == 'W')) { c = '\r'; var = 0; } if (var == 1) { var = 0; sv = variable (c); while (*sv) { if (ncars == 250) { int i; pvoie->memoc += 250; if ((nbout) && aff_ok(voiecur)) { deb_io (); aff_bas (voiecur, W_SNDT, debut, nbout); fin_io (); } optr->nb_car = ncars; optr->suiv = (obuf *) m_alloue (sizeof (obuf)); optr = optr->suiv; optr->nb_car = optr->no_car = ncars = 0; for (i = 0; i < NB_MARQUES; i++) optr->marque[i] = -1; optr->suiv = NULL; ptr = optr->buffer; nbout = 0; debut = ptr; ++nbbuf; } ++ncars; ++nbout; *ptr++ = *sv++; } if (fin_buf) ncars = 250; } else if (var == 2) { var = 0; sv = alt_variable (c); while (*sv) { if (ncars == 250) { int i; pvoie->memoc += 250; if ((nbout) && aff_ok(voiecur)) { deb_io (); aff_bas (voiecur, W_SNDT, debut, nbout); fin_io (); } optr->nb_car = ncars; optr->suiv = (obuf *) m_alloue (sizeof (obuf)); optr = optr->suiv; optr->nb_car = optr->no_car = ncars = 0; for (i = 0; i < NB_MARQUES; i++) optr->marque[i] = -1; optr->suiv = NULL; ptr = optr->buffer; nbout = 0; debut = ptr; ++nbbuf; } ++ncars; ++nbout; *ptr++ = *sv++; } if (fin_buf) ncars = 250; } else { if ((c == '$') && (mod & 1)) var = 1; else if ((c == '%') && (mod & 1)) var = 2; else { if (ncars == 250) { int i; pvoie->memoc += 250; if ((nbout) && aff_ok(voiecur)) { deb_io (); aff_bas (voiecur, W_SNDT, debut, nbout); fin_io (); } optr->nb_car = ncars; optr->suiv = (obuf *) m_alloue (sizeof (obuf)); optr = optr->suiv; optr->nb_car = optr->no_car = ncars = 0; for (i = 0; i < NB_MARQUES; i++) optr->marque[i] = -1; optr->suiv = NULL; ptr = optr->buffer; nbout = 0; debut = ptr; ++nbbuf; } ++ncars; ++nbout; *ptr++ = c; } } } optr->nb_car = ncars; if (pvoie->dde_int != 2) { if ((ncars) && aff_ok(voiecur)) { deb_io (); aff_bas (voiecur, W_SNDT, debut, nbout); fin_io (); } } ff (); return; } void cr (void) { df ("cr", 0); out ("$W", 2); ff (); return; } void outs (char *si, int nb) { df ("outs", 3); outbuf (0, si, nb); ff (); return; } void out (char *si, int nb) { df ("out", 3); outbuf (1, si, nb); ff (); return; } void outsln (char *si, int nb) { df ("outsln", 3); outbuf (2, si, nb); ff (); return; } void outln (char *si, int nb) { df ("outln", 3); outbuf (3, si, nb); ff (); return; } void marque_obuf (void) { int i; obuf *optr = pvoie->outptr; df ("marque_obuf", 0); if (optr) { while (optr->suiv) { optr = optr->suiv; } for (i = 0; i < NB_MARQUES; i++) { if (optr->marque[i] == -1) optr->marque[i] = optr->nb_car; } } ff (); return; } int get_inbuf (int voie) { ibuf *bufptr = &(svoie[voie]->inbuf); lbuf *ligptr; if ((bufptr->curr == NULL) || (bufptr->nbcar == 0)) return (0); /* pas de buffer !! */ if (bufptr->curr->lgbuf) { char *ptr = bufptr->curr->buffer; --bufptr->curr->lgbuf; --bufptr->nbcar; if (bufptr->curr->lgbuf == 0) { /* libere le buffer */ if (bufptr->tete == bufptr->curr) { /* C'est le premier buffer */ m_libere ((char *) bufptr->curr->buffer, 1); m_libere ((char *) bufptr->curr, sizeof (lbuf)); bufptr->tete = bufptr->curr = NULL; } else { /* Cherche l'avant-dernier buffer ... */ ligptr = bufptr->tete; while (ligptr->suite != bufptr->curr) { ligptr = ligptr->suite; if (ligptr == NULL) return (0); /* Okazou ! */ } /* Ok... */ m_libere ((char *) bufptr->curr->buffer, 1); m_libere ((char *) bufptr->curr, sizeof (lbuf)); bufptr->curr = ligptr; bufptr->curr->suite = NULL; } } else { /* Realloue le buffer */ bufptr->curr->buffer = (char *) m_alloue (bufptr->curr->lgbuf); memcpy (bufptr->curr->buffer, ptr, bufptr->curr->lgbuf); m_libere (ptr, bufptr->curr->lgbuf + 1); } } return (1); } void in_buf (int voie, char *buffer, int lgbuf) { ibuf *bufptr = &(svoie[voie]->inbuf); lbuf *ligptr; char *ptr; int car; df ("in_buf", 4); if (lgbuf == 0) return; deb_io (); ligptr = (lbuf *) m_alloue (sizeof (lbuf)); ligptr->suite = NULL; if (bufptr->tete == NULL) { bufptr->tete = bufptr->curr = ligptr; bufptr->nocar = bufptr->nbcar = bufptr->nblig = 0; } else { bufptr->curr->suite = ligptr; bufptr->curr = ligptr; } ptr = bufptr->curr->buffer = (char *) m_alloue (lgbuf); bufptr->curr->lgbuf = lgbuf; bufptr->nbcar += lgbuf; while (lgbuf--) { car = *buffer++; *ptr++ = car; if (car == '\r') { if ((svoie[voie]->binary == 0) && (svoie[voie]->kiss == -1) && (svoie[voie]->cross_connect == -1) && (svoie[voie]->seq || svoie[voie]->outptr) && (bufptr->curr->lgbuf == 2)) { if ((*(bufptr->curr->buffer) == 'A') || (*(bufptr->curr->buffer) == 'a')) { svoie[voie]->dde_int = 1; clear_inbuf (voie); break; } if ((*(bufptr->curr->buffer) == 'C') || (*(bufptr->curr->buffer) == 'c')) { if (svoie[voie]->aut_nc) svoie[voie]->dde_int = 3; clear_inbuf (voie); break; } if ((*(bufptr->curr->buffer) == 'N') || (*(bufptr->curr->buffer) == 'n')) { if (svoie[voie]->aut_nc) svoie[voie]->dde_int = 2; } } bufptr->nblig++; } } fin_io (); ff (); return; } void interruption (int voie) { #ifdef __FBBDOS__ FScreen *screen = &conbuf; #endif df ("interruption", 1); switch (svoie[voie]->dde_int) { case 1: /* Abort */ clear_outbuf (voie); libere_tread (voie); svoie[voie]->seq = svoie[voie]->sta.ack = svoie[voie]->stop = 0; svoie[voie]->sr_mem = svoie[voie]->dde_int = 0; svoie[voie]->lignes = -1; selvoie (voie); init_langue (voie); aff_header (voie); #ifdef __FBBDOS__ if ((voie == CONSOLE) && (screen->totlig)) inputs (CONSOLE, W_CNST, "A\r"); #endif texte (T_QST + 3); if ((pvoie->mbl) && (pvoie->niv2 == 1)) { /* Liste ! */ texte (T_QST + 6); ch_niv3 (2); } else if (pvoie->niv1 == N_THEMES) { /* Themes */ maj_niv (N_THEMES, 0, 0); texte (T_THE + 2); } else retour_menu (svoie[voie]->niv1); break; case 2: /* Next */ /* svoie[voie]->dde_int = 0; */ svoie[voie]->stop = 0; clear_marque (voie); svoie[voie]->dde_int = 0; break; case 3: /* Continu */ /* svoie[voie]->dde_int = 0; */ svoie[voie]->dde_int = svoie[voie]->stop = 0; svoie[voie]->lignes = -1; break; default: retour_menu (svoie[voie]->niv1); break; } ff (); return; } int lig_bufi (int voie) { int val; df ("lig_bufi", 1); val = svoie[voie]->inbuf.nblig; ff (); return (val); } void cr_cond (void) { obuf *optr = pvoie->outptr; char *ptr; df ("cr_cond", 0); if (optr) { while (optr->suiv) optr = optr->suiv; ptr = optr->buffer + optr->nb_car - 1; if (*ptr == '\r') { ff (); return; } } cr (); ff (); return; } int send_buf (int voie) { int ncars, nbcars, nocars; int retour = 0; int fin = 0; char buf[257]; char *lptr = NULL; obuf *optr; char *ptr, *tptr; int maxcar; df ("send_buf", 1); /* Commute le TNC en emission (TOR mode) */ if ((voie) && (svoie[voie]->pack == 0)) { /* tor_start (voie); */ svoie[voie]->pack = 1; } if ((voie == CONSOLE) || (voie == INEXPORT)) maxcar = 250; else maxcar = svoie[voie]->paclen; if (maxcar == 0) sta_drv (voie, PACLEN, &maxcar); if ((voie == CONSOLE) && (kb_vide () == 0)) { ff (); return (1); } if (!svoie[voie]->stop) { init_timout (voie); if ((optr = svoie[voie]->outptr) != NULL) { ncars = 0; tptr = buf; nbcars = optr->nb_car; nocars = optr->no_car; ptr = optr->buffer + nocars; while (1) { if (nbcars == nocars) { svoie[voie]->outptr = optr->suiv; m_libere (optr, sizeof (obuf)); svoie[voie]->memoc -= 250; if ((optr = svoie[voie]->outptr) != NULL) { nbcars = optr->nb_car; nocars = 0; ptr = optr->buffer; } else { /* cprintf(" Vide ") ; */ break; } } *tptr++ = *ptr; ++nocars; if ((*ptr == '\r') && (svoie[voie]->lignes > 0)) { if ((--svoie[voie]->lignes == 0) && ((svoie[voie]->sr_mem) || (svoie[voie]->seq) || (svoie[voie]->t_tr) || (nbcars != nocars) || (optr->suiv))) { init_langue (voie); svoie[voie]->stop = 1; optr->no_car = nocars; lptr = langue[vlang]->plang[T_QST - 1]; while (*lptr) { if (++ncars == maxcar) { fin = 1; break; } *tptr++ = *lptr++; } if (!fin) { lptr = NULL; ++ncars; } break; } } if (++ncars == maxcar) { optr->no_car = nocars; break; } ++ptr; } if (voie == CONSOLE) { deb_io (); aff_bas (voie, W_SNDT, buf, ncars); if (lptr) aff_bas (voie, W_SNDT, lptr, strlen (lptr)); is_idle = 0; fin_io (); retour = 1; } /* else if (voie == INEXPORT) { deb_io (); aff_bas (voie, W_SNDT, buf, ncars); if (lptr) aff_bas (voie, W_SNDT, lptr, strlen (lptr)); is_idle = 0; fin_io (); retour = 1; } */ else { retour = snd_drv (voie, DATA, buf, ncars, NULL); ++svoie[voie]->sta.ack; if (lptr) { retour = snd_drv (voie, DATA, lptr, strlen (lptr), NULL); ++svoie[voie]->sta.ack; } } } } free_mem (); ff (); return (retour); } void clear_outbuf (int voie) { obuf *optr; df ("clear_outbuf", 1); while ((optr = svoie[voie]->outptr) != NULL) { svoie[voie]->outptr = optr->suiv; m_libere (optr, sizeof (obuf)); svoie[voie]->memoc -= 250; } free_mem (); ff (); return; } void clear_marque (int voie) { int i; int trouve = 0; obuf *optr; df ("clear_marque", 1); while (svoie[voie]->t_read || svoie[voie]->outptr) { while ((optr = svoie[voie]->outptr) != NULL) { for (i = 0; i < NB_MARQUES; i++) { if (optr->marque[i] >= optr->no_car) { optr->no_car = optr->marque[i]; optr->marque[i] = -1; trouve = 1; break; } } if (trouve) break; svoie[voie]->outptr = optr->suiv; m_libere (optr, sizeof (obuf)); svoie[voie]->memoc -= 250; } if (trouve) break; if ((svoie[voie]->memoc <= MAXMEM / 2) && (svoie[voie]->sr_mem)) { selvoie (voie); premier_niveau (); } } svoie[voie]->stop = 1; free_mem (); ff (); return; } int no_port (int voie) { int val; df ("no_port", 1); if (voie == CONSOLE) { ff (); return (0); } val = svoie[voie]->affport.port; ff (); return (val); } int no_canal (int voie) { int val; df ("no_canal", 1); val = svoie[voie]->affport.canal; ff (); return (val); } int tncin (int voie) { int val; df ("tncin", 1); val = rcv_tnc (no_port (voie)); ff (); return (val); } void tncout (int voie, int ch) { int port; df ("tncout", 2); port = no_port (voie); while (car_tx (port)) ; /* attend que le buffer d'emission soit vide */ send_tnc (port, ch); ff (); return; } void tncstr (int port, char *ptr, int echo) { int c; df ("tncstr", 4); while (car_tx (port)) ; /* attend que le buffer d'emission soit vide */ while ((c = *ptr++) != '\0') { send_tnc (port, c); #ifdef __FBBDOS__ if (echo) { putch (c); if (c == '\r') putch ('\n'); } #endif } ff (); return; } void ctrl_z (void) { df ("ctrl_z", 0); outs ("\032\r", 2); ff (); return; } #ifdef __FBBDOS__ void curon (void) /*******/ /* allume le curseur sur ecran alphanum */ { df ("curon", 0); _setcursortype (_NORMALCURSOR); ff (); return; } void curoff (void) /********/ /* eteind le curseur sur l'ecran alphanum */ { df ("curoff", 0); _setcursortype (_NOCURSOR); ff (); return; } void cursor (int val) { union REGS registres; df ("cursor", 1); registres.h.ah = 1; registres.x.cx = val; int86 (INT10, ®istres, ®istres); ff (); return; } int attcurs (void) { int *ptr = MK_FP (0x40, 0x60); return (*ptr); } #endif static void wheader (int voie, int color, char *s) { #ifdef __FBBDOS__ FScreen *screen; #endif deb_io (); #if defined(__WINDOWS__) || defined(__linux__) aff_bas_suite (voie, color, "\r", 1); #endif #ifdef __FBBDOS__ screen = (voie == CONSOLE) ? &conbuf : &winbuf; if (screen->carpos) { aff_bas_suite (screen->voie, screen->color, "\r", 1); } #endif aff_bas_suite (voie, color, s, strlen (s)); fin_io (); return; } void aff_header (int voie) { char s[80]; char *ptr = s; /* if (voie == CONSOLE) */ if (!aff_ok(voie)) return; df ("aff_header", 1); if ((ok_aff) && (voie != lastaff) && (svoie[voie]->sta.connect > 1)) { deb_io (); sprintf (ptr, "[PORT %d (%s) - %2d - %s-%d]\r", no_port (voie), p_port[no_port (voie)].freq, virt_canal (voie), svoie[voie]->sta.indicatif.call, svoie[voie]->sta.indicatif.num); wheader (voie, -1, s); lastaff = voie; fin_io (); } ff (); return; } void aff_bas (int voie, int color, char *str, int nb) { df ("affbas", 4); aff_header (voie); aff_bas_suite (voie, color, str, nb); ff (); return; } static void aff_bas_suite (int voie, int color, char *str, int nb) { int i; int nbp = nb; char *ptr = str; static char buf[600]; char *p_str = buf; if (nb == 0) return; df ("aff_bas_suite", 5); while (nb--) { if (*ptr >= '\040') *p_str++ = *ptr; else { switch (*ptr) { case '\a': *p_str++ = 14; break; case '\r': *p_str++ = '\r'; *p_str++ = '\n'; break; case '\t': for (i = 0; i < 8; i++) *p_str++ = ' '; break; case '\n': case '\032': *p_str++ = *ptr; break; } } ++ptr; } *p_str = '\0'; winputs (voie, color, buf); if (voie == CONSOLE) { #if defined(__WINDOWS__) || defined(__linux__) if (print) { trait_time = 0; SpoolLine (voie, color, str, nbp); } #else if (print) trait_time = 0; while ((print) && (nbp--)) { if (*str >= '\040') fputc (*str, file_prn); else { switch (*str) { case '\a': fputc ('^', file_prn); fputc ('G', file_prn); break; case '\r': fputc ('\r', file_prn); fputc ('\n', file_prn); break; case '\t': for (i = 0; i < 8; i++) fputc (' ', file_prn); break; case '\032': fputc ('^', file_prn); fputc ('G', file_prn); break; } } ++str; } #endif } ff (); return; } char extind (char *chaine, char *indicatif) { int i = 6; int ssid = 0; df ("extind", 4); while ((i--) && isalnum (*chaine)) { *indicatif++ = *chaine++; } *indicatif = '\0'; if ((*chaine) && (*chaine != ' ')) { while (*chaine && !isdigit (*chaine)) ++chaine; if (*chaine) { ssid = atoi (chaine); } } ff (); return ((char) ssid); } void tst_appel (void) { struct stat st; df ("tst_appel", 0); if (stat (d_disque ("OPTIONS.SYS"), &st) == 0) { if (st.st_mtime != t_appel) { t_appel = st.st_mtime; lit_appel (); } } ff (); return; } void tnc_commande (int select, char *command, int cmd) { int voie; char buffer[600]; /* cmd = ECHOCMD select = voie cmd = SNDCMD select = voie cmd = PORTCMD select = port */ if (*command == '\0') return; if (cmd == PORTCMD) { int nb = 0; char *ptr = buffer, *sv; voie = p_port[select].pr_voie; deb_io (); while (*command) { if (*command == '$') { ++command; sv = variable (*command++); while (*sv) { *ptr++ = *sv++; if (++nb == 250) break; } } else if (*command == '%') { ++command; sv = alt_variable (*command++); while (*sv) { *ptr++ = *sv++; if (++nb == 250) break; } } else { *ptr++ = *command++; nb++; } if (nb == 250) break; } *ptr = '\0'; command = buffer; fin_io (); #ifdef __FBBDOS__ if (!operationnel) { ptr = buffer; cprintf ("%d : ", select); nb = 0; while (*ptr) { if (*ptr == '\r') putch ('\n'); putch (*ptr); ++ptr; if ((++nb == 2) && (p_port[select].typort == TYP_PK)) putch (' '); } putch ('\n'); putch ('\r'); } #endif } else voie = select; sta_drv (voie, cmd, (void *) command); } /* Called when Pactor was disconnected after 10 seconds */ static void FAR hst_disc (int port, void *userdata) { /* Imediate disconnection */ force_deconnexion ((uintptr_t) userdata, 1); } void dec (int voie, int mode) /* Mode = 1 deconnexion 2 retour au nodal */ { #ifndef __linux__ int command; #endif df ("dec", 2); deb_io (); switch (p_port[no_port (voie)].typort) { case TYP_DED: case TYP_FLX: tnc_commande (voie, "D", SNDCMD); break; case TYP_HST: tnc_commande (voie, "D", SNDCMD); if (P_TOR (voie)) { /* Timer to force disconnection after 10 seconds */ del_timer (p_port[port].t_delay); p_port[port].t_delay = add_timer (10, port, (void FAR *) hst_disc, (void *)(intptr_t)voie); } break; case TYP_PK: tnc_commande (voie, "DI", SNDCMD); break; case TYP_MOD: deconnect_modem (voie); break; case TYP_KAM: kam_commande (voie, "D"); break; #ifdef __WINDOWS__ case TYP_TCP: case TYP_ETH: case TYP_AGW: tnc_commande (voie, "D", SNDCMD); break; #endif #ifdef __linux__ case TYP_TCP: case TYP_ETH: case TYP_SCK: case TYP_POP: tnc_commande (voie, "D", SNDCMD); break; #else case TYP_BPQ: command = mode + 1; sta_drv (voie, CMDE, (void *) &command); break; #endif } fin_io (); ff (); return; } void programm_indic (int voie) { char buffer[257]; df ("programm_indic", 1); if ((svoie[voie]->sta.callsign.call[0]) && (p_port[no_port (voie)].typort == TYP_DED)) { if ((!DEBUG) && (p_port[no_port (voie)].pvalid)) { sprintf (buffer, "I %s-%d", svoie[voie]->sta.callsign.call, svoie[voie]->sta.callsign.num); tnc_commande (voie, buffer, ECHOCMD); if (*buffer & !svoie[CONSOLE]->sta.connect) cprintf ("%s\r\n",buffer); } } ff (); return; } void aff_event (int voie, int event) { static char *event_string[3] = { #ifdef ENGLISH "", "Connect ", "Disconnect ", #else "", "Connexion", "D�connexion", #endif }; char s[80]; char *ptr = s; if (!aff_ok(voie)) return; df ("aff_event", 2); if (!svoie[CONSOLE]->sta.connect) { deb_io (); sprintf (ptr, "[PORT %d (%s) - %2d - %s-%d] %s %s\r", no_port (voie), p_port[no_port (voie)].freq, virt_canal (voie), svoie[voie]->sta.indicatif.call, svoie[voie]->sta.indicatif.num, strheure (time (NULL)), event_string[event]); wheader (voie, W_VOIE, s); if (voie != CONSOLE) lastaff = voie; fin_io (); } ff (); return; } int dec_voie (int voie) { char temp[80]; int save_voie, autre_voie; df ("dec_voie", 1); if (svoie[voie]->kiss != -1) { if (svoie[voie]->kiss < 0) svoie[voie]->kiss = CONSOLE; if (p_port[no_port (voie)].typort == TYP_BPQ) { int kiss = svoie[voie]->kiss; selvoie (kiss); texte (T_GAT + 0); aff_freq (); texte (T_GAT + 1); aff_etat ('E'); send_buf (voie); svoie[kiss]->niv3 = 1; svoie[kiss]->cross_connect = -1; svoie[voie]->kiss = -1; selvoie (voie); } else { int kiss = svoie[voie]->kiss; selvoie (kiss); svoie[kiss]->niv3 = 2; texte (T_GAT + 4); selvoie (voie); ff (); return (0); } } if ((svoie[voie]->binary) && (svoie[voie]->niv1 == N_FORW) && (svoie[voie]->niv2 == 5) && (svoie[voie]->niv3 == 4)) { /* Vide le message en cours de reception */ if (svoie[voie]->fbb >= 2) { write_temp_bin (voie, FALSE); libere (voie); } else { del_part (voie, svoie[voie]->entmes.bid); libere (voie); } } programm_indic (voie); del_temp (voie); del_copy (voie); if (svoie[voie]->cross_connect != -1) { autre_voie = svoie[voie]->cross_connect; if (svoie[autre_voie]->kiss != -1) { if (svoie[autre_voie]->kiss < 0) svoie[autre_voie]->kiss = CONSOLE; save_voie = voie; selvoie (autre_voie); dec (autre_voie, 1); dec (autre_voie, 1); selvoie (save_voie); fin_tnc (); } svoie[autre_voie]->cross_connect = svoie[autre_voie]->kiss = -1; } if (v_tell == voie) { console_off (); v_tell = 0; music (0); svoie[CONSOLE]->sta.connect = 0; svoie[CONSOLE]->niv1 = svoie[CONSOLE]->niv2 = svoie[CONSOLE]->niv3 = 0; } if (svoie[voie]->l_yapp) { svoie[voie]->finf.lastyap = svoie[voie]->l_yapp; svoie[voie]->l_yapp = 0L; } if (svoie[voie]->sta.connect) { if (svoie[voie]->sta.connect > 1) aff_event (voie, 2); status (voie); if (((!voie_forward (voie)) && (svoie[voie]->sta.connect != 17)) || ((voie_forward (voie)) && (svoie[voie]->curfwd->no_con >= 8))) { majfich (voie); } svoie[voie]->deconnect = svoie[voie]->sta.connect = FALSE; aff_nbsta (); curseur (); } if (svoie[voie]->curfwd) { svoie[voie]->curfwd->forward = -1; svoie[voie]->curfwd->no_bbs = 0; } /********* A VERIFIER !! ********** if (voie == p_port[no_port(voie)].forward) { p_port[no_port(voie)].forward = -1 ; } */ svoie[voie]->mode = 0; #ifndef __WINDOWS__ if (svoie[voie]->binary) aff_yapp (voie); #endif #ifdef __linux__ kill_rzsz (voie); #endif if (P_TOR (voie)) { int port = no_port (voie); clear_queue (voie); if (p_port[port].t_busy) { m_libere (p_port[port].t_busy->userdata, sizeof (PortData)); del_timer (p_port[port].t_busy); p_port[port].t_busy = NULL; } if (p_port[port].t_wait) { m_libere (p_port[port].t_wait->userdata, sizeof (PortData)); del_timer (p_port[port].t_wait); p_port[port].t_wait = NULL; } del_timer (p_port[port].t_iss); p_port[port].t_iss = NULL; } svoie[voie]->deconnect = svoie[voie]->sta.connect = svoie[voie]->sta.stat = 0; svoie[voie]->temp1 = 1; svoie[voie]->fbb = bin_fwd; svoie[voie]->timout = time_n; if (svoie[voie]->conf) { svoie[voie]->conf = 0; text_conf (T_CNF + 5); } svoie[voie]->curfwd = NULL; set_binary (voie, 0); set_bs (voie, TRUE); svoie[voie]->conf = svoie[voie]->seq = 0; svoie[voie]->niv1 = svoie[voie]->niv2 = svoie[voie]->niv3 = 0; svoie[voie]->paclen = p_port[no_port (voie)].pk_t; svoie[voie]->cross_connect = -1; svoie[voie]->kiss = -1; svoie[voie]->groupe = -1; svoie[voie]->cur_bull = -1L; svoie[voie]->ch_mon = -1; svoie[voie]->clock = '\0'; svoie[voie]->tmach = 0; svoie[voie]->memoc = 0; svoie[voie]->rev_mode = 1; svoie[voie]->type_yapp = 0; svoie[voie]->aut_linked = 1; svoie[voie]->maj_ok = FALSE; svoie[voie]->ind_mess = 0; svoie[voie]->nb_prompt = 0; svoie[voie]->prot_fwd = prot_fwd; if (svoie[voie]->ctnc) libere_tnc (&(svoie[voie]->ctnc)); /*************** svoie[voie]->ncur->coord = 0xffff; *****************/ unlink (copy_name (voie, temp)); libere_zones_allouees (voie); /* Vide les eventuelles listes */ init_fb_mess (voie); fbb_log (voie, 'X', "D"); aff_forward (); #if defined(__WINDOWS__) || defined(__linux__) window_disconnect (voie); #endif ff (); return (1); } int port_free (int port) { int i; int free; df ("port_free", 1); free = p_port[port].nb_voies; for (i = 1; i < NBVOIES; i++) { if ((no_port (i) == port) && (svoie[i]->sta.connect)) --free; } ff (); return (free); } #define STATIMER 5 static void pactor_data (int port, int voie) { static long prev = 0; static long pprev = 0; long delta; int tempo; if (pprev) { delta = p_port[port].cur - pprev; tempo = STATIMER * 2; } else { delta = p_port[port].cur - prev; tempo = STATIMER; } if (delta < 0) delta = 0; pprev = prev; prev = p_port[port].cur; sta_drv (voie, TOR, "%T"); if (svoie[voie]->sta.connect) { p_port[port].nbc = (int) (delta / tempo); add_timer (STATIMER, port, pactor_data, (void *)(intptr_t) voie); } else { prev = pprev = 0; p_port[port].nbc = 0; } aff_traite (voie, -1); } int con_voie (int voie, char *ptr) { int i; int port, canal; df ("con_voie", 3); if (svoie[voie]->kiss != -1) { int kiss_voie = svoie[voie]->kiss; svoie[kiss_voie]->niv3 = 3; ff (); return (0); } else { if (arret) svoie[voie]->dde_marche = TRUE; else svoie[voie]->dde_marche = FALSE; init_timout (voie); svoie[voie]->nb_err = svoie[voie]->seq = svoie[voie]->stop = 0; connect_fen (); lastaff = -1; svoie[voie]->private_dir = 0; /* svoie[voie]->wp = 0; */ svoie[voie]->ret = 0; svoie[voie]->sid = 0; svoie[voie]->pack = 0; svoie[voie]->read_only = 0; svoie[voie]->aut_nc = 0; svoie[voie]->vdisk = 2; svoie[voie]->cmd_new = 0; svoie[voie]->rev_param = 0; svoie[voie]->log = 1; svoie[voie]->sta.stat = svoie[voie]->sta.connect = 4; svoie[voie]->deconnect = FALSE; svoie[voie]->ch_mon = svoie[voie]->cross_connect = -1; set_binary (voie, 0); svoie[voie]->sr_mem = svoie[voie]->conf = 0; *svoie[voie]->sr_fic = '\0'; /* p_debug(no_port(voie), "Bip"); */ bipper (); svoie[voie]->tstat = svoie[voie]->debut = time (NULL); svoie[voie]->aut_linked = 1; svoie[voie]->tmach = 0L; svoie[voie]->sta.ret = svoie[voie]->sta.ack = svoie[voie]->mode = 0; svoie[voie]->msg_held = 0; svoie[voie]->xferok = svoie[voie]->mess_recu = 1; svoie[voie]->entmes.numero = 0L; svoie[voie]->nb_egal = 0; svoie[voie]->mbl_ext = 1; svoie[voie]->rev_mode = 1; svoie[voie]->r_tete = NULL; *svoie[voie]->passwd = '\0'; if (strtok (NULL, " ")) { ptr = strtok (NULL, " "); /* sta.indicatif */ if (*(ptr + 1) == ':' || *(ptr + 2) == ':') { canal = atoi (ptr); /* DRSI, HST or BPQ connections */ if (DRSI (no_port (voie))) { port = drsi_port (no_port (voie), canal); svoie[voie]->affport.port = port; } else if (HST (no_port (voie))) { port = hst_port (no_port (voie), canal); svoie[voie]->affport.port = port; } else if (BPQ (no_port (voie))) { port = bpq_port (no_port (voie), canal); svoie[voie]->affport.port = port; } #ifdef __WINDOWS__ else if (AGW (no_port (voie))) { port = agw_port (no_port (voie), canal); svoie[voie]->affport.port = port; } #endif #ifdef __linux__ /* Socket connections */ else if (S_LINUX (no_port (voie))) { port = linux_port (no_port (voie), canal); svoie[voie]->affport.port = port; } #endif /* Other connections */ else { port = no_port (voie); } ptr += 2; /* Drsi Port */ if (port_free (port) < 0) svoie[voie]->deconnect = 7; } /* if (*ptr == '!') */ if (*ptr && !isalnum(*ptr)) /* PTC-II prefixes the call with some characters */ ++ptr; svoie[voie]->sta.indicatif.num = extind (ptr, svoie[voie]->sta.indicatif.call); } for (i = 0; i < 8; i++) *(svoie[voie]->sta.relais[i].call) = '\0'; ptr = (strtok (NULL, " ")); if (ptr && ((*ptr == 'v') || (*ptr == 'V'))) { /* relais */ i = 0; while ((ptr = strtok (NULL, " ")) != NULL) { svoie[voie]->sta.relais[i].num = extind (ptr, svoie[voie]->sta.relais[i].call); i++; } } /* svoie[voie]->paclen = p_port[no_port(voie)].pk_t; */ aff_event (voie, 1); status (voie); curseur (); #if defined(__WINDOWS__) || defined(__linux__) window_connect (voie); #endif svoie[voie]->entmes.bid[0] = '\0'; init_fb_mess (voie); connexion (voie); /* positionne ncur */ new_om = nouveau (voie); /* nb de lignes de la pagination */ /* svoie[voie]->mode = svoie[voie]->finf.flags & 0xff ; */ svoie[voie]->mode = 0; svoie[voie]->l_mess = 0L; svoie[voie]->l_yapp = 0L; if ((fbb_fwd) && (svoie[voie]->fbb)) { svoie[voie]->mode |= F_NFW; /* Supporte le protocole FBB */ } svoie[voie]->mbl = TRUE; svoie[voie]->maj_ok = 0; if (svoie[voie]->niv1 == 0) connect_log (voie, "\0"); change_droits (voie); strcpy (svoie[voie]->dos_path, "\\"); aff_nbsta (); if ((P_READ (voie)) && (!SYS (svoie[voie]->finf.flags)) && (!LOC (svoie[voie]->finf.flags))) { svoie[voie]->read_only = 1; /* read_only_alert (0, indd); */ } if (P_TOR (voie)) { /* clear_queue (voie); TEST F6FBB */ sta_drv (voie, TOR, "%T"); add_timer (STATIMER, no_port (voie), pactor_data, (void *)(intptr_t) voie); if (svoie[voie]->niv1 == 0) { /* Appel entrant */ tor_start (voie); /* WinDebug("Incoming Call\r\n"); */ } else { /* Appel entrant */ tor_stop (voie); /* WinDebug("Outgoing Call\r\n"); */ } } if (POP (no_port (voie))) { send_list(voie); svoie[voie]->mode |= F_FOR; } if ((svoie[voie]->ctnc == NULL) && (BBS (svoie[voie]->finf.flags))) prog_rev_tnc (voie); ff (); return (1); } } void connect_log (int voie, char *ajoute) { int i; char s[256], s1[80]; df ("connect_log", 3); sprintf (s, "%c %s-%d", (char) no_port (voie) + '@', svoie[voie]->sta.indicatif.call, svoie[voie]->sta.indicatif.num); for (i = 0; i < 8; i++) { if (*(svoie[voie]->sta.relais[i].call) == '\0') break; if (i == 0) strcat (s, " VIA "); else strcat (s, ","); if (svoie[voie]->sta.relais[i].num) sprintf (s1, "%s-%d", svoie[voie]->sta.relais[i].call, svoie[voie]->sta.relais[i].num); else sprintf (s1, "%s", svoie[voie]->sta.relais[i].call); strcat (s, s1); } strcat (s, ajoute); fbb_log (voie, 'C', s); ff (); return; } #ifdef LOG FILE *logfp; int curlog = 0; int flog = 0; char liglog[80]; char *ptrlog; open_log (void) { df ("open_log", 1); logfp = fopen ("RES.RES", "wt"); curlog = 0; flog = 1; ff (); return; } write_log (int c) { df ("write_log", 1); if (flog == 0) { ff (); return; } liglog[curlog] = (isgraph (c)) ? c : '.'; fprintf (logfp, "%02x ", c & 0xff); if (++curlog == 16) { liglog[curlog] = '\0'; fprintf (logfp, " %s\n", liglog); curlog = 0; } ff (); return; } close_log (void) { df ("close_log", 1); fclose (logfp); flog = 0; ff (); return; } #endif int kam_commande (int voie, char *chaine) { int retour; retour = sta_drv (voie, SNDCMD, (void *) chaine); return (retour); } void monitor (int port, char *buffer, int nb) { int i; int old_voie; for (i = 0; i < NBVOIES; i++) { if (svoie[i]->ch_mon == port) { old_voie = voiecur; selvoie (i); prog_more (i); /* cprintf("Envoie monitor sur voie %d\r\n") ; */ outsln (buffer, nb); selvoie (old_voie); } } return; } int rcv_tnc (int port) { int c; int nb = 0; char s[80]; df ("rcv_tnc", 1); if (!DEBUG) { tempo = 50; while (tempo) { if ((c = rec_tnc (port)) >= 0) { ff (); return (c); } #ifdef __WINDOWS__ BWinSleep (50); if (tempo > 0) --tempo; #endif } if (p_port[port].typort == TYP_DED) { while (((c = rec_tnc (port)) == -1) && (nb < 255)) { if (operationnel) { } nb++; /* a mettre dans la fenetre */ #ifdef __WINDOWS__ DisplayResync (port, nb); #else sprintf (s, "Port %d Resync %-4d", port, nb); aff_chaine (W_DEFL, 1, 1, s); #endif /*if (!getvoie(CONSOLE)->sta.connect) cprintf("\r%s", s) ; */ /* cprintf(" %d", nb_int) ; */ while (car_tx (port)) ; /* attend que le buffer d'emission soit vide */ send_tnc (port, '\001'); tempo = 2; while (tempo) { #ifdef __WINDOWS__ BWinSleep (50); if (tempo > 0) --tempo; #endif /* environ 100 ms */ } } if (c == -1) { if (!svoie[CONSOLE]->sta.connect) cprintf ("Resynchronisation impossible. Systeme arrete !!\r\n"); fbb_error (ERR_SYNCHRO, "DED RECEIVE DATA", port); ff (); return (-1); } } vide (port, 0); ++com_error; #ifdef __WINDOWS__ DisplayResync (port, 0); #endif ff (); return (-1); } ff (); return (-1); } int vide (int port, int echo) { int c, nb = 0; df ("vide", 2); if ((DEBUG) || (!p_port[port].pvalid)) { deb_io (); cprintf ("Erreur port %d!\n", port); fin_io (); ff (); return (0); } p_port[port].portind = 0; tempo = 20; deb_io (); while (tempo) { if ((c = rec_tnc (port)) >= 0) { #ifdef __FBBDOS__ if (echo) { putch (c); if (c == '\r') putch ('\n'); } #endif tempo = 20; ++nb; } #ifdef __WINDOWS__ else { BWinSleep (100); if (tempo > 0) --tempo; } #endif #ifdef __linux__ else { usleep (100000); if (tempo > 0) --tempo; } #endif } fin_io (); ff (); return (nb); } /* * end of tncio.c * */ fbb-7.0.10/src/rx25.c0000644000175000017500000002431613613360505011014 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * RX25.C : Decodage de trames au format ROSE X25 * * D'apres KD.BAS de F1EBN * * FC1OAT@F6ABJ - 920820 */ #include /****************************************************************************** * Dump ASCII avec Filtrage des caracteres non affichables ******************************************************************************/ static int decode_x25 (uchar *, int, char *); static void decode_X121 (uchar *, int, char *); static void decode_digi (uchar *, int, char *); static void dump_hexa (uchar *, int, char *); void put_rose (uchar * texte, int attr, int nbcar) { uchar chaine[400]; uchar *ptr = chaine; int decode = 1; /* A patcher, au cas ou ... */ if (decode) { if (nbcar > 256) nbcar = 256; strcpy (ptr, "X25 : "); ptr += 6; nbcar = 6 + decode_x25 (texte, nbcar, ptr); } else memcpy (chaine, texte, nbcar); put_ui (chaine, attr, nbcar); } /****************************************************************************** * Les Causes *****************************************************************************/ static char *ResetCause (int cause) { static char hex_cause[3]; /* From ISO 8208 page 48 */ switch (cause) { case 0: return "DTE Originated"; case 0xC1: return "Gateway-detected Procedure Error"; case 0xC3: return "Gateway Congestion"; case 0xC7: return "Gateway Operational"; default: switch (cause & 0x7F) { case 0x01: return "Out Of Order"; case 0x03: return "Remote Procedure Error"; case 0x05: return "Local Procedure Error"; case 0x07: return "Network Congestion"; case 0x09: return "Remote DTE Operational"; case 0x0F: return "Network Operational"; case 0x11: return "Incompatible Destination"; case 0x1D: return "Network Out Of Order"; default: sprintf (hex_cause, "%2.2X", cause); return hex_cause; } } } static char *ClearCause (int cause) { static char hex_cause[3]; /* From ISO 8208 page 43 */ switch (cause) { case 0: return "DTE Originated"; case 0xC1: return "Gateway-detected Procedure Error"; case 0xC3: return "Gateway Congestion"; case 0xC7: return "Gateway Operational"; default: switch (cause & 0x7F) { case 0x01: return "Number Busy"; case 0x09: return "Out Of Order"; case 0x11: return "Remote Procedure Error"; case 0x19: return "Reverse Charging Acceptance Not Subscribed"; case 0x21: return "Incompatible Destination"; case 0x29: return "Fast Select Acceptance Not Subscribed"; case 0x39: return "Ship Absent"; case 0x03: return "Invalid Facility Requested"; case 0x0B: return "Access Barred"; case 0x13: return "Local Procedure Error"; case 0x05: return "Network Congestion"; case 0x0D: return "Not Obtainable"; case 0x15: return "RPOA Out Of Order"; default: sprintf (hex_cause, "%2.2X", cause); return hex_cause; } } } static char *RestartCause (int cause) { static char hex_cause[3]; /* From ISO 8208 page 50 */ switch (cause) { case 0: return "DTE Originated"; case 1: return "Local Procedure Error"; case 3: return "Network Congestion"; case 7: return "Network Operational"; case 0x7F: return "Registration/Cancellation Confirmed"; default: sprintf (hex_cause, "%2.2X", cause); return hex_cause; } } /****************************************************************************** * Decodage de trames X25 *****************************************************************************/ /* Decodage d'une adresse X.121 */ static void decode_X121 (uchar * data, int lgaddr, char *result) { char bcd; int pfo, pfa; while (lgaddr > 0) { pfo = (*data & 0xF0) >> 4; pfa = *data & 0x0F; bcd = pfo + '0'; *result++ = bcd; if (--lgaddr == 0) break; bcd = pfa + '0'; *result++ = bcd; lgaddr--; data++; } *result = '\0'; } /* Dump Hexa */ static void dump_hexa (uchar * data, int l_data, char *result) { int i; i = 0; while (l_data-- > 0) { sprintf (result, "%2.2X ", *data++); result += 3; if (++i == 16) { *result++ = '\r'; i = 0; } } *result = '\0'; } static char *rs_addr(char *addr) { static char str[20]; strncpy(str, addr, 4); str[4] = ','; strncpy(str+5, addr+4, 6); str[11] = '\0'; return str; } /* Decodage d'un champ digi */ static void decode_digi (uchar * data, int l_data, char *result) { while (l_data-- > 1) { *result++ = *data++ >> 1; } *result++ = '-'; *result++ = (*data & 0x7F) >> 1; *result = 0; } /* Decodage d'une suite de champs facilite */ static void decodage_facilite (uchar * data, char *result) { int lgfac, lg, fct, lgdigi, lgaddcall; int lgad, lgaddr, lgadind; static char digis[10], digid[10], icd[10]; static char indorig[10], inddest[10]; static char addstorig[20], addstdest[20]; lgfac = *data++; lg = lgfac; digid[0] = digis[0] = '\0'; while (lg > 0) { fct = *data++; lg--; switch (fct) { case 0: /* Marker=0 National Fac ou Marker=15 CCITT */ data++; lg--; break; case 0x3F: /* Utilise si appel par call digi au lieu du call N3 */ sprintf (result, "\rFacility 3F%2.2X", *data++); lg--; break; case 0x7F: /* Nombre aleatoire pour eviter les rebouclages */ sprintf (result, " NbAlea: %2.2X%2.2X", *data, *(data + 1)); data += 2; lg -= 2; break; case 0xE9: /* Digi destination */ lgdigi = *data++; decode_digi (data, lgdigi, digid); data += lgdigi; lg -= 1 + lgdigi; break; case 0xEB: /* Digi origine */ lgdigi = *data++; decode_digi (data, lgdigi, digis); data += lgdigi; lg -= 1 + lgdigi; break; case 0xC9: /* Adresse et indicatif du nodal destination */ case 0xCB: /* Adresse et indicatif du nodal origine */ lgaddcall = *data++; data++; dump_hexa (data, 3, icd); data += 3; lgad = *data++; lg -= 6; lgaddr = lgad; if (fct == 0xCB) decode_X121 (data, lgaddr, addstorig); else decode_X121 (data, lgaddr, addstdest); data += (lgad + 1) / 2; lg -= (lgad + 1) / 2; lgadind = lgaddcall - (lgad + 1) / 2 - 5; if (fct == 0xCB) strncpy (indorig, data, lgadind); else strncpy (inddest, data, lgadind); data += lgadind; lg -= lgadind; break; default: sprintf (result, "\rUnknown Facility Type %2.2X", fct); lg = 0; break; } result += strlen (result); } sprintf (result, "\r%s@%s", indorig, rs_addr(addstorig)); result += strlen (result); if (*digis) sprintf (result, " via %s", digis); strcat (result, " -> "); result += strlen (result); sprintf (result, "%s@%s", inddest, rs_addr(addstdest)); result += strlen (result); if (*digid) sprintf (result, " via %s", digid); } /* Decodage des donnees accompagnant un CALL REQUEST */ static void decode_call_req (uchar * data, int l_data, char *result) { int lgdest, lgorig, lgaddr; /* Decodage du champ adresse */ lgdest = *(data + 3) & 0x0F; lgorig = (*(data + 3) & 0xF0) >> 4; lgaddr = lgorig + lgdest; /* decode_X121 (data + 4 + (lgdest / 2), lgorig, result); strcat (result, " -> "); decode_X121 (data + 4, lgdest, result + strlen (result)); */ data += 4 + (lgaddr / 2); l_data -= 4 + (lgaddr / 2); /* result += strlen (result); */ /* Decodage des champs facilite */ decodage_facilite (data, result); } /* Point d'entree du decodage des trames X25 */ static int decode_x25 (uchar * data, int l_data, char *result) { int tpaq, id_format, r, s, lci, lg; char *ptemp = result; lci = ((*data & 0x0f) << 4) | *(data + 1); id_format = *data; tpaq = *(data + 2); r = (tpaq & 0xE0) >> 5; s = (tpaq & 0x0E) >> 1; sprintf (result, "LCI %03d : ", lci); result += strlen (result); if (id_format & 0x80) strcat (result, "Q "); if (id_format & 0x40) strcat (result, "D "); if (tpaq & 1) { switch (tpaq) { case 0x0B: sprintf (result, "CALL REQUEST "); result += strlen (result); decode_call_req (data, l_data, result); break; case 0x0F: sprintf (result, "CALL ACCEPTED"); break; case 0x13: sprintf (result, "CLEAR REQUEST - Cause %s - Diag %d", ClearCause (*(data + 3)), *(data + 4)); break; case 0x17: sprintf (result, "CLEAR CONFIRMATION"); break; case 0x23: sprintf (result, "INTERRUPT"); break; case 0x27: sprintf (result, "INTERRUPT CONFIRMATION"); break; case 0x1B: sprintf (result, "RESET REQUEST - Cause %s - Diag %d", ResetCause (*(data + 3)), *(data + 4)); break; case 0x1F: sprintf (result, "RESET CONFIRMATION"); break; case 0xF3: sprintf (result, "REGISTRATION REQUEST"); break; case 0xF7: sprintf (result, "REGISTRATION CONFIRMATION"); break; case 0xFB: sprintf (result, "RESTART REQUEST - Cause %s - Diag %d", RestartCause (*(data + 3)), *(data + 4)); break; case 0xFF: sprintf (result, "RESTART CONFIRMATION"); break; default: switch (tpaq & 0x0F) { case 0x01: sprintf (result, "RR R%d", r); break; case 0x05: sprintf (result, "RNR R%d", r); break; case 0x09: sprintf (result, "REJ R%d", r); break; } break; } l_data = 0; lg = strlen (ptemp); } else { l_data -= 3; if (tpaq & 0x10) strcat (result, "M "); sprintf (result, "DATA R%d S%d L=%d", r, s, l_data); strcat (result, "\r"); lg = strlen (ptemp); result += strlen (result); if (l_data < 0) l_data = 0; memcpy (result, data + 3, l_data); } return (lg + l_data); } fbb-7.0.10/src/conf.c0000644000175000017500000001214313613360505011134 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE CONFERENCE */ #include static void conferenciers (void); static void send_conf (char *, int); int conference (void) { int c, port, voie; switch (pvoie->niv2) { case 0: c = toupper (*indd); switch (c) { case 'W': conferenciers (); retour_mbl (); break; case '\0': case '\r': cnf_prec = -1; text_conf (T_CNF + 3); pvoie->conf = 1; texte (T_CNF + 0); conferenciers (); ch_niv2 (1); break; default: return (1); /* sprintf(varx[0], "C%c", c) ; texte(T_ERR + 1) ; retour_mbl() ; */ /* break ; */ } break; case 1: if (*indd == '.') { switch (toupper (*(indd + 1))) { case 'Q': pvoie->conf = 0; texte (T_CNF + 4); text_conf (T_CNF + 5); retour_mbl (); break; case 'W': conferenciers (); break; case 'D': indd += 2; if (teste_espace ()) { sup_ln (strupr (indd)); if (((voie = num_voie (indd)) != -1) && (svoie[voie]->conf)) { deconnexion (voie, 1); } else { var_cpy (0, indd); texte (T_CNF + 10); } } break; case 'C': indd += 2; while_space (); if ((isdigit (*indd)) && (isspace (*(indd + 1)))) { port = *indd - '0'; ++indd; } else port = no_port (voiecur); if ((port > 0) && (port < NBPORT) && ((p_port[port].moport & 0x10) || (droits (ACCGATE))) && (p_port[port].pvalid)) { if ((p_port[port].typort == TYP_BPQ) || (p_port[port].typort == TYP_MOD) || (p_port[port].typort == TYP_TCP)) { texte (T_ERR + 14); break; } if (teste_espace ()) { if ((voie = ch_voie (port, 0)) > 0) { /* save_voie = voiecur ; */ sup_ln (indd); indd -= 2; *indd = 'C'; *(indd + 1) = ' '; /* cprintf("Envoie <%s>\r\n", indd) ; */ if (connect_station (voie, 1, strupr (indd)) == 0) { svoie[voie]->conf = 1; svoie[voie]->niv1 = N_CONF; svoie[voie]->niv2 = svoie[voie]->niv3 = 0; /* cprintf("Met %d sur la voie %d\r\n", N_CONF, voie); */ } /* selvoie(save_voie) ; */ } else texte (T_GAT + 3); } else texte (T_ERR + 2); } else texte (T_GAT + 7); break; case 'H': case '?': pvoie->niv1 = N_MBL; out_help ("C"); pvoie->niv1 = N_CONF; break; default: send_conf (indd, nb_trait); break; } } else send_conf (indd, nb_trait); break; } return (0); } static void conferenciers (void) { int voie, vide = 1; texte (T_CNF + 1); for (voie = 0; voie < NBVOIES; voie++) { if ((svoie[voie]->conf) && (svoie[voie]->sta.connect >= 1)) { var_cpy (0, svoie[voie]->sta.indicatif.call); itoa ((voie > 0) ? voie - 1 : voie, varx[1], 10); texte (T_CNF + 2); vide = 0; } } if (vide) texte (T_CNF + 7); } char *k_var (void) { int voie, vide = 1; static char buffer[257]; *buffer = '\0'; for (voie = 0; voie < NBVOIES; voie++) { if ((svoie[voie]->conf) && (svoie[voie]->sta.connect >= 1)) { if (!vide) strcat (buffer, ", "); strcat (buffer, svoie[voie]->sta.indicatif.call); vide = 0; } } if (vide) strcpy (buffer, langue[vlang]->plang[T_CNF + 7 - 1]); return (buffer); } void text_conf (int numero) { int save_voie = voiecur; int voie; var_cpy (0, pvoie->sta.indicatif.call); for (voie = 0; voie < NBVOIES; voie++) { if ((svoie[voie]->sta.connect) && (voie != save_voie) && (svoie[voie]->conf)) { selvoie (voie); texte (numero); aff_etat ('E'); send_buf (voie); } } selvoie (save_voie); } static void send_conf (char *txt_conf, int nbcar) { int save_voie = voiecur; int voie; for (voie = 0; voie < NBVOIES; voie++) { if ((voie != save_voie) && (svoie[voie]->conf)) { selvoie (voie); pvoie->lignes = -1; if (cnf_prec != save_voie) { var_cpy (0, svoie[save_voie]->sta.indicatif.call); texte (T_CNF + 6); } out (txt_conf, nbcar); aff_etat ('E'); send_buf (voie); } } selvoie (save_voie); cnf_prec = voiecur; } fbb-7.0.10/src/fbb_conf.c0000644000175000017500000001245413747536100011756 00000000000000/*********************************************************************** Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ***********************************************************************/ #include #include #include #include #define FBBCONFFILE "/usr/local/etc/ax25/fbb/fbb.conf" /* Default values for the fbb.conf file */ static char *defstr[] = { "conf", "/usr/local/etc/ax25/fbb", "data", "/usr/local/var/ax25/fbb", "mess", "/usr/local/var/ax25/fbb/mail", "comp", "/usr/local/var/ax25/fbb/binmail", "fbbd", "*,*,/usr/local/var/ax25/fbb/fbbdos,*,*,*,*,*", "yapp", "/usr/local/var/ax25/fbb/fbbdos/yapp", "docs", "/usr/local/share/doc/fbb", "sysm", "", "impo", "/usr/local/var/ax25/fbb/mail/mail.in", "logs", "OK", "test", "NO", "fbbf", "OK 160", "fbbc", "OK 3", "aski", "OK", "mask", "3616", "secu", "0 4 59", "warn", "255", "hous", "2", "time", "10 20", "maxd", "0 0", "loca", "0", "beac", "8", "scro", "1500 1500 1500", "fwdh", "[$c] $$:$R", "maxb", "30000", "life", "30", "wpca", "", "zipc", "000000", "unpr", "500 5 P", "upba", "", "dwba", "", "pg", "/usr/local/lib/fbb/pg", "fdir", "/usr/local/lib/fbb/filter", "sdir", "/usr/local/lib/fbb/server", "tdir", "/usr/local/lib/fbb/tool", "poph", "", NULL }; /* a keyword has a maximum of 4 characters */ typedef struct conf_list { char key[5]; char *value; struct conf_list *next; } ConfList; static ConfList *conf_head = NULL; /* Creates a list of keyword = value */ int read_fbb_conf(char *pathname) { int i; int len; FILE *fp; char *ptr; char *scan; char line[256]; ConfList *conf; if (pathname == NULL) if ((pathname = getenv("FBBCONF")) == NULL) pathname = FBBCONFFILE; if ((fp = fopen (pathname, "r")) == NULL) return 1; while (fgets (line, sizeof(line), fp)) { scan = line; /* Eats spaces */ while (isspace(*scan)) ++scan; if (*scan == '#' || *scan == '\0') continue; /* remove the leading \n */ len = strlen(scan); if (len && (scan[len-1] == '\n')) scan[len-1] = '\0'; /* allocate a new structure */ conf = malloc(sizeof(ConfList)); if (conf == NULL) return 2; /* Not enough memory */ conf->value = NULL; conf->next = conf_head; conf_head = conf; /* extract the keyword */ i = 0; ptr = conf->key; while (isgraph(*scan)) { if (i++ < 4) { *ptr++ = *scan; } ++scan; if (*scan == '=') break; } *ptr = '\0'; /* finds the '=' */ scan = strchr(scan, '='); /* Copy the value */ if (scan) { ++scan; while (isspace(*scan)) ++scan; /* if the first character is '"' then string ends with '"' */ if (*scan == '"') { ++scan; ptr = strrchr(scan, '"'); if (ptr) *ptr = '\0'; } conf->value = strdup(scan); } else { conf->value = strdup(""); } } fclose(fp); return 0; } /* returns the value of a keyword. If unknown return NULL */ char *find_fbb_conf(char *key, int next) { static ConfList *conf_next = NULL; ConfList *conf = conf_head; if (next) conf = conf_next; while (conf) { if (strncasecmp(key, conf->key, 4) == 0) { conf_next = conf->next; return strdup(conf->value); } conf = conf->next; } return NULL; } /* returns the default value of a keyword. If unknown return NULL */ char *def_fbb_conf(char *key) { int pos; for (pos = 0 ; defstr[pos] ; pos += 2) { if (strncasecmp(key, defstr[pos], 4) == 0) { return strdup(defstr[pos+1]); } } return NULL; } /* free the list of keywords */ void free_fbb_conf(void) { ConfList *conf; while (conf_head) { conf = conf_head; conf_head = conf_head->next; free(conf->value); free(conf); } } /* get the list of default values */ char *get_fbb_def(int next) { static int pos = 0; char str[512]; if (next == 0) pos = 0; if (defstr[pos]) { sprintf(str, "%s\t%s", defstr[pos], defstr[pos+1]); pos += 2; return strdup(str); } return NULL; } /* get the list of all values */ char *get_fbb_all(int next) { static int first = 1; static int pos = 0; static ConfList *conf_next = NULL; char str[512]; if (first) { first = 0; pos = 0; conf_next = conf_head; } if (next == 0) { pos = 0; conf_next = conf_head; } if (conf_next) { sprintf(str, "s %s\t%s", conf_next->key, conf_next->value); conf_next = conf_next->next; return strdup(str); } while (defstr[pos]) { if (!find_fbb_conf(defstr[pos], 0)) { sprintf(str, "d %s\t%s", defstr[pos], defstr[pos+1]); pos += 2; return strdup(str); } else { pos += 2; } } return NULL; } fbb-7.0.10/src/mbl_sys.c0000644000175000017500000001507213613360505011663 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #if defined(__FBBDOS__) || defined(__WINDOWS__) #define random_nb(val) random(val) #endif /* Teste si l'utilisateur a ou aura les droits apres la cmde SYS */ int droits_2 (unsigned int droit) { FILE *fptr; char indic[80]; char buffer[300]; unsigned ds, dss; if (droits (droit)) return (TRUE); if ((SYS (pvoie->finf.flags)) && (droit & ds_droits)) return (TRUE); /* Acces a la cmde SYS ? */ if (SYS (pvoie->finf.flags)) { if ((fptr = fopen (c_disque ("passwd.sys"), "rt")) != NULL) { if (fgets (buffer, 300, fptr)) { while (fgets (buffer, 300, fptr)) { sup_ln (buffer); if (*buffer == '#') continue; *indic = '\0'; ds = dss = 0; sscanf (buffer, "%s %u %u", indic, &ds, &dss); if (strcmp (pvoie->sta.indicatif.call, strupr (indic)) == 0) { fclose (fptr); return ((droit & dss) && (ds & CMDSYS)); } } } fclose (fptr); } return ((droit & dss_droits) && (ds_droits & CMDSYS)); } return (FALSE); } void change_droits (int voie) { FILE *fptr; char indic[80]; char buffer[300]; unsigned ds, dss; if (SYS (svoie[voie]->finf.flags)) { if ((fptr = fopen (c_disque ("passwd.sys"), "rt")) != NULL) { if (fgets (buffer, 300, fptr)) { while (fgets (buffer, 300, fptr)) { sup_ln (buffer); if (*buffer == '#') continue; *indic = '\0'; ds = dss = 0; sscanf (buffer, "%s %u %u", indic, &ds, &dss); if (strcmp (svoie[voie]->sta.indicatif.call, strupr (indic)) == 0) { fclose (fptr); if (*svoie[voie]->passwd) svoie[voie]->droits = dss; else svoie[voie]->droits = ds; return; } } } fclose (fptr); } if (*svoie[voie]->passwd) svoie[voie]->droits = dss_droits; else svoie[voie]->droits = ds_droits; } else svoie[voie]->droits = d_droits; } int comp_passwd (char *call, char *chaine, time_t pass_time) { int ok = 0; unsigned ds, dss; char indic[80]; char buffer[300]; char password[300]; char *ptr = NULL; FILE *fptr; int first = 1; if (*chaine == '!') { ++chaine; while (!ISGRAPH (*chaine)) ++chaine; } if (strlen (chaine) > 256) chaine[256] = '\0'; if ((fptr = fopen (c_disque ("passwd.sys"), "rt")) != NULL) { while (fgets (buffer, 300, fptr)) { sup_ln (buffer); ptr = buffer; if ((!isgraph (*buffer)) || (*buffer == '#')) continue; if (first) { /* Skip the first line */ first = 0; continue; } *indic = '\0'; ds = dss = 0; sscanf (buffer, "%s %u %u %[^\n]", indic, &ds, &dss, password); ptr = password; if (strcmpi (call, indic) == 0) { while (isspace (*ptr)) ++ptr; ok = 1; break; } } if (!ok) { rewind (fptr); while (fgets (buffer, 300, fptr)) { sup_ln (buffer); if ((!isgraph (*buffer)) || (*buffer == '#')) continue; ptr = buffer; /* Get global password */ /* sscanf (buffer, "%[^\n]", ptr); */ break; } } ok = (strcmpi (chaine, ptr) == 0); fclose (fptr); } if (!ok) { /* Checks MD5 */ uchar source[300]; uchar dest[80]; sprintf (source, "%010ld%s", pass_time, ptr); MD5String (dest, source); ok = (stricmp (dest, chaine) == 0); } return (ok); } char *mk_passwd (char *chaine) { static char str[80]; char temp[20]; int lg, i, rd; char *ptr = chaine; randomize (); lg = strlen (chaine); i = 0; sprintf (str, "%s-%d> ", mycall, myssid); while (*ptr) { if (ISGRAPH (*ptr)) ++i; ++ptr; } if (i > 7) { for (i = 0; i < 5; i++) { while (1) { rd = random_nb (lg); if (ISGRAPH (chaine[rd])) break; } pvoie->passwd[i] = toupper (chaine[rd]); chaine[rd] = '\0'; sprintf (temp, " %d", rd + 1); strcat (str, temp); } } else { strcat (str, " 0 0 0 0 0"); } /* MD5 password implementation */ pvoie->pass_time = time (NULL); sprintf (temp, " [%010ld]", pvoie->pass_time); strcat (str, temp); return (str); } char *snd_passwd (char *chaine) { int ok = 0; unsigned ds, dss; char indic[80]; char buffer[300]; char *ptr, *ind; FILE *fptr; int first = 1; sprintf (chaine, "%s-%d> ", mycall, myssid); *pvoie->passwd = 1; if ((fptr = fopen (c_disque ("passwd.sys"), "rt")) != NULL) { while (fgets (buffer, 300, fptr)) { ind = indic; ptr = buffer; if ((!isgraph (*buffer)) || (*buffer == '#')) continue; if (first) { /* Skip the first line */ first = 0; continue; } *indic = '\0'; ds = dss = 0; sscanf (buffer, "%s %u %u %[^\n]", indic, &ds, &dss, ptr); if (strcmp (pvoie->sta.indicatif.call, strupr (indic)) == 0) { while (isspace (*ptr)) ++ptr; ok = 1; break; } } if (!ok) { rewind (fptr); while (fgets (buffer, 300, fptr)) { if ((!isgraph (*buffer)) || (*buffer == '#')) continue; ptr = buffer; /* Get global password */ sscanf (buffer, "%[^\n]", ptr); break; } } strcpy (chaine, mk_passwd (buffer)); fclose (fptr); } return (chaine); } int tst_passwd (char *chaine) { int ok; sup_ln (chaine); /* strupr(chaine) */ ok = ((*chaine != '!') && (!strncmpi (chaine, pvoie->passwd, 5))); if (!ok) { ok = (comp_passwd (pvoie->sta.indicatif.call, chaine, pvoie->pass_time)); } return (ok); } #define PROTOTYPES 1 #include "global.h" #include "md5.h" void MD5String (uchar *dest, uchar *source) { int i; MD5_CTX context; uchar digest[16]; unsigned int len = strlen (source); MD5Init (&context); MD5Update (&context, source, len); MD5Final (digest, &context); *dest = '\0'; for (i = 0; i < 16; i++) { char tmp[5]; sprintf (tmp, "%02X", digest[i]); strcat (dest, tmp); } } fbb-7.0.10/src/dos_1.c0000644000175000017500000006507613613360505011231 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #include /* * Module FBBdos */ static int execute_dos(void); static int rx_file(char *, int); static void copy_file(void); static void dos_copy(void); static void edit_label(void); static void help_appel(char **); static void menu_dos(void); static void put_file(void); static void view(void); static int where_loop; /* * F_FILTER feature * * Parameters : * Callsign-SSID * Temp filename * Number of the calling process (Xmodem=11, YAPP=17) * Number of the user's record in INF.SYS * * Return value * 0 : File OK, can be recorded. * 1 : File not OK, will be discarded. * * Comments * The datas sent to stdout by F_FILTER * will be redirected to the user. */ /* return the next argument from indd and updates the indd pointer */ char *get_nextparam(void) { char *ptr; while (*indd && isspace(*indd)) ++indd; if (*indd == '"') { ptr = ++indd; while (*indd && (*indd != '"')) ++indd; if (*indd) *indd++ = '\0'; } else { ptr = indd; while (*indd && isgraph(*indd)) ++indd; if (*indd) *indd++ = '\0'; } return (*ptr) ? ptr : NULL; } int test_temp(int voie) { static int test = 1; int retour = 1; int ret; char temp[128]; char s[256]; temp_name(voie, temp); indd[80] = '\0'; if (test) { char dir[80]; char file[80]; FILE *fptr; #ifdef __linux__ strcpy(dir, "X:/"); /* fill string with form of response: X:/ */ #else strcpy(dir, "X:\\"); /* fill string with form of response: X:\ */ #endif dir[0] = 'A' + getdisk(); /* replace X with current drive letter */ getcurdir(0, dir + 3); /* fill rest of string with current directory */ #ifdef __linux__ sprintf(file, "%s/f_filter.%02d", dir, voiecur); #else sprintf(file, "%s\\f_filter.%02d", dir, voiecur); #endif #ifdef __linux__ strcpy(file, back2slash(file)); #endif if ((fptr = fopen(file, "wt")) == NULL) return (-1); fprintf(fptr, "#\n# Downloaded File information\n#\n"); #ifdef __linux__ fprintf(fptr, "TempName = %s\n", back2slash(temp)); fprintf(fptr, "FileName = %s\n", back2slash(pvoie->sr_fic)); #else fprintf(fptr, "TempName = %s\n", temp); fprintf(fptr, "FileName = %s\n", pvoie->sr_fic); #endif fprintf(fptr, "Label = %s\n", pvoie->label); fprintf(fptr, "#\n"); fclose(fptr); { char buffer[1024]; *buffer = '\0'; #ifdef __linux__ /* sprintf(s, "%sf_filter %s-%d %d %u %s", FILTDIR,*/ sprintf(s, "./f_filter %s-%d %d %u %s", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv1, pvoie->ncur->coord, file); ret = filter(s, buffer, sizeof(buffer), NULL, FILTDIR); #else sprintf(s, "f_filter %s-%d %d %u %s", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv1, pvoie->ncur->coord, file); ret = filter(s, buffer, sizeof(buffer), NULL, NULL); #endif buffer[1023] = '\0'; if (*buffer) out(buffer, strlen(buffer)); } unlink(file); switch (ret) { case -1: test = 0; clear_outbuf(voiecur); break; case 1: retour = 0; break; default: break; } } return (retour); } int user_ok(void) { if (droits(MODLABEL | SUPFIC | ACCESDOS)) return (1); if (*pvoie->finf.priv) return (1); if (P_MODM(voiecur)) { if (max_mod == 0) return (1); if (pvoie->finf.download > max_mod) return (0); } else { if (max_yapp == 0) { return (1); } if (pvoie->finf.download > max_yapp) { return (0); } } return (1); } void retour_dos(void) { retour_niveau(); prompt(pvoie->finf.flags, pvoie->niv1); } char *local_path(char *chaine) { int size, lg; static char temp[256]; strcpy(temp, chaine); size = lg = strlen(temp); if ((lg > 2) && (temp[1] == ':')) size = lg - 2; if (size > 1) if (temp[lg - 1] == '\\') temp[lg - 1] = '\0'; return (temp); } int tst_point(char *chaine) { char *ptr; char vdisk; if ((voiecur != CONSOLE) && (pvoie->kiss != -2) && ((ptr = strchr(chaine, ':')) != NULL)) { --ptr; vdisk = toupper(*ptr) - 'A'; if (vdisk == 15) { if (*pvoie->finf.priv == '\0') { texte(T_ERR + 29); return (FALSE); } } else if ((vdisk > 7) || (PATH[(int) vdisk][0] == '\0')) { texte(T_ERR + 29); return (FALSE); } } if (!droits(ACCESDOS)) { if (strstr(chaine, "..") || strstr(chaine, "~")) { texte(T_ERR + 15); return (FALSE); } } return (TRUE); } #if 0 /* * Attend une structure tm en entree * Retourne le nombre de secondes depuis 1-1-1970 */ static long date_to_second(struct tm *dat) { static char Days[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; long x; register int i; register int days; int hours; x = 24L * 60L * 60L * 3652L + timezone; /* Convertit de 1980 a 1970 */ i = dat->tm_year; if (i > 1900) i -= 1900; x += (i >> 2) * (1461L * 24L * 60L * 60L); x += (i & 3) * (24L * 60L * 60L * 365L); if (i & 3) x += 24L * 3600L; days = 0; i = dat->tm_mon - 1; while (i > 0) { i--; days += Days[i]; } days += dat->tm_mday - 1; if (dat->tm_mon > 2 && (dat->tm_year & 3) == 0) days++; /* bissextile */ hours = days * 24 + dat->tm_hour; /* Heures */ x += hours * 3600L; x += 60L * dat->tm_min + dat->tm_sec; return (x); } #endif void send_file(int type) { int fin, retour; char *ptr; struct stat bufstat; switch (pvoie->niv3) { case 0: if (!user_ok()) { texte(T_ERR + 18); retour_dos(); break; } fin = 0; if (type) pvoie->lignes = -1; get_nextparam(); if ((ptr = get_nextparam()) == NULL) fin = T_ERR + 20; else if (tst_point(ptr)) { strcpy(pvoie->sr_fic, tot_path(ch_slash(ptr), pvoie->dos_path)); retour = stat(pvoie->sr_fic, &bufstat); strcpy(pvoie->appendf, ptr); if ((retour == -1) || ((bufstat.st_mode & S_IFREG) == 0)) { fin = T_ERR + 11; } else { pvoie->enrcur = 0L; pvoie->size_trans = 0L; pvoie->temp2 = type; if (senddata(0)) { fin = -1; pvoie->finf.download += (int) (pvoie->size_trans / 1024L); } else ch_niv3(1); } } if (fin) { if (type) ctrl_z(); if (fin > 0) texte(fin); retour_dos(); } break; case 1: if (senddata(0)) { if (pvoie->temp2) ctrl_z(); pvoie->finf.download += (int) (pvoie->size_trans / 1024L); retour_dos(); } break; } } void put_file(void) { FILE *fptr; obuf *msgtemp; char temp[128]; if ((fptr = fopen(temp_name(voiecur, temp), "at")) != NULL) { while ((msgtemp = pvoie->msgtete) != NULL) { fwrite(msgtemp->buffer, msgtemp->nb_car, 1, fptr); pvoie->memoc -= msgtemp->nb_car; pvoie->msgtete = msgtemp->suiv; m_libere((char *) msgtemp, sizeof(*msgtemp)); } fclose(fptr); } libere(voiecur); } static int rx_file(char *ptr, int nbcar) { int ncars; obuf *msgtemp; char *ptcur; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue(sizeof(obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; while (nbcar--) { if (*ptr == '\32') { msgtemp->nb_car = ncars; put_file(); ltoa(pvoie->tailm, varx[0], 10); texte(T_DOS + 5); return (FALSE); } ++pvoie->tailm; if (*ptr == '\r') { ++pvoie->tailm; *ptr = '\n'; } ++pvoie->memoc; *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue(sizeof(obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } msgtemp->nb_car = ncars; if (pvoie->memoc > MAXMEM) put_file(); return (TRUE); } void receive_file(void) { char *ptr; struct stat bufstat; switch (pvoie->niv3) { case 0: if (read_only()) { retour_dos(); break; } get_nextparam(); if ((ptr = get_nextparam()) == NULL) { texte(T_ERR + 20); retour_dos(); break; } if ((!tst_point(ptr)) || (!aut_ecr(ch_slash(ptr), 1))) { retour_dos(); break; } entete_saisie(); pvoie->tailm = 0L; n_cpy(40, pvoie->appendf, ptr); strcpy(pvoie->sr_fic, tot_path(ch_slash(pvoie->appendf), pvoie->dos_path)); if (stat(pvoie->sr_fic, &bufstat) == -1) { del_temp(voiecur); /* unlink(pvoie->sr_fic) ; */ pvoie->xferok = 0; texte(T_YAP + 3); maj_niv(9, 3, 2); } else { texte(T_ERR + 23); retour_dos(); } break; case 1: if (rx_file(indd, nb_trait) == 0) { pvoie->xferok = 1; if (test_temp(voiecur)) { rename_temp(voiecur, pvoie->sr_fic); wr_dir(pvoie->sr_fic, pvoie->sta.indicatif.call); } retour_dos(); } break; case 2: new_label(); texte(T_DOS + 6); maj_niv(9, 3, 1); break; } } void dos_copy(void) { struct stat bufstat; int fd_orig, fd_dest; long nb_oct; Rlabel rlabel; FILE *fptr; char *ptri, *ptro, *ptr; char orig[80]; int r; get_nextparam(); if ((ptri = get_nextparam()) == NULL) { texte(T_ERR + 20); return; } if ((ptro = get_nextparam()) == NULL) { texte(T_ERR + 21); return; } if (strcmpi(ptri, ptro) == 0) { texte(T_ERR + 23); return; } if (!tst_point(ptri)) return; if (!tst_point(ptro)) return; strcpy(orig, tot_path(ch_slash(ptri), pvoie->dos_path)); stat(orig, &bufstat); strcpy(pvoie->appendf, ptri); if ((bufstat.st_mode & S_IFREG) == 0) { texte(T_ERR + 11); return; } if ((fd_orig = open(orig, O_RDONLY | O_BINARY)) == EOF) { texte(T_ERR + 11); return; } if (!aut_ecr(ch_slash(ptro), 1)) { close(fd_orig); return; } strcpy(pvoie->appendf, ptro); strcpy(pvoie->sr_fic, tot_path(ch_slash(ptro), pvoie->dos_path)); r = stat(pvoie->sr_fic, &bufstat); if ((r == 0 && (bufstat.st_mode & S_IFREG) == 0) || errno != ENOENT) { texte(T_ERR + 11); return; } if ((fd_dest = open(pvoie->sr_fic, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE)) == EOF) { texte(T_ERR + 30); close(fd_orig); return; } nb_oct = copy_fic(fd_orig, fd_dest, NULL); close(fd_orig); close(fd_dest); wr_dir(pvoie->sr_fic, pvoie->sta.indicatif.call); *rlabel.label = '\0'; ptr = vir_path(orig); fptr = NULL; if ((ptr) && ((fptr = fopen(d_disque("YAPPLBL.DAT"), "rb")) != NULL)) { while (fread(&rlabel, sizeof(Rlabel), 1, fptr)) { if (strcmp(ptr, rlabel.nomfic) == 0) { fclose(fptr); fptr = NULL; w_label(pvoie->sr_fic, rlabel.label); break; } } } if (fptr) fclose(fptr); ltoa(nb_oct, varx[0], 10); texte(T_DOS + 7); return; } void copy_file(void) { if (!read_only()) dos_copy(); prompt_dos(); } void del_file(void) { char *ptr; if (!read_only()) { get_nextparam(); if ((ptr = get_nextparam()) == NULL) { texte(T_ERR + 20); } else { if (tst_point(ptr)) { if (aut_ecr(ch_slash(ptr), 1)) { strcpy(pvoie->appendf, ptr); if (unlink(tot_path(ptr, pvoie->dos_path)) == 0) texte(T_DOS + 10); else texte(T_ERR + 11); } } } } retour_dos(); } static void edit_label(void) { char *ptr; switch (pvoie->niv3) { case 0: if (droits(MODLABEL)) { struct stat st; get_nextparam(); if ((ptr = get_nextparam()) == NULL) { texte(T_ERR + 20); retour_dos(); break; } if (!tst_point(ptr) || !aut_ecr(ptr, 0)) { retour_dos(); break; } n_cpy(40, pvoie->appendf, ptr); strcpy(pvoie->sr_fic, tot_path(ch_slash(pvoie->appendf), pvoie->dos_path)); if (stat(pvoie->sr_fic, &st) == -1) { texte(T_ERR + 11); retour_dos(); break; } texte(T_YAP + 3); ch_niv3(1); } else { texte(T_ERR + 1); retour_dos(); } break; case 1: while ((*indd) && (!ISPRINT(*indd))) ++indd; if (ISGRAPH(*indd)) { w_label(pvoie->sr_fic, sup_ln(indd)); cr(); dir_yapp(pvoie->appendf); } retour_dos(); break; } } void help_appel(char *appel[]) { char s[80]; int i = 0; texte(T_DOS + 8); texte(T_DOS + 9); while (1) { if (*appel[i] == '\0') break; sprintf(s, "%-10s", appel[i]); outs(s, strlen(s)); if ((++i % 6) == 0) outs("\n", 1); } outs("\n\n", 2); } #ifdef __WINDOWS__ static int execute_dos(void) { char buf[80]; char cmd[256]; int disk; int i; int ret; char cur_dir[MAXPATH]; char fbbdos_dir[MAXPATH]; while (isalnum(*indd)) ++indd; while_space(); if (*indd) { /* recupere disque et repertoire courants */ disk = getdisk(); strcpy(cur_dir, "X:\\"); cur_dir[0] = 'A' + disk; getcurdir(0, cur_dir + 3); strcpy(fbbdos_dir, tot_path("", pvoie->dos_path)); if ((i = strlen(fbbdos_dir)) > 3) fbbdos_dir[i - 1] = '\0'; operationnel = 2; { char deroute[80]; wsprintf(deroute, "%sexecute.$$$", MBINDIR); ret = call_nbdos(&indd, 1, REPORT_MODE, deroute, fbbdos_dir, NULL); if (ret != -1) outfichs(deroute); unlink(deroute); } operationnel = 1; if (ret == -1) texte(T_ERR + 8); else if (ret != 0) { texte(T_ERR + 8); wsprintf(buf, "Errorlevel = %d", ret); outln(buf, strlen(buf)); } } else { texte(T_ERR + 20); } prompt_dos(); return (1); } #endif #ifdef __linux__ static int execute_dos(void) { char buf[256]; int ret; /* run a task under linux. This task is blocking ... */ /* Skip DOS command */ while (isalnum(*indd)) ++indd; while_space(); operationnel = 2; { char deroute[80]; char fbbdos_dir[256]; char *ptr; int i; strcpy(fbbdos_dir, tot_path("", pvoie->dos_path)); if ((i = strlen(fbbdos_dir)) > 3) fbbdos_dir[i - 1] = '\0'; sprintf(deroute, "%sexecute.xxx", MBINDIR); ptr = indd; /* Look for a semi-column or pipe command */ while (*ptr) { if (*ptr == ';' || *ptr == '|') { *ptr = '\0'; break; } ptr++; } ret = call_nbdos(&indd, 1, REPORT_MODE, deroute, fbbdos_dir, NULL); if (ret != -1) outfichs(deroute); unlink(deroute); } operationnel = 1; if (ret == -1) texte(T_ERR + 8); else if (ret != 0) { texte(T_ERR + 8); sprintf(buf, "Errorlevel = %d", ret); outln(buf, strlen(buf)); } prompt_dos(); return (1); } #endif #ifdef __FBBDOS__ static int execute_dos(void) { int retour = 1; static char slash_c[] = "/C"; char *arg[20]; char *ptr; char log[80]; int i = 0; int disk; int ofst; int duplic, oldstdout, oldstderr; char deroute[80]; char cur_dir[MAXPATH]; char fbbdos_dir[MAXPATH]; sprintf(deroute, "%s\\EXECUTE.$$$", getcwd(log, 80)); strtok(indd, " "); arg[i++] = getenv("COMSPEC"); arg[i++] = slash_c; while ((arg[i] = strtok(NULL, " ")) != NULL) ++i; if (i == 2) { retour = -1; texte(T_ERR + 20); } else { ofst = 2; ptr = strrchr(arg[2], '.'); if (ptr) { if (strcmp(strupr(ptr + 1), "BAT") == 0) ofst = 0; } deb_io(); /* redirige stdout et stderr sur le fichier EXECUTE.$$$ */ duplic = open(deroute, O_CREAT | O_RDWR, S_IWRITE | S_IREAD); oldstdout = dup(1); oldstderr = dup(2); dup2(duplic, 1); dup2(duplic, 2); close(duplic); /* recupere disque et repertoire courants */ disk = getdisk(); strcpy(cur_dir, "X:\\"); cur_dir[0] = 'A' + disk; getcurdir(0, cur_dir + 3); strcpy(fbbdos_dir, tot_path("", pvoie->dos_path)); setdisk(fbbdos_dir[0] - 'A'); if ((i = strlen(fbbdos_dir)) > 3) fbbdos_dir[i - 1] = '\0'; chdir(fbbdos_dir); operationnel = 2; break_ok(); retour = spawnvp(P_WAIT, arg[ofst], arg + ofst); if (retour == -1) { ofst = 0; retour = spawnvp(P_WAIT, arg[ofst], arg + ofst); } break_stop(); operationnel = 1; /* remet disque et repertoire courants */ setdisk(disk); chdir(cur_dir); /* Supprime les redirections */ dup2(oldstdout, 1); dup2(oldstderr, 2); close(oldstdout); close(oldstderr); fin_io(); outfich(deroute); unlink(deroute); if (retour == -1) texte(T_ERR + 8); else if (retour != 0) { texte(T_ERR + 8); sprintf(log, "Errorlevel = %d", retour); outln(log, strlen(log)); } } prompt_dos(); return (retour); } #endif static void view(void) { char *ptr; char temp[256]; get_nextparam(); ptr = get_nextparam(); if ((ptr) && (strchr(ptr, '/') == NULL)) { #ifdef __linux__ { static char *fbb_view = "fbb_view"; char *vptr = getenv("FBB_VIEW"); if (vptr == NULL) vptr = fbb_view; sprintf(temp, "DOS %s %s", vptr, back2slash(ptr)); } #else sprintf(temp, "DOS FV %s", ptr); #endif indd = temp; maj_niv(9, 99, 0); execute_dos(); cr(); } else { texte(T_ERR + 20); prompt_dos(); } } static int where(int lg, char *path, char *pattern) { struct ffblk ffblk; char rech[80]; char temp[128]; int done = 1; int premier = 1; int retour = 0; strcpy(rech, path); #ifdef __linux__ strcat(rech, "*"); #else strcat(rech, "*.*"); #endif ++where_loop; done = findfirst(rech, &ffblk, FA_DIREC); while (!done) { if (*ffblk.ff_name != '.') { if (ffblk.ff_attrib & FA_DIREC) { strcpy(temp, path); strcat(temp, ffblk.ff_name); strcat(temp, "\\"); if ((strncmp(temp + 1, ":\\PROC\\", 7) != 0) && (where_loop < 16)) { if (where(lg, temp, pattern)) retour = 1; } premier = 1; } else { if (strmatch(ffblk.ff_name, pattern)) { if (premier) { char v; if (pvoie->vdisk == 8) v = 'P'; else v = 'A' + pvoie->vdisk; sprintf(temp, "%c:%s :", v, path + lg); outln(temp, strlen(temp)); premier = 0; } *varx[4] = *varx[5] = *varx[6] = *varx[7] = '\0'; sprintf(varx[0], " %-13s", ffblk.ff_name); var_cpy(2, dir_date(ffblk.ff_fdate)); *varx[3] = '\0'; if ((ffblk.ff_attrib & FA_DIREC) != 0) { var_cpy(1, " "); } else { sprintf(varx[1], "%6ld", ffblk.ff_fsize); } texte(T_DOS + 3); retour = 1; if (pvoie->memoc >= MAXMEM) break; } } } done = findnext(&ffblk); } --where_loop; return (retour); } static void where_file(void) { int lg; int retour = 0; char *ptr; get_nextparam(); pvoie->noenr_menu = 0L; ptr = get_nextparam(); if (ptr == NULL) { texte(T_ERR + 20); retour_dos(); return; } if (tst_point(ptr)) { char cur_dir[80]; int sav_vdisk = pvoie->vdisk; for (pvoie->vdisk = 0; pvoie->vdisk < 9; ++pvoie->vdisk) { if (*PATH[(int)pvoie->vdisk] == '\0') continue; if ((pvoie->vdisk == 8) && (*pvoie->finf.priv == '\0')) continue; /* strcpy (cur_dir, tot_path ("\0", "\\")); */ strcpy(cur_dir, PATH[(int)pvoie->vdisk]); lg = strlen(cur_dir); where_loop = 0; if (where(lg - 1, cur_dir, ptr)) retour = 1; } pvoie->vdisk = sav_vdisk; } if (pvoie->memoc >= MAXMEM) outln("....", 4); else if (!retour) texte(T_DOS + 2); retour_dos(); } void menu_dos(void) { int i, error = 0; int vdisk; char *iptr, *optr, commande[80]; static char *appel[] = { "HELP", "?", "O", "DIR", "EDIT", "GET", "PUT", "CD", "MD", "MKDIR", "COPY", "DEL", "RD", "RMDIR", "TYPE", "DU", "YGET", "YPUT", "XGET", "XPUT", "LIST", "VIEW", "NEW", "LABEL", "WHERE", "X1GET", "ZGET", "ZPUT", "BGET", "BPUT", "EXIT", "QUIT", "F", "B", "\0" }; char com[80]; char temp[80]; limite_commande(); while (*indd && (!ISGRAPH(*indd))) indd++; strn_cpy(70, com, indd); sup_ln(indd); if (*indd == '\0') { prompt_dos(); return; } if (strncmp(com, "PRIV", 4) == 0) { fbb_log(voiecur, 'D', com); if (*pvoie->finf.priv) { pvoie->vdisk = 8; strcpy(pvoie->dos_path, "\\"); } else texte(T_ERR + 29); prompt_dos(); return; } if ((droits(EXEDOS)) && (strncmp(com, "DOS", 3) == 0)) { fbb_log(voiecur, 'D', com); maj_niv(9, 99, 0); execute_dos(); return; } if ((com[1] == ':') && (!ISGRAPH(com[2]))) { #ifdef __linux__ if (voiecur == CONSOLE) { static char *txt = "Cannot select a virtual disk in console mode"; outln(txt, strlen(txt)); prompt_dos(); return; } #endif vdisk = toupper(com[0]) - 'A'; if (vdisk == 15) { vdisk = 8; } strcat(com, "\\"); if ((voiecur == CONSOLE) && (is_dir(com))) { pvoie->vdisk = vdisk; strcpy(pvoie->dos_path, "\\"); } else if ((voiecur != CONSOLE) && (vdisk < 8) && (*PATH[vdisk])) { pvoie->vdisk = vdisk; strcpy(pvoie->dos_path, "\\"); } else if ((vdisk == 8) && (*pvoie->finf.priv)) { pvoie->vdisk = vdisk; strcpy(pvoie->dos_path, "\\"); } else texte(T_ERR + 29); prompt_dos(); return; } if ((strncmp(com, "HELP", 4) == 0) || (*com == '?') || (*com == 'H')) { if (*com == '?') ++indd; else { while (ISGRAPH(*indd)) ++indd; } while_space(); if (*indd == '\0') *--indd = '?'; if (!out_help(indd)) help_appel(appel); *indd = '\0'; } if ((strncmp(com, "CD", 2) == 0) && (ISGRAPH(*(com + 2)))) { sprintf(temp, "CD %s", com + 2); indd = temp; } if (*indd) { iptr = indd; optr = commande; while (ISGRAPH(*iptr)) { *optr = (islower(*iptr)) ? toupper(*iptr) : *iptr; iptr++; optr++; } *optr = '\0'; if (*commande == 'O') commande[1] = '\0'; i = 0; while (1) { optr = commande; var_cpy(0, optr); if (*appel[i] == '\0') { texte(T_ERR + 1); prompt_dos(); return; } if (strncmp(appel[i], optr, 3) == 0) break; ++i; } pvoie->temp1 = N_DOS; switch (i) { case 0: case 1: /* help_appel(appel) ; */ break; case 2: indd = com + 1; mbl_options(); retour_dos(); break; case 3: maj_niv(9, 1, 0); dir(); break; case 4: maj_niv(9, 9, 0); edit(); break; case 5: maj_niv(9, 2, 0); send_file(1); break; case 6: if (!is_room()) { outln("*** Disk full !", 15); error = 4; break; } maj_niv(9, 3, 0); receive_file(); break; case 7: maj_niv(9, 4, 0); change_dir(); break; case 8: case 9: maj_niv(9, 5, 0); make_dir(); break; case 10: if (!is_room()) { outln("*** Disk full !", 15); error = 4; break; } maj_niv(9, 6, 0); copy_file(); break; case 11: maj_niv(9, 7, 0); del_file(); break; case 12: case 13: maj_niv(9, 8, 0); remove_dir(); break; case 14: maj_niv(9, 2, 0); send_file(0); break; case 15: du(); break; case 16: if (!user_ok()) { error = 3; } else { if (P_MODM(voiecur)) { var_cpy(0, "YMODEM"); maj_niv(N_MOD, 4, XS_INIT); pvoie->type_yapp = 2; xmodem(); } else { indd += 3; *indd = 'D'; maj_niv(N_YAPP, 0, 0); menu_yapp(); } } break; case 17: if (!is_room()) { outln("*** Disk full !", 15); error = 4; break; } if (P_MODM(voiecur)) { #if defined(__WINDOWS__) || defined(__linux__) var_cpy(0, "YMODEM"); maj_niv(N_MOD, 4, XR_INIT); pvoie->type_yapp = 2; xmodem(); #else var_cpy(0, "YMODEM"); pvoie->type_yapp = 2; error = 2; #endif } else { indd += 3; *indd = 'U'; maj_niv(N_YAPP, 0, 0); menu_yapp(); } break; case 18: var_cpy(0, "XMODEM"); if (P_MODM(voiecur)) { if (!user_ok()) error = 3; else { maj_niv(N_MOD, 4, XS_INIT); pvoie->type_yapp = 0; xmodem(); } } else error = 2; break; case 19: if (!is_room()) { outln("*** Disk full !", 15); error = 4; break; } var_cpy(0, "XMODEM"); if (P_MODM(voiecur)) { maj_niv(N_MOD, 4, XR_INIT); pvoie->type_yapp = 0; xmodem(); } else error = 2; break; case 20: maj_niv(9, 10, 0); list(); break; case 21: maj_niv(9, 11, 0); view(); break; case 22: maj_niv(9, 12, 0); dir_new(); break; case 23: maj_niv(9, 14, 0); edit_label(); break; case 24: maj_niv(9, 16, 0); where_file(); break; case 25: var_cpy(0, "1K-XMODEM"); if (P_MODM(voiecur)) { if (!user_ok()) error = 3; else { maj_niv(N_MOD, 4, XS_INIT); pvoie->type_yapp = 1; xmodem(); } } else error = 2; break; case 26: var_cpy(0, "ZMODEM"); if (P_MODM(voiecur)) { if (!user_ok()) error = 3; else { maj_niv(N_MOD, 4, XS_INIT); pvoie->type_yapp = 3; xmodem(); } } else error = 2; break; case 27: if (!is_room()) { outln("*** Disk full !", 15); error = 4; break; } var_cpy(0, "ZMODEM"); if ((P_MODM(voiecur)) && ((BIOS(no_port(voiecur)) == P_WINDOWS) || (BIOS(no_port(voiecur)) == P_LINUX))) { if (!user_ok()) error = 3; else { maj_niv(N_MOD, 4, XR_INIT); pvoie->type_yapp = 3; xmodem(); } } else error = 2; break; case 28: if (!user_ok()) { error = 3; } else { maj_niv(N_BIN, 0, 0); bin_transfer(); } break; case 29: if (!is_room()) { outln("*** Disk full !", 15); error = 4; break; } maj_niv(N_BIN, 0, 4); bin_transfer(); break; case 30: case 31: case 32: error = 1; retour_mbl(); break; case 33: indd = com + 1; if (bye()) { error = 1; maj_niv(N_MENU, 0, 0); sortie(); } break; default: error = 1; retour_mbl(); break; } switch (error) { case 2: texte(T_YAP + 2); prompt_dos(); break; case 3: texte(T_ERR + 18); prompt_dos(); break; case 4: prompt_dos(); break; case 0: fbb_log(voiecur, 'D', com); break; } } else prompt_dos(); } void dos(void) { switch (pvoie->niv2) { case 0: menu_dos(); break; case 1: dir(); break; case 2: send_file(0); break; case 3: receive_file(); break; case 4: change_dir(); break; case 5: make_dir(); break; case 6: copy_file(); break; case 7: del_file(); break; case 8: remove_dir(); break; case 9: edit(); break; case 10: list(); break; case 11: view(); break; case 12: dir_new(); break; case 14: edit_label(); break; case 15: bin_transfer(); break; case 16: where_file(); break; case 99: execute_dos(); break; default: fbb_error(ERR_NIVEAU, "FBBDOS", pvoie->niv2); break; } } fbb-7.0.10/src/tnc.c0000644000175000017500000010464113660544402011002 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE TNC.C : INTERFACE AVEC LE TNC - MODE DUPLEX */ #include static int capture = 0; static int ch_canal (int); static int open_capture (void); static int pactor_cq (void); static void disp_freq (int); static void close_capture (void); static void gw_help (void); static void prog_indic (int); static void tnc_cmd (int, int); #define TNC_START 1 #define TNC_END 2 int connect_tnc (void) { df ("connect_tnc", 0); if (svoie[CONSOLE]->sta.connect) return (0); selvoie (CONSOLE); strn_cpy (6, pvoie->sta.indicatif.call, cons_call.call); pvoie->sta.indicatif.num = cons_call.num; if (voiecur == CONSOLE) { pvoie->timout = time_n; capture = 0; } else pvoie->timout = time_n; pvoie->tstat = pvoie->debut = time (NULL); pvoie->l_mess = 0L; pvoie->l_yapp = 0L; pvoie->ret = 0; pvoie->sid = 0; pvoie->pack = 0; pvoie->read_only = 0; pvoie->vdisk = 2; pvoie->msg_held = 0; pvoie->xferok = pvoie->mess_recu = 1; pvoie->mbl = 0; init_timout (voiecur); pvoie->temp3 = 0; pvoie->nb_err = 0; console = 1; maj_niv (N_TELL, 0, 0); pvoie->deconnect = FALSE; console_on (); aff_event (CONSOLE, 1); connexion (voiecur); nouveau (voiecur); pvoie->sta.connect = 16; change_droits (voiecur); aff_nbsta (); curseur (); ff (); return (TRUE); } static int open_capture (void) { capture = open (pvoie->appendf, O_CREAT | O_APPEND | O_WRONLY | O_TEXT, S_IREAD | S_IWRITE); if (capture < 0) { texte (T_ERR + 11); return (0); } return (capture); } static void close_capture (void) { close (capture); } void write_capture (char *text, int len) { int lg; char *ptr = text; if ((voiecur != CONSOLE) || (capture == 0)) return; for (lg = 0; lg < len; lg++) { if (*ptr == '\r') *ptr = '\n'; ++ptr; } if (open_capture ()) { write (capture, text, len); close_capture (); } ptr = text; for (lg = 0; lg < len; lg++) { if (*ptr == '\n') *ptr = '\r'; ++ptr; } } void duplex_tnc (void) { char *ptr; char s[81]; char buffer[300]; struct stat bufstat; int nb, novoie, fin, save_voie, noport, prompt = 1; int command; switch (pvoie->niv3) { case 0: if (read_only ()) { fin_tnc (); break; } pvoie->lignes = -1; texte (T_GAT + 0); aff_freq (); texte (T_GAT + 1); ch_niv3 (1); break; case 1: sup_ln (indd); strupr (indd); if ((*indd == 'E') || (*indd == 'Q')) fin_tnc (); else if (*indd == 'H') { gw_help (); texte (T_GAT + 1); } else { //noport = *indd - '0'; noport = atoi(indd); if ((voiecur != CONSOLE) && (noport == no_port (voiecur))) { texte (T_GAT + 6); texte (T_GAT + 1); } else { if ((noport > 0) && (noport < NBPORT) && (p_port[noport].pvalid) && (((p_port[noport].moport & 0x8) == 0) || (voiecur == CONSOLE)) && ((p_port[noport].moport & 0x10) || (droits (ACCGATE)))) { if ((novoie = ch_canal (noport)) > 0) { /* *getvoie(novoie] = *pvoie; */ svoie[novoie]->debut = time (NULL); svoie[novoie]->kiss = voiecur; init_timout (novoie); svoie[novoie]->sta.connect = 17; svoie[novoie]->lignes = -1; svoie[novoie]->xferok = 1; svoie[novoie]->msg_held = 0; svoie[novoie]->mess_recu = 1; set_binary (novoie, 0); svoie[novoie]->pack = 0; svoie[novoie]->read_only = 0; svoie[novoie]->vdisk = 2; svoie[novoie]->mbl = 0; svoie[novoie]->finf.lang = pvoie->finf.lang; svoie[novoie]->l_mess = 0L; svoie[novoie]->l_yapp = 0L; svoie[novoie]->temp3 = 0; svoie[novoie]->nb_err = 0; svoie[novoie]->niv1 = 0; svoie[novoie]->niv2 = 0; svoie[novoie]->niv3 = 0; if (voiecur == CONSOLE) { *svoie[novoie]->passwd = 'O'; svoie[novoie]->finf.flags |= F_SYS; } pvoie->cross_connect = novoie; itoa ((novoie > 0) ? novoie - 1 : 0, varx[0], 10); var_cpy (1, p_port[noport].freq); texte (T_GAT + 2); if (p_port[no_port (novoie)].typort == TYP_BPQ) { command = 1; sta_drv (novoie, CMDE, (void *) &command); texte (T_GAT + 5); ch_niv3 (3); } else { texte (T_GAT + 4); ch_niv3 (2); } prog_indic (novoie); aff_nbsta (); tnc_cmd (TNC_START, novoie); } else { texte (T_GAT + 3); texte (T_GAT + 1); } } else { texte (T_GAT + 7); texte (T_GAT + 1); } } } break; case 2: sup_ln (indd); strupr (indd); pvoie->lignes = -1; if (strlen (indd)) { *buffer = '\0'; *indd = toupper (*indd); #ifndef __linux__ if (p_port[no_port (pvoie->cross_connect)].typort == TYP_MOD) { switch (*indd) { case 'Q': case 'E': save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); selvoie (save_voie); fin_tnc (); return; case 'D': save_voie = voiecur; selvoie (pvoie->cross_connect); md_no_echo (voiecur); dec (voiecur, 1); selvoie (save_voie); break; case 'K': texte (T_GAT + 5); ch_niv3 (3); return; case 'P': save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); tnc_cmd (TNC_END, voiecur); if (p_port[no_port (voiecur)].typort == TYP_MOD) re_init_modem (voiecur); pvoie->kiss = -1; pvoie->sta.connect = FALSE; selvoie (save_voie); pvoie->cross_connect = -1; incindd (); if (*indd) ch_niv3 (1); else ch_niv3 (0); duplex_tnc (); return; case 'S': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { incindd (); strcpy (pvoie->appendf, indd); if ((stat (pvoie->appendf, &bufstat) == -1) || ((bufstat.st_mode & S_IFREG) == 0)) { texte (T_ERR + 11); break; } texte (T_GAT + 10); save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); status (voiecur); strcpy (pvoie->sr_fic, indd); pvoie->enrcur = 0L; fin = senddata (0); if (!fin) { maj_niv (N_TELL, 0, 4); prompt = 0; } selvoie (save_voie); if (!fin) ch_niv3 (5); else { texte (T_GAT + 5); ch_niv3 (3); } } else texte (T_GAT + 3); break; case 'W': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { incindd (); if (*indd) { strcpy (pvoie->appendf, indd); if (open_capture ()) { texte (T_GAT + 11); close (capture); } } else { if (capture) { texte (T_GAT + 12); capture = 0; } else texte (T_ERR + 0); } } else texte (T_GAT + 3); break; default: save_voie = voiecur; selvoie (pvoie->cross_connect); outln (indd, strlen (indd)); selvoie (save_voie); break; } } else if (p_port[no_port (pvoie->cross_connect)].typort != TYP_BPQ) #endif { /* DED && KAM && FLEX && LINUX */ switch (*indd) { case 'Q': case 'E': save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); dec (voiecur, 1); selvoie (save_voie); fin_tnc (); return; case 'K': prog_indic (pvoie->cross_connect); texte (T_GAT + 5); ch_niv3 (3); return; case 'C': pvoie->ch_mon = -1; if (*(indd + 1) == 'Q') { if (!pactor_cq ()) texte (T_ERR + 2); } else if ((*(indd + 1) != ' ') && (p_port[no_port (voiecur)].typort != TYP_BPQ)) { texte (T_ERR + 2); } else { save_voie = voiecur; selvoie (pvoie->cross_connect); *buffer = '\0'; if (p_port[no_port (voiecur)].typort == TYP_PK) *(indd + 1) = 'O'; nb = 0; deb_io (); switch (p_port[no_port (voiecur)].typort) { case TYP_DED: case TYP_HST: prog_indic (voiecur); if (!IS_PACTOR (no_port (voiecur)) && (DRSI (no_port (voiecur)) || HST (no_port (voiecur)))) { while (ISGRAPH (*indd)) ++indd; while (isspace (*indd)) ++indd; sprintf (buffer, "C %d:%s", p_port[no_port (voiecur)].ccanal, indd); } else strcpy (buffer, indd); tnc_commande (voiecur, buffer, SNDCMD); break; case TYP_PK: tnc_commande (voiecur, indd, SNDCMD); break; case TYP_KAM: kam_commande (voiecur, indd); break; case TYP_BPQ: texte (T_GAT + 5); ch_niv3 (3); break; #ifdef __WINDOWS__ case TYP_AGW: #endif case TYP_SCK: case TYP_TCP: case TYP_ETH: case TYP_FLX: prog_indic (voiecur); tnc_commande (voiecur, indd, SNDCMD); break; } fin_io (); selvoie (save_voie); outs (buffer, nb); aff_nbsta (); } break; case 'D': save_voie = voiecur; selvoie (pvoie->cross_connect); *buffer = '\0'; nb = 0; deb_io (); switch (p_port[no_port (voiecur)].typort) { case TYP_DED: case TYP_HST: case TYP_SCK: case TYP_TCP: case TYP_ETH: case TYP_FLX: #ifdef __WINDOWS__ case TYP_AGW: #endif tnc_commande (voiecur, "D", SNDCMD); break; case TYP_PK: tnc_commande (voiecur, "DI", SNDCMD); break; case TYP_KAM: kam_commande (voiecur, "D"); break; } fin_io (); selvoie (save_voie); outs (buffer, nb); break; case 'J': //j_list ((char) no_port (pvoie->cross_connect) + '0'); j_list (no_port (pvoie->cross_connect), 0); break; case 'M': if (pvoie->ch_mon == -1) { pvoie->ch_mon = no_port (pvoie->cross_connect); sprintf (s, "%s: MONITOR ON", my_call); } else { pvoie->ch_mon = -1; sprintf (s, "%s: MONITOR OFF", my_call); } outln (s, strlen (s)); break; case 'P': save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); dec (voiecur, 1); tnc_cmd (TNC_END, voiecur); #ifndef __linux__ if (p_port[no_port (voiecur)].typort == TYP_MOD) re_init_modem (voiecur); #endif pvoie->kiss = -1; pvoie->sta.connect = FALSE; selvoie (save_voie); pvoie->cross_connect = -1; incindd (); if (*indd) ch_niv3 (1); else ch_niv3 (0); duplex_tnc (); return; case 'S': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { incindd (); strcpy (pvoie->appendf, indd); if ((stat (pvoie->appendf, &bufstat) == -1) || ((bufstat.st_mode & S_IFREG) == 0)) { texte (T_ERR + 11); break; } texte (T_GAT + 10); save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); status (voiecur); strcpy (pvoie->sr_fic, indd); pvoie->enrcur = 0L; fin = senddata (0); if (!fin) { maj_niv (N_TELL, 0, 4); prompt = 0; } selvoie (save_voie); if (!fin) ch_niv3 (5); else { texte (T_GAT + 5); ch_niv3 (3); } } else texte (T_GAT + 3); break; case 'W': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { incindd (); if (*indd) { strcpy (pvoie->appendf, indd); if (open_capture ()) { texte (T_GAT + 11); close (capture); } } else { if (capture) { texte (T_GAT + 12); capture = 0; } else texte (T_ERR + 0); } } else texte (T_GAT + 3); break; case 'Y': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { strcpy (pvoie->dos_path, "\\"); ptr = ++indd; if (toupper (*ptr) == 'U') *ptr = 'D'; else if (toupper (*ptr) == 'D') *ptr = 'U'; incindd (); strcpy (pvoie->appendf, indd); if (*ptr == 'D') { #ifdef ENGLISH sprintf (buffer, "Yapp sending %s ...", indd); #else sprintf (buffer, "Yapp envoie %s ... ", indd); #endif #ifdef __FBBDOS__ trait (0, buffer); #endif } else { #ifdef ENGLISH sprintf (buffer, "Yapp receiving %s ...", indd); #else sprintf (buffer, "Yapp reçoit %s ... ", indd); #endif #ifdef __FBBDOS__ trait (0, buffer); #endif } indd = ptr; save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); status (voiecur); maj_niv (N_YAPP, 0, 0); pvoie->temp1 = pvoie->niv1; pvoie->kiss = -2; menu_yapp (); if (pvoie->binary) { selvoie (save_voie); ch_niv3 (6); } else { selvoie (save_voie); } prompt = 0; } else { var_cpy (0, " "); texte (T_TRT + 2); } break; case 'H': case '?': gw_help (); break; case 'F': if (p_port[no_port (pvoie->cross_connect)].lfreq) { incindd (); if (*indd == '\0') { disp_freq (no_port (pvoie->cross_connect)); break; } } else { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } default: /* if (!defaut()) { */ if ((p_port[no_port (pvoie->cross_connect)].lfreq) && (isdigit (*indd))) { /* Selection d'une frequence */ char *ptr; int port = no_port (pvoie->cross_connect); int val; int ok = 0; ListFreq *plf = p_port[port].lfreq; double freq; /* Transforme les ',' en '.' */ ptr = indd; while (*ptr) { if (*ptr == ',') *ptr = '.'; ++ptr; } freq = atof (indd); val = (int) freq; if ((double) val == freq) { /* rechercher d'abord par val */ while (plf) { if (plf->val == val) { ok = 1; break; } plf = plf->next; } } if (!ok) { /* C'est peut-etre la frequence */ plf = p_port[port].lfreq; while (plf) { if (plf->freq == freq) { ok = 1; break; } plf = plf->next; } } if (ok) { char buf[80]; sprintf (buf, "-> %g", plf->freq); outln (buf, strlen (buf)); /* envoyer la commande */ if (strncmpi (plf->cmde, "PTCTRX", 6) == 0) { ptctrx (port, plf->cmde); } else { char *cmde = plf->cmde; #ifdef __WINDOWS__ if (call_dll (cmde, NO_REPORT_MODE, NULL, 0, NULL) == -1) call_nbdos (&cmde, 1, NO_REPORT_MODE, NULL, NULL, NULL); #endif #ifdef __FBBDOS__ send_dos (2, cmde, NULL); #endif #ifdef __linux__ call_nbdos (&cmde, 1, NO_REPORT_MODE, NULL, TOOLDIR, NULL); #endif } } else { texte (T_ERR + 0); disp_freq (port); } } else { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); } /* } */ break; } } #ifndef __linux__ else { /* BPQ */ /* prog_indic(pvoie->cross_connect) ; */ switch (*indd) { case 'Q': case 'E': save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); dec (voiecur, 1); selvoie (save_voie); fin_tnc (); return; case 'K': texte (T_GAT + 5); ch_niv3 (3); return; case 'D': save_voie = voiecur; selvoie (pvoie->cross_connect); *buffer = '\0'; nb = 0; deb_io (); command = 2; sta_drv (voiecur, CMDE, (void *) &command); fin_io (); selvoie (save_voie); outs (buffer, nb); break; case 'P': save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); dec (voiecur, 1); dec (voiecur, 1); tnc_cmd (TNC_END, voiecur); pvoie->kiss = -1; pvoie->sta.connect = FALSE; selvoie (save_voie); pvoie->cross_connect = -1; incindd (); if (*indd) ch_niv3 (1); else ch_niv3 (0); duplex_tnc (); /* prog_indic (pvoie->cross_connect); */ return; case 'S': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { incindd (); strcpy (pvoie->appendf, indd); if ((stat (pvoie->appendf, &bufstat) == -1) || ((bufstat.st_mode & S_IFREG) == 0)) { texte (T_ERR + 11); break; } texte (T_GAT + 10); save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); status (voiecur); strcpy (pvoie->sr_fic, indd); pvoie->enrcur = 0L; fin = senddata (0); if (!fin) { maj_niv (N_TELL, 0, 4); prompt = 0; } selvoie (save_voie); if (!fin) ch_niv3 (5); else { texte (T_GAT + 5); ch_niv3 (3); } } else texte (T_GAT + 3); break; case 'W': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { incindd (); if (*indd) { strcpy (pvoie->appendf, indd); if (open_capture ()) { texte (T_GAT + 11); close (capture); } } else { if (capture) { texte (T_GAT + 12); capture = 0; } else texte (T_ERR + 0); } } else texte (T_GAT + 3); break; case 'Y': if (voiecur != CONSOLE) { indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); break; } if (svoie[pvoie->cross_connect]->sta.connect) { strcpy (pvoie->dos_path, "\\"); ptr = ++indd; if (toupper (*ptr) == 'U') *ptr = 'D'; else if (toupper (*ptr) == 'D') *ptr = 'U'; incindd (); strcpy (pvoie->appendf, indd); if (*ptr == 'D') { #ifdef ENGLISH sprintf (buffer, "Yapp sending %s ...", indd); #else sprintf (buffer, "Yapp envoie %s ... ", indd); #endif #ifdef __FBBDOS__ trait (0, buffer); #endif } else { #ifdef ENGLISH sprintf (buffer, "Yapp receiving %s ...", indd); #else sprintf (buffer, "Yapp reçoit %s ... ", indd); #endif #ifdef __FBBDOS__ trait (0, buffer); #endif } indd = ptr; save_voie = voiecur; pvoie->ch_mon = -1; selvoie (pvoie->cross_connect); status (voiecur); maj_niv (N_YAPP, 0, 0); pvoie->temp1 = pvoie->niv1; pvoie->kiss = -2; menu_yapp (); if (pvoie->binary) { selvoie (save_voie); ch_niv3 (6); } else { selvoie (save_voie); } prompt = 0; } else { var_cpy (0, " "); texte (T_TRT + 2); } break; case 'H': case '?': gw_help (); break; default: /* if (!defaut()) { */ indd[40] = '\0'; var_cpy (0, indd); texte (T_GAT + 9); /* } */ break; } } #endif } if (prompt) texte (T_GAT + 4); break; case 3: pvoie->lignes = -1; ptr = indd; while (*ptr) { if (*ptr == '\n') *ptr = '\r'; ++ptr; } if (((*indd == '\033') || (*indd == '>')) && (strlen (indd) == 2)) { ch_niv3 (2); texte (T_GAT + 4); } else { int len = strlen (indd); save_voie = voiecur; selvoie (pvoie->cross_connect); snd_drv (voiecur, DATA, indd, len, NULL); tor_stop (voiecur); pvoie->pack = 0; write_capture (indd, len); selvoie (save_voie); write_capture (indd, len); } break; case 4: fin = senddata (0); if (fin) { save_voie = voiecur; selvoie (pvoie->kiss); texte (T_GAT + 5); ch_niv3 (3); selvoie (save_voie); maj_niv (0, 0, 0); } break; case 5: if (*indd == '\033') { selvoie (pvoie->cross_connect); /* Arret du transfert */ selvoie (CONSOLE); #ifdef ENGLISH sprintf (buffer, "Transfer aborted"); #else sprintf (buffer, "Transfert arrêté"); #endif #ifdef __FBBDOS__ trait (-1, buffer); #endif sleep_ (1); } break; case 6: if (*indd == '\033') { selvoie (pvoie->cross_connect); cancel ("Abort\r"); selvoie (CONSOLE); #ifdef ENGLISH sprintf (buffer, "Transfer aborted"); #else sprintf (buffer, "Transfert arrêté"); #endif #ifdef __FBBDOS__ trait (-1, buffer); #endif sleep_ (1); } break; } } static int ch_canal (int port) { /* * Cherche une voie libre sur un port. * Commence par la derniere voie du port * Teste les voies reservees */ int i, j; if (port == 0) { if (svoie[CONSOLE]->sta.connect) return (-1); return (0); } if (p_port[port].pvalid == 0) return (-1); #ifdef __linux__ if (S_LINUX (port)) { if (port_free (port) == 0) return (-1); for (i = nbcan_linux (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (S_LINUX (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j)) && (!svoie[j]->localmode) ) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; return (j); } } } } else #endif if (DRSI (port)) { if (port_free (port) == 0) return (-1); for (i = nbcan_drsi (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (DRSI (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j)) && (!svoie[j]->localmode) ) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; return (j); } } } } else if (HST (port)) { if (port_free (port) == 0) return (-1); if (p_port[port].ccanal == 0) { /* Port Pactor. Cherche la voie correspondante */ for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == PACTOR_CH) && (HST (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j)) && (!svoie[j]->localmode) ) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; return (j); } } return (-1); } for (i = nbcan_hst (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (HST (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j)) && (!svoie[j]->localmode) ) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; return (j); } } } } else if (BPQ (port)) { if (port_free (port) == 0) return (-1); for (i = nbcan_bpq (); i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.canal == i) && (BPQ (no_port (j))) && (!svoie[j]->sta.connect) && (!voie_forward (j)) && (!svoie[j]->localmode) ) { svoie[j]->affport.port = port; for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; return (j); } } } } else { for (i = p_port[port].nb_voies; i > 0; i--) { for (j = 1; j < NBVOIES; j++) { if ((svoie[j]->affport.port == port) && (svoie[j]->affport.canal == i) && (!svoie[j]->sta.connect) && (!voie_forward (j)) && (!svoie[j]->localmode) ) { for (i = 0; i < 8; i++) *(svoie[j]->sta.relais[i].call) = '\0'; return (j); } } } } return (-1); } void prog_indic (int novoie) { char s[81]; switch (p_port[no_port (novoie)].typort) { case TYP_DED: case TYP_HST: case TYP_SCK: case TYP_ETH: case TYP_FLX: #ifdef __WINDOWS__ case TYP_AGW: #endif if (P_TOR (novoie)) sprintf (s, "I %s", pvoie->sta.indicatif.call); else sprintf (s, "I %s-%d", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num); break; case TYP_BPQ: sprintf (s, "*** Linked to %s-%d\r", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num); break; } strcpy (svoie[novoie]->sta.indicatif.call, pvoie->sta.indicatif.call); if (P_TOR (novoie)) svoie[novoie]->sta.indicatif.num = 0; else svoie[novoie]->sta.indicatif.num = pvoie->sta.indicatif.num; selcanal (no_port (novoie)); switch (p_port[no_port (novoie)].typort) { case TYP_DED: case TYP_HST: case TYP_SCK: case TYP_ETH: case TYP_FLX: #ifdef __WINDOWS__ case TYP_AGW: #endif tnc_commande (novoie, s, SNDCMD); break; case TYP_BPQ: snd_drv (novoie, DATA, s, strlen (s), NULL); break; } selcanal (no_port (voiecur)); } int nbgate (void) { int nb = 0; int port; for (port = 1; port < NBPORT; port++) { if ((p_port[port].pvalid) && (port != no_port (voiecur)) && ((p_port[port].moport & 8) == 0) && ((p_port[port].moport & 0x10) || (droits (ACCGATE)))) { ++nb; } } return (nb); } void aff_freq (void) { int port; char s[80]; for (port = 1; port < NBPORT; port++) { if ((p_port[port].pvalid) && (port != no_port (voiecur)) && (((p_port[port].moport & 8) == 0) || (voiecur == CONSOLE)) && ((p_port[port].moport & 0x10) || (droits (ACCGATE)))) { sprintf (s, "%d : %s", port, p_port[port].freq); outln (s, strlen (s)); } } } void fin_tnc (void) { char s[80]; int autre_voie = pvoie->cross_connect; if (autre_voie > 0) { tnc_cmd (TNC_END, autre_voie); /* Remet l'indicatif de la BBS */ switch (p_port[no_port (autre_voie)].typort) { case TYP_DED: case TYP_HST: case TYP_SCK: case TYP_ETH: case TYP_FLX: #ifdef __WINDOWS__ case TYP_AGW: #endif if (P_TOR (autre_voie)) sprintf (s, "I %s", mycall); else sprintf (s, "I %s-%d", mycall, myssid); break; case TYP_BPQ: sprintf (s, "*** Linked to %s-%d\r", mycall, myssid); break; } selcanal (no_port (autre_voie)); switch (p_port[no_port (autre_voie)].typort) { case TYP_DED: case TYP_HST: case TYP_SCK: case TYP_ETH: case TYP_FLX: #ifdef __WINDOWS__ case TYP_AGW: #endif tnc_commande (autre_voie, s, SNDCMD); break; case TYP_BPQ: snd_drv (autre_voie, DATA, s, strlen (s), NULL); break; } selcanal (no_port (voiecur)); svoie[autre_voie]->kiss = -1; svoie[autre_voie]->sta.connect = FALSE; #ifndef __linux__ if (p_port[no_port (autre_voie)].typort == TYP_MOD) re_init_modem (autre_voie); #endif } pvoie->ch_mon = -1; pvoie->cross_connect = -1; *indd = '\0'; if (pvoie->temp3 == N_MBL) { aff_nbsta (); retour_mbl (); } else if (pvoie->temp3 == 0) { pvoie->sta.connect = FALSE; maj_niv (0, 0, 0); if (voiecur == CONSOLE) console_off (); } #ifndef MINISERV else { maj_niv (0, 1, 0); choix (); } #endif curseur (); aff_nbsta (); } void gw_help (void) { incindd (); if (*indd == '\0') strcpy (indd, "H"); out_help (indd); } static void error_file (int nolig) { char wtexte[200]; deb_io (); #ifdef ENGLISH if (operationnel) { sprintf (wtexte, "\r\nError in file gateway.sys line %d \r\n\a", nolig); if (w_mask & W_FILE) mess_warning (admin, "*** FILE ERROR *** ", wtexte); } sprintf (wtexte, "Error in file gateway.sys line %d ", nolig); #else if (operationnel) { sprintf (wtexte, "\r\nErreur fichier gateway.sys ligne %d\r\n\a", nolig); if (w_mask & W_FILE) mess_warning (admin, "*** ERREUR FICHIER ***", wtexte); } sprintf (wtexte, "Erreur fichier gateway.sys ligne %d", nolig); #endif fin_io (); win_message (5, wtexte); } static int cmde (char *com_buf) { int type; char *ptr = com_buf, *lptr = com_buf; sup_ln (com_buf); while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; type = toupper (*ptr); ++ptr; /* ELSE */ if ((type == 'E') && (toupper (*ptr) == 'L')) type = '@'; while (ISGRAPH (*ptr)) ++ptr; while ((*ptr) && (!ISGRAPH (*ptr))) ++ptr; while ((*lptr++ = *ptr++) != '\0'); return (type); } static void clear_freq (int port) { ListFreq *plf; while (p_port[port].lfreq) { plf = p_port[port].lfreq; p_port[port].lfreq = plf->next; m_libere (plf, sizeof (ListFreq)); } } static int add_freq (int port, char *buf) { int v; char *freq; ListFreq *plf; ListFreq *phead = p_port[port].lfreq; v = atoi (buf); cmde (buf); if ((v < 1) || (v > 99)) return (FALSE); freq = buf; while (ISGRAPH (*buf)) ++buf; if (!isprint (*buf)) return FALSE; *buf++ = '\0'; /* buf pointe la commande */ if (phead) { while (phead->next) phead = phead->next; plf = m_alloue (sizeof (ListFreq)); phead->next = plf; } else { plf = m_alloue (sizeof (ListFreq)); p_port[port].lfreq = plf; } plf->val = v; plf->freq = atof (freq); n_cpy (sizeof (plf->cmde) - 1, plf->cmde, buf); plf->next = NULL; return TRUE; } static void tnc_cmd (int cmd, int voie) { int c; int d; int cptif = 0; int nolig = 0; int temp; int port; long h_time = time (NULL); FILE *fptr; typ_pfwd *ptnc = NULL; char com_buf[300]; if (voie <= 0) return; port = no_port (voie); clear_freq (port); fptr = fopen (c_disque ("gateway.sys"), "r"); if (fptr == NULL) return; while (fgets (com_buf, sizeof (com_buf), fptr)) { ++nolig; c = cmde (com_buf); switch (c) { case '\0': case '#': /* comment */ break; case 'E': /* ENDIF */ --cptif; break; case 'I': /* IF */ ++cptif; if (tst_fwd (com_buf, 0, h_time, port, NULL, 0, port) == FALSE) { temp = cptif - 1; while (cptif != temp) { if (fgets (com_buf, sizeof (com_buf), fptr) == NULL) break; ++nolig; d = cmde (com_buf); switch (d) { case 'I': /* if */ ++cptif; break; case 'E': /* endif */ --cptif; break; case '@': /* else */ if (cptif == (temp + 1)) ++temp; break; default: break; } } } break; case '@': /* ELSE */ temp = cptif - 1; while (cptif != temp) { if (fgets (com_buf, sizeof (com_buf), fptr) == NULL) break; ++nolig; d = cmde (com_buf); switch (d) { case 'I': /* if */ ++cptif; break; case 'E': /* endif */ --cptif; break; default: break; } } break; case 'B': /* BEGIN */ if (cmd == TNC_START) { d = cmde (com_buf); switch (d) { case 'D': param_tnc (1, &ptnc, com_buf); break; case 'L': /* Ligne de commande TNC */ param_tnc (0, &ptnc, com_buf); break; case 'X': /* Commande TNC */ param_tnc (2, &ptnc, com_buf); break; default: /* ??? */ error_file (nolig); break; } } break; case 'F': /* CMD */ if (!add_freq (port, com_buf)) error_file (nolig); break; case 'S': /* STOP */ if (cmd == TNC_END) { d = cmde (com_buf); switch (d) { case 'D': param_tnc (1, &ptnc, com_buf); break; case 'L': /* Ligne de commande TNC */ param_tnc (0, &ptnc, com_buf); break; case 'X': /* Commande TNC */ param_tnc (2, &ptnc, com_buf); break; default: /* ??? */ error_file (nolig); break; } } break; default: /* ??? */ error_file (nolig); break; } } fclose (fptr); if (ptnc) program_fwd (FALSE, TRUE, &ptnc, voie); } static void disp_freq (int port) { char buf[80]; int nb = 0; ListFreq *plf = p_port[port].lfreq; while (plf) { sprintf (buf, "%2d:%-10g ", plf->val, plf->freq); out (buf, strlen (buf)); if (++nb == 4) { cr (); nb = 0; } plf = plf->next; } if (nb) cr (); } static int pactor_cq (void) { char buffer[80]; char callsign[20]; char name[20]; char qth[40]; int i; int autre_voie = pvoie->cross_connect; if (IS_PACTOR (no_port (autre_voie))) { if (BUSY (no_port (autre_voie))) { sprintf (buffer, "%s: FREQ-BUSY fm PACTOR", mycall); outsln (buffer, strlen (buffer)); return (1); } /* Indicatif de l'appelant */ strcpy (callsign, pvoie->sta.indicatif.call); /* Prenom de l'appelant */ if (*(pvoie->finf.prenom)) strcpy (name, pvoie->finf.prenom); else strcpy (name, "???"); /* QTH de l'appelant */ if (*(pvoie->finf.ville)) strcpy (qth, pvoie->finf.ville); else strcpy (qth, "???"); prog_indic (autre_voie); tnc_commande (autre_voie, "!U", SNDCMD); #define NB_CALL 3 for (i = 0; i < NB_CALL; i++) { /* sprintf (buffer, "CQ CQ CQ de %s %s %s (%d)\r", callsign, callsign, callsign, NB_CALL - i);*/ /* Add from DM3TT compilation */ /* Added 'PACTOR' as suggested by G4APL SysOP GB7CIP */ sprintf (buffer, "CQ CQ CQ PACTOR de %s %s %s @ %s (%d)\r", callsign, callsign, callsign, mycall, NB_CALL - i); snd_drv (autre_voie, DATA, buffer, strlen (buffer), NULL); outs (buffer, strlen (buffer)); } /* sprintf (buffer, "Op %s fm %s is QRV ... Pse K\r", name, qth);*/ /* Add from DM3TT compilation */ sprintf (buffer, "Op %s fm %s is QRV for QSO pse Connect %s\rPse K\r", name, qth, callsign); snd_drv (autre_voie, DATA, buffer, strlen (buffer), NULL); outs (buffer, strlen (buffer)); tnc_commande (autre_voie, "!D", SNDCMD); aff_nbsta (); return (1); } else return (0); } fbb-7.0.10/src/maint_fw.c0000644000175000017500000001132513615603431012014 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include static int data_ok(recfwd *prec, int data_mode) { if ((data_mode == 0) && (prec->bin)) return 0; if ((data_mode == 3) && (!prec->bin)) return 0; if ((data_mode == 2) && (prec->bin) && (!PRIVATE (prec->type))) return 0; return 1; } int print_fwd (int nobbs, uchar max, uchar old, uchar typ, int data_mode) { int pos; int noctet; int ok = 0; int pass = 2; int aff = 0; char cmpmsk; recfwd *prec; lfwd *ptr_fwd; rd_list *ptemp = NULL; time_t date = time(NULL) - 3600L * (long)old; libere_tlist (voiecur); noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); ouvre_dir (); while (pass) { pos = 0; ptr_fwd = tete_fwd; while (1) { aff = 0; if (pos == NBFWD) { ptr_fwd = ptr_fwd->suite; if (ptr_fwd == NULL) break; pos = 0; } prec = &ptr_fwd->fwd[pos]; if (prec->type) { if (data_ok(prec, data_mode)) { if ((prec->fbbs[noctet] & cmpmsk) && (prec->date <= date) && (prec->kb <= max)) { if ((prec->type == 'P') || (prec->type == 'A')) { if (pass == 2) aff = 1; } else { if (pass == 1) aff = 1; } if (aff) { if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_list = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = prec->nomess; ptemp->verb = 1; ok = 1; } } } } pos++; } if (typ) break; --pass; } ferme_dir (); maj_niv (N_MBL, 16, 0); mess_liste (1); return (ok); } #if 0 int print_fwd (int nobbs, uchar max, uchar typ) { int pos; int noctet; int ok = 0; int pass = 2; int aff; char cmpmsk; rd_list *ptemp = NULL; unsigned offset; bloc_mess *bptr; bullist bul; libere_tlist (voiecur); pos = 0; noctet = (nobbs - 1) / 8; cmpmsk = 1 << ((nobbs - 1) % 8); ouvre_dir (); while (pass) { offset = 0; bptr = tete_dir; while (bptr) { if (bptr->st_mess[offset].noenr) { read_dir (bptr->st_mess[offset].noenr, &bul); if (bul.type) { int kb = (int) (bul.taille >> 10); if ((bul.fbbs[noctet] & cmpmsk) && (kb <= max)) { if ((bul.type == 'P') || (bul.type == 'A')) { if (pass == 2) aff = 1; } else { if (pass == 1) aff = 1; } if (aff) { if (ptemp) { ptemp->suite = (rd_list *) m_alloue (sizeof (rd_list)); ptemp = ptemp->suite; } else { pvoie->t_list = ptemp = (rd_list *) m_alloue (sizeof (rd_list)); } ptemp->suite = NULL; ptemp->nmess = bul.numero; ptemp->verb = 1; ok = 1; } } } } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } if (typ) break; --pass; } ferme_dir (); maj_niv (N_MBL, 16, 0); mess_liste (1); return (ok); } #endif void maj_fwd (void) { int i, nb = 5; char temp[NBMASK]; df ("maj_fwd", 0); ouvre_dir (); selvoie (CONSOLE); vlang = 0; pvoie->mode |= F_FOR; while (nb) { if (read_dir (p_forward, ptmes) == 0) { p_forward = 0; maj_options (); aff_etat ('A'); aff_nbsta (); break; } if ((*ptmes->bbsv) && (ptmes->status != 'H') && ((ptmes->status == 'N') || (ptmes->status == 'Y') || (ptmes->status == '$') )) { aff_etat ('O'); nb = 0; for (i = 0; i < NBMASK; i++) { temp[i] = ptmes->fbbs[i]; ptmes->fbbs[i] = '\0'; } test_forward (2); if (memcmp (ptmes->fbbs, temp, NBMASK) != 0) { clear_fwd (ptmes->numero); ins_fwd (ptmes); write_dir (p_forward, ptmes); } } else --nb; ++p_forward; } ferme_dir (); ff (); } fbb-7.0.10/src/init_tnc.c0000644000175000017500000002175313613360505012025 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include int inittnc (void) { FILE *fpinit; char s[80]; int port, port_ok, reset; int d_init; int lig, col, i, ok; int ok_init[NBPORT]; #ifdef ENGLISH #ifdef __linux__ cprintf ("TNC ports set-up \n"); #else cprintf ("TNC ports set-up \r\n"); #endif #else #ifdef __linux__ cprintf ("Initialisation des ports TNC\n"); #else cprintf ("Initialisation des ports TNC\r\n"); #endif #endif #ifdef __WINDOWS__ DisplayResync (port, 0); #endif if (DEBUG) { #if defined(__WINDOWS__) || defined(__linux__) InitText ("TEST Mode"); #else cprintf ("Debug valide\r\n"); #endif return (1); } for (port = 1; port < NBPORT; port++) ok_init[port] = -1; deb_io (); col = 10; lig = 2; port_ok = 1; for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { selcanal (port); #ifdef __WINDOWS__ if (ETHER (port)) { init_socket (port); } else #endif #ifdef __linux__ /* if (ETHER (port)) */ if ((LINUX (port)) && (p_port[port].typort == TYP_ETH)) { if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init TCP port %d", port); WinMessage (5, str); continue; } } else if ((LINUX (port)) && (p_port[port].typort == TYP_TCP)) { if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init TELNET port %d", port); WinMessage (5, str); continue; } } else if ((LINUX (port)) && (p_port[port].typort == TYP_POP)) { if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init POP port %d", port); WinMessage (5, str); continue; } } else if ((LINUX (port)) && (p_port[port].typort == TYP_SCK)) { if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init LINUX port %d", port); WinMessage (5, str); continue; } } else #endif if (BPQ (port)) { switch (p_port[port].typort) { #if defined(__WINDOWS__) || defined(__FBBDOS__) case TYP_FLX: /* Mode FLEX */ cprintf ("Interface FLEX\r\n"); if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init FLEX port %d", port); WinMessage (5, str); continue; } break; #endif case TYP_DED: sprintf (s, "UR%d", p_port[port].nb_voies); break; case TYP_BPQ: cprintf ("Interface BPQNODE\r\n"); bpq_deconnect = 1; break; } } else { cprintf ("switch\r\n"); switch (p_port[port].typort) { #if defined(__WIN32__) case TYP_FLX: /* Mode FLEX */ cprintf ("Interface FLEX\r\n"); if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init FLEX port %d", port); WinMessage (5, str); continue; } break; #endif case TYP_DED: /* MODE DED */ cprintf ("DED HostMode.\r\n"); d_init = 1; for (i = 1; i < NBPORT; i++) { if (ok_init[i] == p_port[port].ccom) d_init = 0; } if (d_init) { if (DRSI (port)) ok_init[port] = p_port[port].ccom; if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init DED port %d", port); WinMessage (5, str); continue; } } break; case TYP_HST: /* MODE DED */ cprintf ("PTC HostMode.\r\n"); d_init = 1; for (i = 1; i < NBPORT; i++) { if (ok_init[i] == p_port[port].ccom) d_init = 0; } if (d_init) { if (DRSI (port)) ok_init[port] = p_port[port].ccom; if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init PTC-II port %d", port); WinMessage (5, str); continue; } } break; case TYP_PK: /* Mode PK232 */ cprintf ("PK232 HostMode.\r\n"); #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) initcom_windows (p_port[port].ccom, 4096, 4096, CTS | DSR); #endif while (1) { reset = 4; tncstr (port, "*", 0); sleep_ (1); tncstr (port, "\021\030\003", 0); sleep_ (1); tncstr (port, "MO 0\r", 0); tncstr (port, "HOST ON\r", 0); vide (port, 0); tncstr (port, "\001\001OGG\027", 0); sleep_ (1); if (rec_tnc (port) >= 0) break; /* #pragma warn -rch */ vide (port, 0); sleep_ (2); tncstr (port, "\003\003\003", 0); sleep_ (2); tncstr (port, "\033\030RESTART\r", 0); #ifdef ENGLISH cprintf ("Reset sent ... Please wait. \r\n"); #else cprintf ("Reset envoy‚... Patientez S.V.P.\r\n"); #endif i = 20; ok = 0; while (i--) { if ((ok = (rcv_tnc (port) >= 0)) != 0) break; sleep_ (1); } vide (port, 0); } vide (port, 0); /* Parametres par defaut */ tnc_commande (port, "HPN", PORTCMD); tnc_commande (port, "CETRANS", PORTCMD); tnc_commande (port, "AIN", PORTCMD); tnc_commande (port, "HDN", PORTCMD); tnc_commande (port, "PL0", PORTCMD); tnc_commande (port, "MI0", PORTCMD); sprintf (s, "ML%s-%d", mycall, myssid); tnc_commande (port, s, PORTCMD); sprintf (s, "UR%d", p_port[port].nb_voies); tnc_commande (port, s, PORTCMD); sprintf (s, "MX%d", p_port[port].frame); tnc_commande (port, s, PORTCMD); break; case TYP_MOD: /* Mode MODEM */ cprintf ("MODEM Mode\r\n"); init_modem (port); modem_no_echo (port); break; case TYP_KAM: /* Mode KAM */ #ifdef __WINDOWS__ if (BIOS (port) == P_WINDOWS) initcom_windows (p_port[port].ccom, 4096, 4096, CTS | DSR); #endif cprintf ("Kantronics HostMode\r\n"); /* Parametres par defaut */ tnc_commande (port, "HEADERLN OFF", PORTCMD); tnc_commande (port, "HEADERLN OFF", PORTCMD); tnc_commande (port, "STATSHRT ON", PORTCMD); tnc_commande (port, "PACLEN 0", PORTCMD); sprintf (s, "MY %s-%d", mycall, myssid); tnc_commande (port, s, PORTCMD); if (p_port[port].ccanal == 1) { sprintf (s, "MAXFRAME /%d", p_port[port].frame); } else { sprintf (s, "MAXFRAME %d/", p_port[port].frame); } tnc_commande (port, s, PORTCMD); if (p_port[port].ccanal == 1) sprintf (s, "USERS /%d", p_port[port].nb_voies); else sprintf (s, "USERS %d/", p_port[port].nb_voies); tnc_commande (port, s, PORTCMD); ok_init[port] = p_port[port].ccom; break; case TYP_TCP: /* Mode ETHERNET */ cprintf ("ETHERNET Mode\r\n"); break; #ifdef __WINDOWS__ case TYP_AGW: /* Mode ETHERNET */ if (!opn_drv (port, p_port[port].nb_voies)) { char str[256]; sprintf (str, "Error init AGW port %d", port); WinMessage (5, str); continue; } break; #endif } } /* Programmed parameters */ /* First, try the "port_name.ini" file */ sprintf (s, "%s.prt", p_port[port].freq); fpinit = fopen (c_disque (s), "rb"); /* Then try the "inittnc" file */ if (fpinit == NULL) { sprintf (s, "inittnc%d.sys", port); fpinit = fopen (c_disque (s), "rb"); } if (fpinit) { while (fgets (s, 80, fpinit)) { sup_ln (s); if ((*s) && (*s != '#')) { tnc_commande (port, s, PORTCMD); } } ferme (fpinit, 2); } #if !defined(__WIN32__) && (defined(__FBBDOS__) || defined(__WINDOWS__)) if (p_port[port].typort == TYP_BPQ) { ini_bpq (p_port[port].nb_voies); } #endif #ifdef ENGLISH #ifdef __linux__ cprintf ("End TNC set-up \n"); #else cprintf ("End TNC set-up \r\n"); #endif #else #ifdef __linux__ cprintf ("Initialisation termin‚e\n"); #else cprintf ("Initialisation termin‚e\r\n"); #endif #endif sprintf (s, "OK PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); #if defined(__WINDOWS__) || defined(__linux__) InitText (s); #endif ++port_ok; lig++; col += 2; } } for (port = port_ok - 1; port > 0; port--) { lig--; col -= 2; } fin_io (); return (1); } fbb-7.0.10/src/ajoursat.c0000644000175000017500000010126413615603431012042 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************ * HISTORIQUE : * DATE AUTEUR / AUTHOR : Bernard Pidoux, f6bvp@amsat.org * ajoursat 16/10/89 Bernard Pidoux F6BVP * 11/11/89 le répertoire n'est pas imposé * 20/05/00 * portage sous linux (J-P ROUBELAT - F6FBB) * * Version 1.72 12/12/90 avec vérifications renforcés du synchronisme * du format de lecture, sans bouclage infini. * 1.74 3/03/91 Traite jusqu'à 768 Satellites * 26/04/91 Test si place disponible en mémoire * 1.75 27/04/91 Option lecture format Nasa * nouveau renforcement controle intégrité des donnés * Exclusion des doublons * libéation mémoire alloué en sortie * extension fichier source .txt uniquement par défaut * 1.76 19/05/91 CRC en lecture format Nasa * changement du format de lecture lignes NASA * 24/05/91 déplacement message "Aucune mise jour aprés else * 1.77 28/05/91 CRC en lecture format AMSAT * 1.78 31/10/93 fscanf remplacé par fgets dans AMSAT pour supprimer * plantage programme sur longue ligne sans RC * 1.80 20/11/93 prise en compte de la date_limite des donnés * 1.83 20/11/94 champ ELEMENT SET pour compatibilité * format AMSAT du service REQKEP * 1.84 : 15/02/98 suite plantage par ligne pseudo Satellite * agrandissement tableaux buf1 et buf2 * 1.85 : 12/01/2000 pour le bogue ! * dernières mises au point 9 juin 2000 sous Linux * 1.86 : septembre 2007 * 1.87 : 26/09/2009 * 1.88 Jan-26-2015 changed fgets() lines avoiding compiler warnings * 1.89 Feb-03-2015 changed write() line avoiding compiler warning *************************************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* #define DEBUG */ #define FRANCAIS #define VERSION "1.89" /* Tabulation a 4 espaces !! */ #ifdef DEBUG #define d_printf printf #else void d_printf(const char * format, ...); void d_printf(const char * format, ...) { } #endif #define TRUE 1 #define FALSE 0 /* * Record du fichier SATEL */ #define __a2__ __attribute__ ((packed, aligned(2))) typedef struct typ_satel { char dd[18]; /* Nom du satellite */ short y3; /* Annee de reference */ double d3 __a2__; /* Jour de reference */ short n3; /* Mois de reference */ short h3; /* Heure de reference */ short m3; /* Minute de reference */ short s3; /* Seconde de reference */ double i0 __a2__; /* Inclinaison */ double o0 __a2__; /* R.A.A.N. */ double e0 __a2__; /* Excentricite */ double w0 __a2__; /* Argument de perigee */ double m0 __a2__; /* Anomalie moyenne */ double a0 __a2__; /* Contient 0.0 */ double n0 __a2__; /* Mouvement moyen */ double q3 __a2__; /* Derivee du mouv. moy.*/ long k0 __a2__; /* Orbite de reference */ double f1 __a2__; /* Frequence pour le calcul doppler */ double v1 __a2__; /* Contient 0.0 */ short pas; /* Pas des calculs*/ long maj __a2__; /* Date de derniere mise à jour*/ long cat __a2__; /* Catalog Number - anciennement vide */ short set; /* Element set NASA */ short libre[3]; } satel; #define MAXSAT 769 #define LINE 81 /********** Prototypes **************/ int Misajour(satel ** vieux, int vv, satel ** nouv, int nn, char option); int Ecrit_Sat(char *filename, satel ** stru, int nombre); void Amsat(char *filename); void nasa(char *filename); int Lire_Ancien(char *filename); void Print_Sat(satel ** stru, int m); /* Imprime fichier */ void Tri_Cat(satel ** stru, int nombre); void Tri(satel ** stru, int nombre); /* tri a bulle des noms de satellites */ void CopyStru(satel ** stru, int indice, satel * psat); int doublons(int nombre); void avorte(void); int fraicheur(void); /************************************/ char *filename, *str; /* Nom fichier Source et copie */ struct tm *cejour; /* date et time declares dans TIME.H */ char *aujour; /* Date de derniere mise à jour */ int date_limite; /* nombre de jours ancienneté limite pour les données */ satel *vieux[MAXSAT]; satel *nouveaux[MAXSAT]; satel *tampon[MAXSAT]; /* tampon pour mise à jour */ satel sat; /* declaration structure sat de type satel */ int nsat; /* nombre de satellites modifié */ int maxsat; /* nombre de satellites gérable */ char *opt; char *options[5]; char *option; char *dmo; char *dmold; int good_crc; int bad_crc; void sortie(int n) { int i; for (i = 0; i < maxsat; i++) { free(vieux[i]); free(nouveaux[i]); /* * farfree(tampon[i]); */ free(tampon[i]); } free(filename); free(str); free(dmo); free(dmold); exit(n); } void avorte(void) /* * Nom: avorte() Description : Sortie du programme en cas * d'erreur. Commentaire : Efface le fichier provisoire et ferme les * fichiers de travail. */ { remove(dmo); /* efface le fichier provisoire .$$$ */ #ifdef FRANCAIS printf("\nDépassement du nombre de satellites autorisé!\n"); printf(" ou pas assez de mémoire.\n"); #else printf("\nToo much satellites on file !\n"); printf(" or not enough memory for the program.\n"); #endif sortie(1); } int main(int argc, char *argv[]) { int i, j, k, l, m, n = 0; /* long jour; secondes depuis 1er Janv 1970 0 heures GMT */ /* char option1; option format fichier /A AMSAT, /N NASA */ /* char option2='X'; option de mise a jour fusion par défaut*/ /* char option3='X'; option de délai*/ char optionA; char optionB; char optionC; time_t temps; for (i = 0; i < MAXSAT; i++) { vieux[i] = (satel *) (malloc(sizeof(satel))); tampon[i] = (satel *) (malloc(sizeof(satel))); nouveaux[i] = (satel *) (malloc(sizeof(satel))); if (nouveaux[i] == NULL) avorte(); } maxsat = i - 1; for (i = 0; i < 5; i++) options[i] = (char *) (calloc(40, sizeof(char))); option = (char *) (malloc(40 * sizeof(char))); dmo = (char *) (malloc(80 * sizeof(char))); dmold = (char *) (malloc(80 * sizeof(char))); opt = (char *) (malloc(40 * sizeof(char))); str = (char *) (malloc(80 * sizeof(char))); filename = (char *) (malloc(80 * sizeof(char))); strcpy(dmold, "satel.dat"); strcpy(dmo, "satel.$$$"); *options[0] = 'A'; /* défaut format AMSAT */ optionA = 'A'; *options[1] = 'F'; /* fusion des donnés */ optionB = 'F'; date_limite = 100; /* effacer donnés si supéieures é00 jours */ optionC = 'D'; /* * printf("%d arguments\n",argc); for(i=0;i= 2 && argc <= 5) { strcpy(filename, argv[1]); for (i = 0; i < argc-2; i++) { strcpy(option, argv[i + 2]); opt = strstr(option, "/"); if (opt == NULL) break; opt++; *options[i] = toupper(*opt); if (*options[i] == 'D') date_limite = atoi(++opt); } } #ifdef FRANCAIS printf("\nMise à jour des paramètres orbitaux de la banque de données des satellites pour BBS F6FBB\n"); printf("Version %s - février 2015 - Bernard Pidoux, f6bvp@amsat.org\n",VERSION); if ((argc < 2) || (argc > 5)) { printf("Emploi: ajoursat nom_fichier<.txt> \n"); printf("\nOption lecture :"); printf("\n /a format AMSAT (par défaut)"); printf("\n /n format NASA"); printf("\nOption mise à jour :"); printf("\n /f fusion avec les anciennes données (par défaut)"); printf("\n /u uniquement des anciennes données"); printf("\n /s seulement les données réactualisées"); printf("\nOption effacement :"); printf("\n /dxxx supprime les données de plus de xxx jours"); printf("\n (par défaut 100 jours)\n"); printf("\n<>\n", maxsat); sortie(0); } #else printf("\nUpdate of F6FBB's BBS satellite data base orbital parameters\n"); printf("Version %s - February 2015 - Bernard Pidoux, f6bvp@amsat.org\n",VERSION); if ((argc < 2) || (argc > 5)) { printf("Usage: satupdat file_name<.txt> \n"); printf("\nReading option:"); printf("\n /a AMSAT format (default)"); printf("\n /n NASA format"); printf("\nUpdate option:"); printf("\n /f merging new and old data (default)"); printf("\n /u update only satellites being in the data base"); printf("\n /s keep only satellites being in the input file"); printf("\nDelete option:"); printf("\n /dxxx delete data older than xxx days"); printf("\n (default 100 days)\n"); printf("\n<<%d satellites maximum>>\n", maxsat); sortie(0); } #endif time(&temps); cejour = gmtime(&temps); for (i = 0; i < argc - 2; i++) { if (*options[i] == 'A') optionA = 'A'; else if (*options[i] == 'N') optionA = 'N'; else if (*options[i] == 'S') optionB = 'S'; else if (*options[i] == 'U') optionB = 'U'; else if (*options[i] == 'F') optionB = 'F'; else if (*options[i] == 'D') optionC = 'D'; } #ifdef FRANCAIS if (optionA == 'A') printf("Lecture format AMSAT\n"); else if (optionA == 'N') printf("Lecture format NASA avec CRC-10\n"); printf("Mise jour "); if (optionB == 'S') printf("en gardant seulement les satellites de la nouvelle liste\n"); else if (optionB == 'U') printf("uniquement des données des anciens satellites\n"); else if (optionB == 'F') printf("en fusionnant la nouvelle avec l'ancienne liste\n"); if (optionC == 'D') printf("avec suppression des données de plus de %d jours.\n", date_limite); #else if (optionA == 'A') printf("Reading AMSAT format\n"); else if (optionA == 'N') printf("Reading NASA format with CRC-10\n"); printf("Update "); if (optionB == 'S') printf("keeping only satellites being in the input file\n"); else if (optionB == 'U') printf("only satellites being already in the data base\n"); else if (optionB == 'F') printf("merging new list with old list\n"); if (optionC == 'D') printf("deleting data older than %d days.\n", date_limite); #endif n = Lire_Ancien(dmold); if (n > 1) { Tri_Cat(vieux, n); } if (n != -1) { #ifdef FRANCAIS printf("\n%d données de moins de %d jours", n, date_limite); #else printf("\n%d data less than %d days", n, date_limite); #endif } if (strchr(filename, '.') == NULL) { strtok(filename, "."); strcat(filename, ".txt"); } #ifdef FRANCAIS printf("\nLecture du fichier: %s\n\n", filename); #else printf("\nReading file: %s\n\n", filename); #endif if (optionA == 'A') Amsat(filename); else if (optionA == 'N') nasa(filename); m = good_crc; if (good_crc > 0) { /* Il existe au moins une donné nouvelle... */ Tri_Cat(nouveaux, m); printf ("(%d)",m); j = doublons(m); printf ("(%d)",j); k = Misajour(vieux, n, nouveaux, j, optionB); Tri(nouveaux, k); /* tri alphabetique pour liste */ printf ("(%d)",k); /* Print_Sat(nouveaux,j); */ remove("satel.bak"); rename(dmold, "satel.bak"); if ((l = Ecrit_Sat(dmo, nouveaux, k)) != k) #ifdef FRANCAIS printf("\nErreur écriture fichier '%s'\n", dmo); #else printf("\nError writing file '%s'\n", dmo); #endif rename(dmo, dmold); } #ifdef FRANCAIS if (good_crc > 0) printf("\nLes données de %d satellites sur %d ont été réactualisées", nsat, k); else if (good_crc == 0) printf("\nAucune nouvelle donnée"); else if (good_crc == -1) printf("\nFichier %s non trouvé !", filename); #else if (good_crc > 0) printf("\nData of %d satellites over %d have been updated", nsat, k); else if (good_crc == 0) printf("\nNothing to update"); else if (good_crc == -1) printf("\nFile %s not found !", filename); #endif #ifdef FRANCAIS printf(" le %02d/%02d/%02d ", cejour->tm_mday, cejour->tm_mon+1, cejour->tm_year%100); printf("a %02u:%02u:%02u\n", cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #else printf(" on %02d/%02d/%02d ", cejour->tm_mday, cejour->tm_mon+1, cejour->tm_year%100); printf("at %02u:%02u:%02u\n", cejour->tm_hour, cejour->tm_min, cejour->tm_sec); #endif sortie(0); return 0; } /* * fonction validation du checksum NASA revue le 24/01/92 pour nouveau format * NASA avec signe (+) valeur 0 */ int crcdix(char *ligne) { char caract; char *pointeur; int i, crc10, crc, valide; crc10 = 0; pointeur = ligne; /* * printf("\n%s\n",ligne); */ for (i = 0; i < 68; i++) { caract = pointeur[i]; if (caract == '-') crc = 1; else if (caract == '+') crc = 0; else crc = atoi(&caract); crc10 += crc; crc10 = crc10 % 10; } caract = pointeur[68]; crc = atoi(&caract); if (crc == crc10) valide = 1; else valide = -1; return (valide); } /*************************** FORMAT AMSAT *************************/ int crc, crc10; int checksum(char *ligne) { int i; char caract; for (i = 0; i < strlen(ligne); i++) { caract = ligne[i]; if (caract == '-') crc += 1; else if (caract == '+') crc += 2; else crc += atoi(&caract); } /* printf("*%d*\n",crc); */ return (crc); } void Amsat(char *filename) { FILE *fd; char tampon[82]; char ligne[81]; char buf1[41] = "\0"; char buf2[41] = "\0"; char nom[18]; long jour; /* secondes depuis 1er Janv 1970 0 heures GMT */ int k, n, m = 0; int valide; /* validation enregistrement */ fd = fopen(filename, "rt"); if (fd != NULL) { while (!feof(fd)) { crc = valide = 0; do { if (fgets(tampon, LINE, fd) != NULL) { sscanf(tampon, "%s", ligne); d_printf("%s\n",ligne); } } while (strcmp("Satellite:", ligne) && !(feof(fd))); crc = checksum(tampon); k = sscanf(tampon, "%*s %s %s %s", nom, buf1, buf2); if (k > 1) strcat(nom, " "), strncat(nom, buf1, 9); else if (k > 2) strcat(nom, " "), strncat(nom, buf2, 9); strncpy(sat.dd, nom, 17); sat.dd[17] = '\0'; if (!feof(fd)) { k = fscanf(fd, "%80s", ligne); if (strncmp("Catalog", ligne, 7) == 0 && !feof(fd)) valide = 1; for (n = 0; n < 2; n++) k = fscanf(fd, "%80s", ligne); sat.cat = atol(ligne); /* Catalog number */ crc = checksum(ligne); for (n = 0; n < 2; n++) { k = fscanf(fd, "%80s", ligne); d_printf("%s\n",ligne); d_printf("\n*%s*",ligne); } k = fscanf(fd, "%2d", (int *)&sat.y3); d_printf("%s\n", ligne); /* itoa(sat.y3,ligne,10); */ sprintf(ligne, "%2d", sat.y3); crc = checksum(ligne); d_printf("%d ", sat.y3); k = fscanf(fd, "%lf", &sat.d3); d_printf("%s\n",ligne); sprintf(ligne, "%3.8lf", sat.d3); crc = checksum(ligne); d_printf("%lf\n",sat.d3); /* Nouvelle ligne élire */ for (n = 0; n < 2; n++) { k = fscanf(fd, "%80s", ligne); /* Element Set */ d_printf("%s\n",ligne); d_printf("\n*%s*",ligne); } k = fscanf(fd, "%4d", (int *)&sat.set); /* element number */ sprintf(ligne, "%4d", sat.set); crc = checksum(ligne); d_printf("%4d\n",sat.set); k = fscanf(fd, "%80s", ligne); d_printf("*%s*",ligne); k = fscanf(fd, "%lf", &sat.i0); /* inclinaison */ sprintf(ligne, "%3.8lf", sat.i0); d_printf("%lf\n",sat.i0); crc = checksum(ligne); for (n = 0; n < 4; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.o0); /* R.A.A.N. */ sprintf(ligne, "%3.8lf", sat.o0); crc = checksum(ligne); for (n = 0; n < 2; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.e0); /* excentricite */ sprintf(ligne, "%3.8lf", sat.e0); crc = checksum(ligne); for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); } k = fscanf(fd, "%lf", &sat.w0); /* arg. perigee */ sprintf(ligne, "%3.8lf", sat.w0); crc = checksum(ligne); for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); } k = fscanf(fd, "%lf", &sat.m0); /* anomal. moyenne */ sprintf(ligne, "%3.8lf", sat.m0); crc = checksum(ligne); sat.a0 = 0.0; /* * contient 0.0 */ for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.n0); /* mouvement moyen */ sprintf(ligne, "%3.8lf", sat.n0); crc = checksum(ligne); for (n = 0; n < 3; n++) { k = fscanf(fd, "%80s", ligne); crc = checksum(ligne); } k = fscanf(fd, "%lf", &sat.q3); /* deriv. mouvem. moy. */ sprintf(ligne, "%2.7e", sat.q3); crc = checksum(ligne); k = fscanf(fd, "%80s", ligne); /* day ^2 */ crc = checksum(ligne); k = fscanf(fd, "%80s", ligne); /* Epoch */ crc = checksum(ligne); if (strcmp("Epoch", ligne) != 0) valide = 0; k = fscanf(fd, "%80s", ligne); /* rev: */ crc = checksum(ligne); k = fscanf(fd, "%ld", &sat.k0); /* num. orbite referen. */ sprintf(ligne, "%ld", sat.k0); crc = checksum(ligne); k = fscanf(fd, "%80s", ligne); /* * while(strcmp("Checksum:",ligne) && !(feof(fd))) ; */ k = fscanf(fd, "%d", &crc10); d_printf("CRC calcule:%d et lu:%d\n",crc,crc10); sat.f1 = 0.0; sat.v1 = 0.0; sat.pas = 5; time(&jour); sat.maj = jour; if ((sat.cat != 0) && (valide != 0)) { if ((crc == crc10) && (fraicheur())) printf("%3d : %-18s", m + 1, sat.dd); else printf(" %-18s", sat.dd); if (fraicheur()) { if (crc == crc10) { CopyStru(nouveaux, m, &sat); m++; /* incrémente le compteur de satellites mis à jour */ printf(" ok\n"); if (m > maxsat) break;; } else { #ifdef FRANCAIS printf(" erreur de CRC !\n"); #else printf(" bad CRC !\n"); #endif } } else { #ifdef FRANCAIS printf(" données trop anciennes !\n"); #else printf(" data too old !\n"); #endif } } } /* tant que pas fin de fichier */ } /* tant que pas fin de fichier */ fclose(fd); } /* si pas NULL */ else m = -1; /*return (m);*/ good_crc = m; } void CopyStru(satel ** stru, int indice, satel * psat) { *stru[indice] = *psat; } /* * élimination des doublons de satellites * en conservant les donnés les plus récentes * retourne le nombre de satellites */ int doublons(int nombre) { int i, j, k; #ifdef FRANCAIS printf("\nrecherche de doublons"); #else printf("\nlooking for duplicate"); #endif /* * FRANCAIS */ for (i = 0; i < nombre - 1; i++) { printf("."); for (j = i + 1; j < nombre; j++) { if (nouveaux[i]->cat == nouveaux[j]->cat) { if (((nouveaux[i]->y3 == nouveaux[j]->y3) && (nouveaux[i]->d3 > nouveaux[j]->d3)) || (nouveaux[i]->y3 > nouveaux[j]->y3)) { nouveaux[j]->libre[0] = -1; } else { nouveaux[i]->libre[0] = -1; } } } } k = 0; for (i = 0; i < nombre; i++) { if (nouveaux[i]->libre[0] != -1) { CopyStru(tampon, k, nouveaux[i]); k++; } } for (i = 0; i < k; i++) { CopyStru(nouveaux, i, tampon[i]); } return (i); } /* * Ecrit_Sat.c */ int Ecrit_Sat(char *filename, satel **stru, int nombre) { int fd2; int indice, n; char *str; str = (char *) (malloc(30 * sizeof(char))); strtok(filename, "."); strcat(filename, ".dat"); sprintf(str, "%s", filename); strcpy(filename, str); n = nombre; fd2 = open(filename, O_CREAT | O_RDWR, S_IREAD | S_IWRITE | S_IEXEC); if (fd2 != -1) { for (indice = 0; indice < nombre; indice++) { if (stru[indice]->libre[0] != -1) { if (write(fd2, stru[indice], sizeof(satel)) == 0) #ifdef FRANCAIS printf("Impossible d'écrire dans le fichier %s !\n", filename); #else printf("Could not write into file %s !\n", filename); #endif } else n--; } close(fd2); } free(str); return (n); } /* LIRVIEUX.C * Relecture de la base de donné des parametres képlériens * avec suppression des donnés qui dépassent la date_limite */ int fd2; int openfile(char *filename) /* * Nom: openfile() Description : Ouvre le fichier source. * Commentaire : Les fichiers doivent être dans le réertoire FICHIERS */ { char *str; str = (char *) (malloc(30 * sizeof(char))); strtok(filename, "."); strcat(filename, ".dat"); sprintf(str, "%s", filename); strcpy(filename, str); /* * fd2 = open(filename,O_BINARY); */ fd2 = open(filename, O_RDWR, S_IREAD | S_IWRITE | S_IEXEC); if (fd2 == -1) { #ifdef FRANCAIS printf("fichier %s non trouvé - nouvelle banque créée !\n", filename); #else printf("file %s not found - new data base created !\n", filename); #endif fd2 = open(filename, O_CREAT | O_RDWR, S_IREAD | S_IWRITE | S_IEXEC); } #ifdef FRANCAIS printf("lecture fichier %s\n", filename); #else printf("reading file %s\n", filename); #endif return (fd2); } int Lire_Ancien(char *filename) { int n, m, lg; if ((n = openfile(filename)) != -1) { m = 0; while (m < maxsat) { lg = read(fd2, &sat, sizeof(sat)); if (lg <= 0) break; if (fraicheur()) { CopyStru(vieux, m, &sat); m++; } } if (m > maxsat) avorte(); close(fd2); return (m); } else return (n); } /* * MISAJOUR.C version 28 Avril 1991 * retourne le nombre de satellites dans la nouvelle liste * le compteur nsat est égal au nombre de satellites réactualisé * libère la mémoire tampon en sortie */ int Misajour(satel ** vieux, int vv, satel ** nouv, int nn, char option) { int i, j, nnn, vvv; long jour; /* secondes depuis 1er Janv 1970 0 heures GMT */ i = 0; nsat = 0; nnn = 0; vvv = 0; --nn; --vv; time(&jour); switch (option) { /* Option de fusion anciennes & nouvelles données */ case 'F': /* on compare anciennes et nouvelles données * en fonction du numéro de catalogue */ while ((nnn <= nn) && (vvv <= vv)) { if (nouv[nnn]->cat < vieux[vvv]->cat) { CopyStru(tampon, i, nouv[nnn]); nnn++; nsat++; } else if (nouv[nnn]->cat == vieux[vvv]->cat) { /* Objet courant déja au catalogue */ if (((nouv[nnn]->y3 == vieux[vvv]->y3) && (nouv[nnn]->d3 > vieux[vvv]->d3)) || (nouv[nnn]->y3 > vieux[vvv]->y3)) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); memcpy(&tampon[i]->f1, &vieux[vvv]->f1, sizeof(sat.f1)); memcpy(&tampon[i]->pas, &vieux[vvv]->pas, sizeof(sat.pas)); nsat++; } else { CopyStru(tampon, i, vieux[vvv]); } nnn++; vvv++; } else if (nouv[nnn]->cat > vieux[vvv]->cat) { CopyStru(tampon, i, vieux[vvv]); vvv++; } i++; } if (nnn >= nn) { while (vvv <= vv) { CopyStru(tampon, i, vieux[vvv]); vvv++; i++; } } if (vvv >= vv) { while (nnn <= nn) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); nnn++; i++; nsat++; } } break; case 'S': while ((nnn <= nn) && (vvv <= vv)) { if (nouv[nnn]->cat < vieux[vvv]->cat) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); nnn++; i++; nsat++; } else if (nouv[nnn]->cat == vieux[vvv]->cat) { if (((nouv[nnn]->y3 == vieux[vvv]->y3) && (nouv[nnn]->d3 > vieux[vvv]->d3)) || (nouv[nnn]->y3 > vieux[vvv]->y3)) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); /* On conserve la fréuence balise et le pas du calcul */ memcpy(&tampon[i]->f1, &vieux[vvv]->f1, sizeof(sat.f1)); memcpy(&tampon[i]->pas, &vieux[vvv]->pas, sizeof(sat.pas)); nsat++; } else { CopyStru(tampon, i, vieux[vvv]); } nnn++; vvv++; i++; } else if (nouv[nnn]->cat > vieux[vvv]->cat) { vvv++; } } if (vvv >= vv) { while (nnn <= nn) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); nnn++; i++; nsat++; } } break; case 'U': /* mettre à jour seulement les données des satellites déja connus */ while ((nnn <= nn) && (vvv <= vv)) { if (nouv[nnn]->cat < vieux[vvv]->cat) { nnn++; } else if (nouv[nnn]->cat == vieux[vvv]->cat) { if (((nouv[nnn]->y3 == vieux[vvv]->y3) && (nouv[nnn]->d3 > vieux[vvv]->d3)) || (nouv[nnn]->y3 > vieux[vvv]->y3)) { CopyStru(tampon, i, nouv[nnn]); nouv[nnn]->maj = jour; memcpy(&tampon[i]->maj, &nouv[nnn]->maj, sizeof(sat.maj)); memcpy(&tampon[i]->f1, &vieux[vvv]->f1, sizeof(sat.f1)); memcpy(&tampon[i]->pas, &vieux[vvv]->pas, sizeof(sat.pas)); nsat++; } else { CopyStru(tampon, i, vieux[vvv]); } nnn++; vvv++; i++; } else if (nouv[nnn]->cat > vieux[vvv]->cat) { CopyStru(tampon, i, vieux[vvv]); vvv++; i++; } } if (nnn >= nn) { while (vvv <= vv) { CopyStru(tampon, i, vieux[vvv]); vvv++; i++; } } break; } for (j = 0; j < i; j++) CopyStru(nouv, j, tampon[j]); return i; } /******************************** * NASA.C * * * * Version 1.6 du 23/10/94 * retourne -1 si fichier non trouvé * * * avec CRC10 * ********************************/ int crcdix(char *ligne); int fraicheur() { double anciennete; /* ancienneté des prévisions en nombre de jours */ double jours; /* différence de jours */ int annees; /* nombre d'annés */ jours = (double) cejour->tm_yday - sat.d3; annees = (cejour->tm_year - sat.y3) % 100; /* nombre d'années */ if (annees == 0) { anciennete = jours; d_printf(" %d jours d'ancienneté ",(int)(jours + 0.5)); } else { /* jours éoulé */ anciennete = (365.0 - sat.d3) + (double) (annees - 1) * 365.0 + (double) cejour->tm_yday; d_printf(" = %02d années écoulées; %d jours d'ancienneté",annees,(int)(anciennete+0.5)); } if (anciennete < date_limite) return 1; else return 0; } char *epure(char *ligne) { int len = strlen(ligne); char *ptr; while (len > 0) { ptr = ligne + len - 1; if (isgraph(*ptr)) break; *ptr = '\0'; --len; } return ligne; } void nasa(char *filename) { int i, m, r; /* m = number of sat entries - r number of rejected entries */ int twolinemodel; /* 2Line model */ int ligne1valide, ligne2valide; /* enregistrement valide 1 sinon 0 */ char *ligne; /* tampon pour lire ligne du fichier */ long jour; /* secondes depuis 1er Janv 1970 0 heures GMT */ double i0; /* Inclinaison */ double o0; /* R.A.A.N. */ double e0; /* Excentricite */ double w0; /* Argument de perigee */ double m0; /* Anomalie moyenne */ double n0; /* Mouvement moyen */ long k0; /* Orbite de reference */ int set; /* Element Number */ long catalog, cat; /* Catalog Number - anciennement vide */ int y3; /* Annee de reference */ double d3; /* Jour de reference */ double q3; /* Derivee du mouv. moy. */ char caract[13]; char *pointe, *pointeur; satel *satp; FILE *fd; satp = &sat; ligne = (char *) (malloc(82 * sizeof(char))); if (ligne == NULL) avorte(); m = r = 0; fd = fopen(filename, "rt"); if (fd != NULL) { while (!feof(fd)) { twolinemodel = FALSE; ligne1valide = TRUE; ligne2valide = TRUE; catalog = -1; strcpy(ligne, " "); pointe = strchr(ligne, '1'); pointeur = strchr(ligne, 'U'); while ((pointe - ligne != 0) || (pointeur - ligne != 7)) { strncpy(sat.dd, ligne, 17); sat.dd[17] = '\0'; if (strncmp (sat.dd, "DECODE 2-LINE", 13) == 0) twolinemodel = TRUE; if (fgets(ligne, LINE, fd) == NULL) break; epure(ligne); pointe = strchr(ligne, '1'); pointeur = strchr(ligne, 'U'); } if (feof(fd)) break; ligne1valide = crcdix(ligne); if (!feof(fd)) { caract[5] = '\0'; for (i = 2; i < 7; i++) caract[i - 2] = ligne[i]; cat = atol(caract); /* numéro catalogue */ caract[2] = '\0'; caract[0] = ligne[18]; caract[1] = ligne[19]; y3 = atoi(caract); /* année */ caract[12] = '\0'; for (i = 20; i < 32; i++) caract[i - 20] = ligne[i]; d3 = atof(caract); /* jour julien */ caract[10] = '\0'; for (i = 33; i < 43; i++) caract[i - 33] = ligne[i]; q3 = atof(caract); /* 1ère dérivée mouvement moyen */ caract[4] = '\0'; for (i = 64; i < 68; i++) caract[i - 64] = ligne[i]; set = atoi(caract); /* Element Set */ sat.set = set; /* Element Number */ sat.cat = cat; /* numéro catalogue */ sat.y3 = y3; /* année */ sat.d3 = d3; /* jour julien */ sat.q3 = q3; /* 1ère dérivée mouvement moyen */ if (fgets(ligne, LINE, fd) != NULL) ligne2valide = crcdix(ligne); epure(ligne); if (ligne[0] != '2') ligne2valide = 0; /* deuxième ligne */ caract[5] = '\0'; for (i = 2; i < 7; i++) caract[i - 2] = ligne[i]; catalog = atol(caract); /* numéro catalogue */ if (catalog != cat) ligne1valide = 0; caract[8] = '\0'; for (i = 8; i < 16; i++) caract[i - 8] = ligne[i]; i0 = atof(caract); /* inclinaison */ caract[8] = '\0'; for (i = 17; i < 25; i++) caract[i - 17] = ligne[i]; o0 = atof(caract); /* R.A.A.N. */ caract[7] = '\0'; for (i = 26; i < 33; i++) caract[i - 26] = ligne[i]; e0 = atof(caract); /* excentricité*/ e0 /= 10e+06; caract[8] = '\0'; for (i = 34; i < 42; i++) caract[i - 34] = ligne[i]; w0 = atof(caract); /* arg. périgé */ caract[8] = '\0'; for (i = 43; i < 51; i++) caract[i - 43] = ligne[i]; m0 = atof(caract); /* anomal. moyenne */ caract[11] = '\0'; for (i = 52; i < 63; i++) caract[i - 52] = ligne[i]; n0 = atof(caract); /* mouvement moyen */ caract[5] = '\0'; for (i = 63; i < 68; i++) caract[i - 63] = ligne[i]; k0 = atol(caract); /* numéro orbite */ sat.i0 = i0; /* inclinaison */ sat.o0 = o0; /* R.A.A.N. */ sat.e0 = e0; /* excentricité*/ sat.w0 = w0; /* arg. périgé */ sat.m0 = m0; /* anomal. moyenne */ sat.n0 = n0; /* mouvement moyen */ sat.k0 = k0; /* numéro orbite */ sat.a0 = 0.0; /* contient 0.0 */ sat.f1 = 0.0; sat.v1 = 0.0; sat.pas = 5; time(&jour); sat.maj = jour; if (twolinemodel == FALSE) { if ((ligne1valide == -1) || (ligne2valide == -1) || !fraicheur()) printf(" %-18s", sat.dd); else printf("%3d : %-18s", m + 1, sat.dd); if (ligne1valide == TRUE && ligne2valide == TRUE) { if (fraicheur()) { CopyStru(nouveaux, m, satp); m++; /* incrémente le compteur de satellites mis à jour */ printf(" ok\n"); if (m > maxsat) break; } else { #ifdef FRANCAIS printf(" données trop anciennes !\n"); #else printf(" data too old !\n"); #endif } } else { r++; #ifdef FRANCAIS printf(" erreur de CRC !\n"); #else printf(" CRC error !\n"); #endif } } ligne1valide = TRUE; ligne2valide = TRUE; } /* tant que pas fin de fichier */ } /* tant que pas fin de fichier */ fclose(fd); } else m = -1; /* si nul=fichier non trouvé*/ free(ligne); good_crc = m; bad_crc = r; } /* tri a bulle des noms de satellites */ void Tri(satel ** stru, int nombre) { int i, j; satel *tampon; /* tampon pour comparaison */ #ifdef FRANCAIS printf("\ntri alphabétique"); #else printf("\nsorting by name"); #endif /* on trie les pointeurs */ for (i = 0; i < nombre - 1; i++) { printf("."); for (j = i + 1; j < nombre; j++) { if (strcmp(stru[i]->dd, stru[j]->dd) > 0) { tampon = stru[i]; stru[i] = stru[j]; stru[j] = tampon; } } } } /* tri à bulle des numéros de catalogue de satellites */ void Tri_Cat(satel ** stru, int nombre) { int i, j; satel *tampon; /* tampon pour comparaison */ #ifdef FRANCAIS printf("\ntri par numéro de catalogue"); #else printf("\nsorting by catalog number"); #endif /* on trie les pointeurs */ for (i = 0; i < nombre - 1; i++) { printf("."); for (j = i + 1; j < nombre; j++) { if (stru[i]->cat > stru[j]->cat) { tampon = stru[i]; stru[i] = stru[j]; stru[j] = tampon; } } } } fbb-7.0.10/src/k_tasks.c0000644000175000017500000006630613613360505011660 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Taches auxilliaires demandees par le noyau * */ #include #include #include /* Timer head */ static FbbTimer *timer_head = NULL; static int inbuf_bin (int); static int inbuf_xmodem (int); static int inbuf_yapp (int); static int nb_buf (int); static int trait_buf (int); /* void mail_in (void); */ static void tst_buf (int); static int tst_minfwd (int, int); /* Horloge ticker */ long btime (void) { static long oldtime = 0L; static long offset = 0L; long bt; #ifdef __WINDOWS__ struct time dt; gettime (&dt); bt = (((long) dt.ti_hour * 3600L + (long) dt.ti_min * 60L + (long) dt.ti_sec) << 14) / 900L; bt += (((long) dt.ti_hund * 10) << 16) / 3600000L; if (bt > 0x17ffffL) bt = 0x17ffffL; bt += offset; while (bt < oldtime) { /* Le jour a change... */ offset += 0x180000L; bt += 0x180000L; } // WinDebug("bt = %ld\r\n", bt); #endif #ifdef __FBBDOS__ bt = get_ticker (); #endif #ifdef __linux__ struct timeval tv; struct timezone tz; gettimeofday (&tv, &tz); bt = ((tv.tv_sec % 86400L) << 16) / 3600L; bt += ((tv.tv_usec / 1000) << 16) / 3600000L; if (bt > 0x17ffffL) bt = 0x17ffffL; bt += offset; while (bt < oldtime) { /* Le jour a change... */ offset += 0x180000L; bt += 0x180000L; } #endif oldtime = bt; return (bt); } void k_tasks (void) { int port, hour, min; int min_arret; int i; long caltemps; Forward *pfwd; static long balprec[NBPORT]; df ("k_tasks", 0); #ifdef __FBBDOS__ if (video_off == 3) blank_screen (); #endif if (dde_wp_serv) { wp_server (); } #ifdef __FBBDOS__ test_kb (); #endif #ifdef __WIN32__ CheckTasks (); #endif if (aff_use == 0) { free_use (); aff_use = -1; } if (throute) { hupdate (); } if ((p_forward) && (!svoie[CONSOLE]->sta.connect)) { maj_fwd (); } /* Horloge minutes */ time (&caltemps); min = minute (caltemps); hour = heure (caltemps); if (time_bcl == 0) { aff_etat ('Y'); broadcast_list (); time_bcl = def_time_bcl; } /* On force l'arret a H+15 */ min_arret = min - stop_min; if (min_arret < 0) min_arret += 60; if ((save_fic) && ((!actif (0)) || (min_arret >= 15))) { if (min != stop_min) { aff_etat ('Y'); maintenance (); /* reboot serveur */ #ifdef __WINDOWS__ fbb_quit (type_sortie); return; #else exit (type_sortie); #endif } } for (port = 0; port < NBPORT; port++) { if (save_fic) break; if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { if (pfwd->forward == -1) { aff_etat ('F'); appel_fwd (pfwd, port); } pfwd = pfwd->suite; } } } if (test_fichiers) { aff_etat ('Y'); test_fichiers = 0; /* Test des fichiers systeme */ init_bbs (); test_buf_fwd (); init_buf_swap (); init_buf_rej (); load_themes (); test_message = 2; } if ((caltemps / 60) != timeprec) { /* Toutes les minutes */ aff_etat ('Y'); timeprec = caltemps / 60; aff_nbsta (); ferme_log (); /* Flush du log toutes les minutes */ if ((!editor) && (blank > 0)) { if (--blank == 0) video_off = 3; } nb_error = 0; /* fflush (log_ptr); */ #ifdef __FBBDOS__ { /* Test des espaces disque */ struct dfree free; int sdisk = 0; long k_cluster; if (DISK[1] == ':') { sdisk = DISK[0] - '@'; getdfree (sdisk, &free); } else { sdisk = getdisk () + 1; getdfree (sdisk, &free); } k_cluster = ((long) free.df_sclus * (long) free.df_bsec) / 1024L; sys_disk = free.df_avail * k_cluster; if ((sdisk) && (MBIN[1] == ':') && (MBIN[0] != DISK[0])) { k_cluster = ((long) free.df_sclus * (long) free.df_bsec) / 1024L; sdisk = MBIN[0] - '@'; getdfree (sdisk, &free); tmp_disk = free.df_avail * k_cluster; } else tmp_disk = sys_disk; } if (ch_fen) { maj_fen (); } #endif aff_date (); env_date (); init_bbs (); if (hour != hour_time) { hour_time = hour; cron (caltemps); send_wp_mess (); } if ((hour == h_maint) && (min == 0)) { house_keeping (); } #ifdef __WINDOWS__ if (!WindowService ()) #endif mail_in (); /* if (p_forward == 0) test_buf_fwd(); */ init_hold (); init_buf_swap (); init_buf_rej (); load_themes (); aff_msg_cons (); for (port = 0; port < NBPORT; port++) { if (save_fic) break; if (!p_port[port].pvalid) continue; if (tst_minfwd (min, port)) { for (i = 0; i < NBMASK; i++) p_port[port].fwd[i] = '\0'; pfwd = p_port[port].listfwd; while (pfwd) { if ((pfwd->forward == 0) && (ch_voie (port, 0) != -1)) { *pfwd->fwdbbs = '\0'; pfwd->forward = -1; pfwd->fwdpos = 0; pfwd->fin_fwd = pfwd->cptif = pfwd->fwdlig = 0; pfwd->reverse = 0; } if (pfwd->forward == -1) { if (pfwd->fwdpos == 0xffff) pfwd->forward = 0; else { aff_etat ('F'); appel_fwd (pfwd, port); } } pfwd = pfwd->suite; } } if (t_balise[port] == 0) continue; if (caltemps / t_balise[port] != balprec[port]) { balprec[port] = caltemps / t_balise[port]; if (!arret) { send_balise (port); } } } } ff (); } static int extern_task (int voie) { if ((svoie[voie]->niv1 == N_MOD) && ((svoie[voie]->niv3 == XS_EXTERN) || (svoie[voie]->niv3 == XR_EXTERN))) return 1; #ifdef __WINDOWS__ if (editor_on ()) return (1); #endif return (0); } static int off_time (void) { static long prec_time = 0L; long diff_time; df ("off_time", 0); if (prec_time == 0L) prec_time = time (NULL); diff_time = time (NULL) - prec_time; prec_time += diff_time; ff (); return ((int) diff_time); } int del_timer (FbbTimer * timer_id) { FbbTimer *tt = timer_head; FbbTimer *pr = NULL; while (tt) { if (tt == timer_id) { if (pr) { pr->next = tt->next; m_libere (tt, sizeof (FbbTimer)); } else { timer_head = tt->next; m_libere (tt, sizeof (FbbTimer)); } return (1); } pr = tt; tt = tt->next; } return (0); } FbbTimer *add_timer (int delay, int port, void FAR * fct, void *userdata) { FbbTimer *tt = timer_head; if (tt) { while (tt->next) tt = tt->next; tt->next = (FbbTimer *) m_alloue (sizeof (FbbTimer)); tt = tt->next; } else tt = timer_head = (FbbTimer *) m_alloue (sizeof (FbbTimer)); tt->next = NULL; tt->userdata = userdata; tt->port = port; tt->temps = (delay * 182) / 10; tt->fct = fct; return (tt); } static void fbb_timer (void) { static long bprec = -1; long bt; FbbTimer *tt; FbbTimer *pr; long delta; bt = btime (); delta = bt - bprec; if (delta == 0) return; bprec = bt; tt = timer_head; pr = NULL; while (tt) { if (tt->temps >= (time_t) delta) tt->temps -= (time_t) delta; else tt->temps = 0L; if (tt->temps == 0L) { if (tt->fct) (*tt->fct) (tt->port, tt->userdata); /* Supprimer le timer */ del_timer (tt); break; /*if (pr) tt = pr->next; else tt = timer_head; */ } else { pr = tt; tt = tt->next; } } } void user_time_out (void) { int voie; int port; int com; int dt; dt = off_time (); fbb_timer (); if (dt == 0) return; df ("user_time_out", 0); /* System timers */ if (t_tell > 0) { t_tell -= (18 * dt); if (t_tell < 0) t_tell = 0; } if (time_bcl > 0) { time_bcl -= (18 * dt); if (time_bcl < 0) time_bcl = 0; } for (com = 0; com < NBPORT; com++) { if (p_com[com].baud) p_com[com].delai += dt; } for (port = 0; port < NBPORT; port++) { if ((p_port[port].pvalid) && (p_port[port].stop > 0)) { if (p_port[port].stop > dt) p_port[port].stop -= dt; else p_port[port].stop = 0; } } for (voie = 0; voie < NBVOIES; voie++) { /* disconnect test added - F6BVP if (svoie[voie]->sta.connect == 0) time_att[voie] = 0; */ if ((!extern_task (voie)) && (svoie[voie]->sta.connect !=0) && ((voie != CONSOLE) || (!editor))) { /* Was if (time_att[voie] > 0) F6BVP */ if (time_att[voie] >= 0) { time_att[voie] -= dt; if (time_att[voie] <= 0) { /* fprintf(stderr, "Timeout voie %d depasse\n", voie);*/ time_att[voie] = 0; if (svoie[voie]->nb_err == 10) { /* Voie bloquee -> Liberation d'office */ /* fprintf(stderr, "Voie %d bloquee. Liberation d'office\n", voie);*/ svoie[voie]->sta.connect = 0; svoie[voie]->deconnect = 0; svoie[voie]->niv3 = 0; svoie[voie]->niv2 = 0; svoie[voie]->niv1 = 0; } else { svoie[voie]->deconnect = 2; svoie[voie]->nb_err = 10; traite_voie (voie); } } } if (time_yapp[voie] > 0) { time_yapp[voie] -= dt; if (time_yapp[voie] < 0) time_yapp[voie] = 0; } } } ff (); } void mail_in (void) { struct stat buf; if ((!is_room ()) || (svoie[INEXPORT]->sta.connect) || (inexport)) return; df ("mail_in", 0); mail_ch = INEXPORT; /* if (access (MAILIN, 0) == 0) */ if (stat (MAILIN, &buf) == 0) { init_etat (); selvoie (mail_ch); strcpy (pvoie->sta.indicatif.call, mycall); pvoie->sta.indicatif.num = 0; pvoie->enrcur = 0L; pvoie->mode = F_FOR; pvoie->fbb = 0; pvoie->mbl_ext = 0; pvoie->prot_fwd = FWD_MBL; pvoie->finf.lang = langue[0]->numlang; pvoie->ncur = &def_cur; pvoie->debut = time (NULL); pvoie->tstat = pvoie->debut; pvoie->tmach = 0L; strcpy (io_fich, MAILIN); inexport = 4; /* Apres console_on ! */ pvoie->sta.connect = inexport; /* Apres console_on ! */ aff_event (mail_ch, 1); maj_niv (N_MBL, 99, 0); #ifdef __WINDOWS__ window_connect (voiecur); #endif aff_nbsta (); } ff (); } int mail_out (char *fichier) { if ((svoie[INEXPORT]->sta.connect) || (inexport)) return (0); df ("mail_out", 2); mail_ch = INEXPORT; selvoie (mail_ch); n_cpy (256, io_fich, strlwr(fichier)); strcpy (pvoie->sta.indicatif.call, "MAIL"); pvoie->sta.indicatif.num = 0; aff_event (mail_ch, 1); inexport = 4; pvoie->sta.connect = inexport; pvoie->enrcur = 0L; pvoie->debut = time (NULL); pvoie->tstat = pvoie->debut; pvoie->tmach = 0L; pvoie->mode = F_FOR | F_HIE | F_BID | F_MID; pvoie->finf.lang = langue[0]->numlang; pvoie->ncur = &def_cur; maj_niv (N_MBL, 98, 0); #ifdef __WINDOWS__ window_connect (voiecur); #endif aff_nbsta (); ff (); return (1); } int voie_forward (int voie) { int port; Forward *pfwd; df ("voie_forward", 1); if (voie != CONSOLE) { for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { if (pfwd->forward == voie) { ff (); return (1); } pfwd = pfwd->suite; } } } } ff (); return (0); } int tst_minfwd (int min, int noport) { int test = p_port[noport].min_fwd; int inc = 0; df ("tst_minfwd", 2); while (inc < 60) { if (test == min) { ff (); return (1); } inc += p_port[noport].per_fwd; test += p_port[noport].per_fwd; if (test >= 60) test -= 60; } ff (); return (0); } indicat *get_indic (char *chaine) { int c = 0; int nb = 0; char *ptr; static indicat indic; df ("get_indic", 2); ptr = indic.call; while (isalnum (*chaine)) { *ptr++ = toupper (*chaine); ++chaine; if (++nb == 6) break; } *ptr = '\0'; if (*chaine++ == '-') c = atoi (chaine); indic.num = c; ff (); return (&indic); } void add_heard (int port, indicat * indic) { int i; long date = 0x7fffffffL; Heard *pobs = NULL; Heard *pheard = p_port[port].heard; df ("add_heard", 3); for (i = 0; i < NBHEARD; i++) { if ((pheard->last) && (strcmp (pheard->indic.call, indic->call) == 0) && (pheard->indic.num == indic->num)) { pheard->last = time (NULL); ++pheard->nb; ff (); return; } if (date > pheard->last) { date = pheard->last; pobs = pheard; } ++pheard; } pobs->indic = *indic; pobs->first = pobs->last = time (NULL); pobs->nb = 1; ff (); } static void tst_buf (int voie) { df ("tst_buf", 0); if ((svoie[voie]->memoc <= MAXMEM / 2) && (svoie[voie]->sr_mem)) { ptype = SN; if (debug_on) { fprintf (debug_fptr, "Tst_buf : %d\n", svoie[voie]->memoc); } traite_voie (voie); } ff (); } static int nb_buf (int voie) { int port = no_port (voie); int nb = (int) p_port[port].frame * 2; df ("nb_buf", 1); switch (p_port[port].typort) { case TYP_PK: case TYP_KAM: if (nb > 6) nb = 6; break; case TYP_DED: if (svoie[voie]->sta.mem < 100) nb /= 2; break; case TYP_FLX: /* if (svoie[voie]->sta.mem < 8) nb /= 2; if (nb > 7) */ nb = 7; break; case TYP_BPQ: if (svoie[voie]->sta.mem < 60) nb /= 2; break; #ifdef __WIN32__ case TYP_MOD: nb = 50; break; #endif } ff (); return (nb); } int ack_suiv (int voie) { int nblig, n_buf, vide = TRUE, retour = 0; int ch_status; int port = no_port (voie); stat_ch sta; /* Etat de la voie */ stat_ch sta_new; /* Etat de la voie */ df ("ack_suiv", 1); ch_status = svoie[voie]->ch_status; sta = svoie[voie]->sta; sta_new = sta; #ifdef __WINDOWS__ if (ETHER (no_port (voie))) { sta_new.ack = tcp_busy (voie); svoie[voie]->sta = sta_new; if (memcmp (&sta, &sta_new, sizeof (stat_ch)) != 0) ch_status = 1; } else #endif if (sta_drv (voie, TNCSTAT, &sta_new)) { if (svoie[voie]->sta.ack != sta_new.ack) ch_status = 1; if (svoie[voie]->sta.ret != sta_new.ret) ch_status = 1; svoie[voie]->sta = sta_new; /*if (memcmp(&sta, &sta_new, sizeof(stat_ch)) != 0) ch_status = 1; */ } if (svoie[voie]->outptr == NULL) svoie[voie]->aut_nc = 0; if (svoie[voie]->dde_int) interruption (voie); svoie[voie]->maxbuf = nb_buf (voie); if (voie == CONSOLE) svoie[voie]->sta.ack = 0; if (svoie[voie]->ask) { svoie[voie]->ask = 0L; traite_voie (voie); } #ifdef __linux__ /* dprintf("bin = %d\n", svoie[voie]->binary); */ if (svoie[voie]->binary == 2) { #if 0 /* Process en FORK */ char buffer[300]; int fd = svoie[voie]->to_xfbb[0]; int nb; int old = fcntl (fd, F_GETFL, 0); (void) fcntl (fd, F_SETFL, old | O_NDELAY); do { nb = read (fd, buffer, 300); if (nb < 0) { perror ("read"); nb = 0; } if (nb) { int i; dprintf ("Recu %d carac de rszs (fd = %d)\n", nb, fd); for (i = 0; i < nb; i++) dprintf ("%02x ", buffer[i] & 0xff); dprintf ("\n"); selvoie (voie); outs (buffer, nb); } if (svoie[voie]->memoc >= MAXMEM) { /* pvoie->sr_mem = TRUE; */ break; } } while (nb > 0); (void) fcntl (fd, F_SETFL, old); #endif } #endif if ((svoie[voie]->sta.ack) || (svoie[voie]->outptr)) { if (!svoie[voie]->sta.connect) { clear_outbuf (voie); svoie[voie]->sta.ack = 0; } else { if ((svoie[voie]->stop) && ((nblig = lig_bufi (voie)) != 0)) { trait_buf (voie); if (nblig != lig_bufi (voie)) prog_more (voie); } if (!svoie[voie]->stop) { int aff_status = 1; /* status(voie) ; */ if ((voie == CONSOLE) || (DEBUG) || (!p_port[port].pvalid)) { n_buf = svoie[voie]->maxbuf; while ((!svoie[voie]->stop) && (svoie[voie]->outptr) && (n_buf--)) { if (aff_status) { aff_etat ('K'); aff_status = 0; init_timout (voie); ch_status = 1; vide = FALSE; } aff_etat ('E'); send_buf (voie); tst_buf (voie); } } else { int lettre = 0; while ((!svoie[voie]->stop) && (svoie[voie]->outptr) && (svoie[voie]->sta.ack < svoie[voie]->maxbuf) && (min_ok (voie))) { if (lettre == 0) { lettre = aff_etat ('E'); } if (aff_status) { aff_etat ('K'); aff_status = 0; init_timout (voie); ch_status = 1; vide = FALSE; } if (send_buf (voie) == 0) break; tst_buf (voie); aff_etat (lettre); } /* Repasse le TNC en reception */ if ((svoie[voie]->seq == 0) && (svoie[voie]->pack) && (svoie[voie]->t_tr == 0) && (svoie[voie]->outptr == NULL)) { tor_stop (voie); svoie[voie]->pack = 0; } } } retour = 1; } } if (ch_status) status (voie); if (vide) aff_etat ('A'); ff (); return (retour); } int inbuf_ok (int voie) { df ("inbuf_ok", 1); nb_trait = 0; if (svoie[voie]->binary) { switch (svoie[voie]->niv1) { case N_YAPP: case N_FORW: ff (); return (inbuf_yapp (voie)); case N_MOD: ff (); return (inbuf_xmodem (voie)); case N_BIN: case N_XFWD: ff (); return (inbuf_bin (voie)); } } else { if (((v_tell) && (v_tell == voie) && (t_tell == 0)) || ((svoie[voie]->inbuf.nblig) && (!svoie[voie]->outptr)) || (svoie[voie]->deconnect > 0)) { if ((svoie[voie]->sta.connect == 0) && (svoie[voie]->deconnect == 0)) clear_inbuf (voie); ff (); return (1); } } ff (); return (0); } int inbuf_bin (int voie) { int nb; df ("inbuf_xmodem", 1); nb = svoie[voie]->inbuf.nbcar; if (svoie[voie]->enrcur + (long) nb > svoie[voie]->tailm) nb_trait = (int) (svoie[voie]->tailm - svoie[voie]->enrcur); else nb_trait = nb; if (nb_trait == 0) { ff (); return (0); } ff (); return (1); } int inbuf_xmodem (int voie) { df ("inbuf_xmodem", 1); if ((nb_trait = svoie[voie]->inbuf.nbcar) == 0) { ff (); return (0); } ff (); return (1); } int inbuf_yapp (int voie) { char *ptr; lbuf *bptr; int nb, fct, ext; df ("inbuf_yapp", 1); if ((nb = svoie[voie]->inbuf.nbcar) < 2) { if (time_yapp[voie] == 0) { nb_trait = 0; ptype = TM; time_yapp[voie] = -1; ff (); return (1); } else { ff (); return (0); } } ptr = svoie[voie]->inbuf.tete->buffer + svoie[voie]->inbuf.nocar; fct = *ptr++ & 0xff; if ((svoie[voie]->inbuf.tete->lgbuf - svoie[voie]->inbuf.nocar) == 1) { if (svoie[voie]->inbuf.tete->suite == NULL) { cprintf ("suite nul - nocar %d - lgbuf %d - nbcar %d c1 %d c2 %d %s\r\n\n\n", svoie[voie]->inbuf.nocar, svoie[voie]->inbuf.tete->lgbuf, svoie[voie]->inbuf.nbcar, *(ptr - 2) & 0xff, *(ptr - 1) & 0xff, svoie[voie]->sta.indicatif.call); } if (svoie[voie]->inbuf.tete->suite->buffer == NULL) { cprintf ("buffer nul - nocar %d - lgbuf %d - nbcar %d c1 %d c2 %d %s\r\n\n\n", svoie[voie]->inbuf.nocar, svoie[voie]->inbuf.tete->lgbuf, svoie[voie]->inbuf.nbcar, *(ptr - 2) & 0xff, *(ptr - 1) & 0xff, svoie[voie]->sta.indicatif.call); } ext = *(svoie[voie]->inbuf.tete->suite->buffer) & 0xff; } else ext = *ptr & 0xff; ptype = UK; switch (fct) { case ACK: nb_trait = 2; switch (ext) { case 1: ptype = RR; svoie[voie]->time_trans = time (NULL); break; case 2: ptype = RF; svoie[voie]->time_trans = time (NULL); svoie[voie]->type_yapp = 0; break; case 3: ptype = AF; break; case 4: ptype = AT; break; case 5: ptype = CA; break; case ACK: ptype = RF; svoie[voie]->type_yapp = 1; break; } break; case ENQ: nb_trait = 2; switch (ext) { case 1: ptype = SI; break; case 2: ptype = RI; break; } break; case SOH: nb_trait = (int) ext + 2; ptype = HD; break; case STX: nb_trait = (ext) ? (int) ext + 2 : 258; if (svoie[voie]->type_yapp) ++nb_trait; ptype = DT; break; case ETX: nb_trait = 2; if (ext == 1) ptype = EF; break; case EOT: nb_trait = 2; /*if (ext == 1) */ ptype = ET; break; case NAK: nb_trait = ext + 2; ptype = NR; break; case CAN: nb_trait = ext + 2; ptype = CN; break; case DLE: nb_trait = ext + 2; ptype = TX; break; default: --svoie[voie]->inbuf.nbcar; if (++svoie[voie]->inbuf.nocar == svoie[voie]->inbuf.tete->lgbuf) { bptr = svoie[voie]->inbuf.tete->suite; /* svoie[voie]->memoc -= svoie[voie]->inbuf.tete->lgbuf ; */ m_libere ((char *) svoie[voie]->inbuf.tete->buffer, svoie[voie]->inbuf.tete->lgbuf); m_libere ((char *) svoie[voie]->inbuf.tete, sizeof (lbuf)); svoie[voie]->inbuf.tete = bptr; svoie[voie]->inbuf.nocar = 0; } nb_trait = 0; ff (); return (0); } if (nb < nb_trait) { if (time_yapp[voie] == 0) { nb_trait = 0; ptype = TM; time_yapp[voie] = -1; ff (); return (1); } ff (); return (0); } if (svoie[voie]->kiss == -2) init_timout (CONSOLE); if (ptype == TX) { trait_buf (voie); out_txt (); ff (); return (0); } ff (); return (1); } /* * Recopie dans data une ligne d'un max de 300 caracteres a traiter et * retourne le nb de caracteres a traiter */ int trait_buf (int voie) { char *ptri; char *ptro = data; lbuf *bptr; int c, nb, nbtot, fin; FScreen *screen = &conbuf; df ("trait_buf", 1); fin = nbtot = 0; if ((svoie[voie]->binary) && (nb_trait == 0)) { ff (); return (0); } while ((!fin) && (svoie[voie]->inbuf.tete)) { ptri = svoie[voie]->inbuf.tete->buffer + svoie[voie]->inbuf.nocar; /* recopie buffer dans buffer de datas */ nb = svoie[voie]->inbuf.tete->lgbuf - svoie[voie]->inbuf.nocar; while (nb) { c = *ptri++; --svoie[voie]->inbuf.nbcar; ++svoie[voie]->inbuf.nocar; nb--; if ((svoie[voie]->binary) || (c != '\n')) { *ptro++ = c; ++nbtot; if (svoie[voie]->binary) { if (c == '\r') --svoie[voie]->inbuf.nblig; if (--nb_trait == 0) { fin = 1; break; } } else { if (c == '\r') { /* Sortie si fin de ligne */ --svoie[voie]->inbuf.nblig; fin = 1; if ((voie == CONSOLE) && (screen->totlig)) { data[nbtot] = '\0'; #ifdef __FBBDOS__ inputs (CONSOLE, W_CNST, data); #endif } break; } } if (nbtot == DATABUF) { fin = 1; break; } } } if (nb == 0) { bptr = svoie[voie]->inbuf.tete->suite; /* svoie[voie]->memoc -= svoie[voie]->inbuf.tete->lgbuf ; */ m_libere ((char *) svoie[voie]->inbuf.tete->buffer, svoie[voie]->inbuf.tete->lgbuf); m_libere ((char *) svoie[voie]->inbuf.tete, sizeof (lbuf)); svoie[voie]->inbuf.tete = bptr; svoie[voie]->inbuf.nocar = 0; } } *ptro = '\0'; ff (); return (nbtot); } void traite_voie (int voie) { /* char *ptr = s ; */ int nbuf, mode; long debtrait; df ("traite_voie", 1); aff_etat ('T'); selvoie (voie); if (pvoie->sta.connect != 0) { init_timout (voie); /* fprintf (stderr, "Initialisation timeout voie %d a %d mn\n", voie, svoie[voie]->timout / 60); */ } if (pvoie->sta.connect) init_langue (voie); status (voie); if ((voie == INEXPORT) && (inexport)) { aff_traite (voiecur, TRUE); time (&debtrait); premier_niveau (); pvoie->tmach += time (NULL) - debtrait; aff_traite (voiecur, FALSE); vlang = 0; free_mem (); ff (); return; } if (pvoie->deconnect) clear_inbuf (voie); if (tot_mem > 5000L) { if ((!pvoie->binary) && (!svoie[CONSOLE]->sta.connect)) { aff_header (voie); } if ((!pvoie->deconnect) && (pvoie->sta.connect != 0) && (voie >= 0) && (voie < NBVOIES)) { if ((!pvoie->seq) && (!pvoie->sr_mem)) prog_more (voie); if (!pvoie->stop) { if ((!pvoie->sr_mem) && (!pvoie->seq)) { nb_trait = trait_buf (voie); } else nb_trait = 0; if (aff_ok(voiecur)) { deb_io (); aff_bas (voiecur, W_RCVT, data, nb_trait); fin_io (); } aff_traite (voiecur, TRUE); time (&debtrait); if ((voie == CONSOLE) && (print)) { #if defined(__WINDOWS__) || defined(__linux__) SpoolLine (voie, W_RCVT, data, strlen (data)); #else fputs (data, file_prn); if (data[nb_trait - 1] == '\r') fputc ('\n', file_prn); #endif } if (pvoie->dde_marche) en_navant_toute (); else { indd = data; pvoie->t_tr = 1; #ifdef COMPUTE deb_compute (); #endif premier_niveau (); #ifdef COMPUTE end_compute (); #endif pvoie->t_tr = 0; data[0] = '\0'; nbuf = pvoie->maxbuf; while ((nbuf-- > 0) && (pvoie->sta.ack < 4) && (pvoie->outptr) && (min_ok (voie))) { send_buf (voie); } } pvoie->tmach += time (NULL) - debtrait; aff_traite (voiecur, FALSE); } /* Repasse le TNC en reception */ if ((pvoie->seq == 0) && (pvoie->pack) && (pvoie->t_tr == 0) && (pvoie->outptr == NULL)) { tor_stop (voiecur); pvoie->pack = 0; } } } if (pvoie->deconnect > 0) { switch (pvoie->deconnect) { case 1: if ((!voie_forward (voie)) && (voie != CONSOLE) && (!P_GUEST (voie)) && /* (EXP(pvoie->finf.flags) == 0) && */ (BBS (pvoie->finf.flags) == 0) && (FOR (pvoie->mode) == 0) ) { texte (T_MES + 12); aff_etat ('E'); send_buf (voie); } fbb_log (voiecur, 'X', "B"); pvoie->log = 0; if (pvoie->deconnect == 1) mode = bpq_deconnect; else mode = 1; deconnexion (voie, mode); break; case 2: texte (T_ERR + 31); aff_etat ('E'); send_buf (voie); fbb_log (voiecur, 'X', "T"); pvoie->log = 0; force_deconnexion (voie, 1); break; case 3: fbb_log (voiecur, 'X', "F"); pvoie->log = 0; force_deconnexion (voie, 1); break; case 4: fbb_log (voiecur, 'X', "M"); pvoie->log = 0; force_deconnexion (voie, 1); break; case 5: fbb_log (voiecur, 'X', "P"); pvoie->log = 0; force_deconnexion (voie, 1); break; case 6: fbb_log (voiecur, 'X', "B"); pvoie->log = 0; if (pvoie->deconnect == 1) mode = bpq_deconnect; else mode = 1; deconnexion (voie, mode); break; case 7: outln ("Sorry, no more channels available", 33); aff_etat ('E'); send_buf (voie); pvoie->log = 0; force_deconnexion (voie, 1); break; default: fbb_log (voiecur, 'X', "?"); pvoie->log = 0; force_deconnexion (voie, 1); break; } pvoie->deconnect = -1; } vlang = 0; free_mem (); aff_etat ('A'); ff (); } void premier_niveau (void) { df ("premier_niveau", 0); /* Task identifier */ ++tid; switch (pvoie->niv1) { case N_MENU: menu_principal (); break; #ifndef MINISERV case N_QRA: qraloc (); break; case N_STAT: statistiques (); break; case N_INFO: documentations (); break; case N_NOMC: nomenclature (); break; case N_TRAJ: trajec (); break; #endif case N_DOS: dos (); break; case N_MOD: modem (); break; case N_BIN: bin_transfer (); break; case N_MBL: mbl_emul (); break; case N_FORW: fwd (); break; case N_TELL: duplex_tnc (); break; case N_YAPP: yapp (); break; case N_CONF: conference (); break; case N_RBIN: send_bin_message (); break; case N_THEMES: themes (); break; case N_XFWD: xfwd (); break; default: fbb_error (ERR_NIVEAU, "KERNEL", pvoie->niv1); break; } ff (); } fbb-7.0.10/src/info.c0000644000175000017500000002015013613360505011137 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE INFORMATIONS */ #include #define LGINF 128 #define LGLABEL 31 #define MAXLABEL 258 #define NBINF MAXLABEL-2 static char *read_doc_label (char *); static int open_doc_label (void); static int selecte (int); static int trie_docs (void); static void affich_docs (void); static void close_doc_label (void); static void docs (void); static void retour_doc (void); static void retour_docs (void); static void send_doc (char *); static void write_doc_label (void); typedef struct { char dir; char nom[LGINF]; } inf; typedef struct { char nom[LGINF]; char label[LGLABEL]; } doc_label; static inf *ptete; static doc_label *label_ptr; static unsigned nb_label; static void docs (void) { limite_commande (); switch (toupper (*indd)) { case 'R': retour_docs (); retour_doc (); break; case 'F': retour_menu (N_MENU); break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; case 'L': case 'W': affich_docs (); retour_doc (); /* retour_menu(N_MENU); */ break; case 'D': if (droits (MODLABEL)) { write_doc_label (); retour_doc (); } else cmd_err (indd); break; default: if (!defaut ()) { if (isdigit (*indd)) { if (!selecte (atoi (indd))) retour_doc (); } else { if (ISGRAPH (*indd)) cmd_err (indd); else retour_doc (); /* texte(T_INF+3); retour_doc(); */ } } break; } } static void retour_docs (void) { char *ptr; #ifdef __linux__ ptr = strrchr (pvoie->ch_temp, '/'); #else ptr = strrchr (pvoie->ch_temp, '\\'); #endif if (ptr == NULL) *pvoie->ch_temp = '\0'; else *ptr = '\0'; } static int selecte (int numero) { char s[80]; inf *pdoc; int fic = 0; int nb = trie_docs (); --numero; if ((numero >= 0) && (numero < nb)) { pdoc = ptete + numero; if (pdoc->dir == 'D') { #ifdef __linux__ strcat (pvoie->ch_temp, "/"); #else strcat (pvoie->ch_temp, "\\"); #endif strcat (pvoie->ch_temp, pdoc->nom); } else { #ifdef __linux__ sprintf (s, "%s%s%s", DOCSDIR, pvoie->ch_temp, pdoc->nom); #else sprintf (s, "%s%s\\%s", DOCSDIR, pvoie->ch_temp, pdoc->nom); #endif fic = 1; } } else { texte (T_INF + 3); } m_libere (ptete, sizeof (inf) * NBINF); if (fic) { ch_niv2 (1); send_doc (s); } return (fic); } static int trie_docs (void) { char localdir[MAXLABEL]; int fin, nbinf = 0; inf *pdoc; struct ffblk dirblk; pdoc = ptete = (inf *) m_alloue (sizeof (inf) * NBINF); #ifdef __linux__ sprintf (localdir, "%s%s*.*", DOCSDIR, pvoie->ch_temp); #else sprintf (localdir, "%s%s\\*.*", DOCSDIR, pvoie->ch_temp); #endif fin = findfirst (localdir, &dirblk, FA_DIREC); while (!fin) { if ((*dirblk.ff_name != '.') && (strcmp (dirblk.ff_name, "@@.LBL"))) { strcpy (pdoc->nom, dirblk.ff_name); pdoc->dir = (dirblk.ff_attrib & FA_DIREC) ? 'D' : 'F'; ++pdoc; ++nbinf; } if (nbinf == NBINF) break; fin = findnext (&dirblk); } if (nbinf) qsort ((void *) ptete, nbinf, sizeof (inf), (int (*)(const void *, const void *)) strcmp); return (nbinf); } static void affich_docs (void) { int pos, i, nbinf, dir = 1, dde_cr = 0; inf *pdoc; char s[80]; char *ptr, *sptr; nbinf = trie_docs (); pdoc = ptete; i = 1; pos = 0; while (nbinf--) { if (pdoc->dir == 'F') { if (dir) { if (open_doc_label ()) { if (pos != 0) cr (); cr (); dir = 0; pos = 0; } /*else break; */ } ptr = read_doc_label (pdoc->nom); if (droits (MODLABEL)) { if (ptr) { sprintf (s, "%2d:%-12s %-24s", i, pdoc->nom, ptr); } else { sprintf (s, "%2d:%-36s", i, pdoc->nom); } dde_cr = 1; } else { if (ptr) { sprintf (s, "%2d:%-32s", i, ptr); dde_cr = (++pos == 2); } else *s = '\0'; } } else { sptr = pdoc->nom; while (*sptr) { if (*sptr == '_') *sptr = ' '; ++sptr; } if ((sptr = strchr (pdoc->nom, '.')) != NULL) { while ((*sptr = *(sptr + 1)) != '\0') ++sptr; } sprintf (s, "%2d:%-12s", i, pdoc->nom); dde_cr = (++pos == 5); } out (s, strlen (s)); if (dde_cr) { cr (); pos = 0; dde_cr = 0; } ++pdoc; ++i; } if (pos != 0) cr (); cr (); if (dir == 0) close_doc_label (); m_libere (ptete, sizeof (inf) * NBINF); } static int open_doc_label (void) { int fd; doc_label *plabel; char nom_label[MAXLABEL]; nb_label = 0; #ifdef __linux__ sprintf (nom_label, "%s%s@@.LBL", DOCSDIR, pvoie->ch_temp); #else sprintf (nom_label, "%s%s\\@@.LBL", DOCSDIR, pvoie->ch_temp); #endif if ((fd = open (nom_label, O_RDONLY | O_BINARY)) != -1) { nb_label = (unsigned) (filelength (fd) / sizeof (doc_label)); if (nb_label == 0) return (0); plabel = label_ptr = (doc_label *) m_alloue (nb_label * sizeof (doc_label)); while (read (fd, plabel, sizeof (doc_label))) ++plabel; close (fd); return (1); } else return (0); } static void write_doc_label (void) { int i, nb, fd; char *ptr; doc_label label, tmp_label; char nom_label[MAXLABEL]; incindd (); nb = 0; if ((ptr = strtok (indd, " \r")) == NULL) { texte (T_ERR + 20); return; } ++nb; #ifdef __linux__ n_cpy (LGINF - 1, tmp_label.nom, ptr); sprintf (nom_label, "%s%s%s", DOCSDIR, pvoie->ch_temp, tmp_label.nom); #else strn_cpy (LGINF - 1, tmp_label.nom, ptr); sprintf (nom_label, "%s%s\\%s", DOCSDIR, pvoie->ch_temp, tmp_label.nom); #endif if (access (nom_label, 0) != 0) { strcpy (pvoie->appendf, tmp_label.nom); texte (T_ERR + 11); return; } if ((ptr = strtok (NULL, "\r")) != NULL) { ++nb; n_cpy (LGLABEL - 1, tmp_label.label, ptr); } if (nb == 2) { #ifdef __linux__ sprintf (nom_label, "%s%s@@.LBL", DOCSDIR, pvoie->ch_temp); #else sprintf (nom_label, "%s%s\\@@.LBL", DOCSDIR, pvoie->ch_temp); #endif if ((fd = open (nom_label, O_CREAT | O_RDWR | O_BINARY, S_IREAD | S_IWRITE)) != -1) { i = 0; while (read (fd, &label, sizeof (doc_label))) { if (strcmp (label.nom, tmp_label.nom) == 0) break; ++i; } lseek (fd, (long) i * sizeof (doc_label), 0); write (fd, &tmp_label, sizeof (doc_label)); close (fd); } } else texte (T_ERR + 0); } static void close_doc_label (void) { if (nb_label) m_libere (label_ptr, nb_label * sizeof (doc_label)); } static char *read_doc_label (char *nom) { int i; doc_label *plabel = label_ptr; for (i = 0; i < nb_label; i++, plabel++) { if (strcmp (plabel->nom, nom) == 0) return (plabel->label); } return (NULL); } static void send_doc (char *doc) { switch (pvoie->niv3) { case 0: strcpy (pvoie->sr_fic, doc); pvoie->enrcur = 0L; if (senddata (0)) retour_doc (); else ch_niv3 (1); break; case 1: if (senddata (0)) retour_doc (); break; } } void doc_path (void) { char *ptr; char *p; var_cpy (0, pvoie->ch_temp); ptr = varx[0]; while (*ptr) { /* if (*ptr == '\\') *ptr = '|'; else */ if (*ptr == '_') *ptr = ' '; else if (*ptr == '.') { p = ptr; while ((*p = *(p + 1)) != '\0') ++p; } ++ptr; } } void retour_doc (void) { doc_path (); retour_menu (N_INFO); } void documentations (void) { switch (pvoie->niv2) { case 0: docs (); break; case 1: send_doc (NULL); break; } } fbb-7.0.10/src/init_srv.c0000644000175000017500000003323513615603431012051 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #include #include static int no_init_error = 1; void err_init (int lig) { no_init_error = 0; #if defined(__WINDOWS__) ShowError ("INIT.SRV", "Error line", lig); fbb_quit (0); #endif #if defined(__linux__) ShowError ("FBB.CONF", "Error line", lig); fbb_quit (0); #endif #ifdef __FBBDOS__ #ifdef ENGLISH cprintf ("Error file INIT.SRV line %d \r\n\a", lig); #else cprintf ("Erreur fichier INIT.SRV ligne %d\r\n\a", lig); #endif curon (); sleep (10); exit (0); #endif } static char *test_back_slash (char *chaine, int nolig) { static char temp[256]; strcpy(temp, chaine); #ifdef __linux__ if (temp[strlen (temp) - 1] != '/') strcat(temp, "/"); /* err_init (nolig); */ #else if (temp[strlen (temp) - 1] != '\\') err_init (nolig); #endif return (temp); } void end_admin (void) { Msysop *sptr; while (mess_sysop) { sptr = mess_sysop; mess_sysop = mess_sysop->next; m_libere (sptr, sizeof (Msysop)); } libere_serveurs (); } #define FIELDS 0x301f /* Mask of the mandatory fields */ static char *inistr[] = { "vers", /* 0 */ "call", /* 1 */ "ssid", /* 2 */ "qral", /* 3 */ "city", /* 4 */ "conf", /* 5 */ "data", /* 6 */ "mess", /* 7 */ "comp", /* 8 */ "fbbd", /* 9 */ "yapp", /* 10 */ "docs", /* 11 */ "name", /* 12 */ "syso", /* 13 */ "sysm", /* 14 */ "impo", /* 15 */ "logs", /* 16 */ "test", /* 17 */ "fbbf", /* 18 */ "fbbc", /* 19 */ "aski", /* 20 */ "mask", /* 21 */ "secu", /* 22 */ "warn", /* 23 */ "hous", /* 24 */ "time", /* 25 */ "maxd", /* 26 */ "loca", /* 27 */ "beac", /* 28 */ "scro", /* 29 */ "fwdh", /* 30 */ "maxb", /* 31 */ "life", /* 32 */ "wpca", /* 33 */ "zipc", /* 34 */ "unpr", /* 35 */ "upba", /* 36 */ "dwba", /* 37 */ "pg", /* 38 */ "fdir", /* 39 */ "sdir", /* 40 */ "tdir", /* 41 */ "poph", /* 42 */ NULL }; char *value(char *line, int *key) { static char keystr[5]; char *ptr; int i; while (isspace(*line)) ++line; if (*line == '#' || *line == '\0') { *key = -3; return line; } i = 0; ptr = keystr; while (isgraph(*line)) { if (i++ < 4) { *ptr++ = *line; } ++line; if (*line == '=') break; } *ptr = '\0'; *key = -1; for (i = 0 ; inistr[i] ; i++) { if (strcasecmp(keystr, inistr[i]) == 0) { *key = i; break; } } line = strchr(line, '='); if (line) { ++line; while (isspace(*line)) ++line; } else { *key = -2; } return line; } int init_admin (void) { static int first = 1; int ntemp; char ligne[256]; char stemp[256]; char *ptr = ligne; char *start; char *scan; Msysop *sptr = NULL; int i, j; int key; int val; int ok_init = 0; int fond_haut = 0, fond_milieu = 0, fond_bas = 0, fond_menu = 0; balbul = 0; nb_ovr = 0; /* Default values */ BLK_TO = 0; h_ok = 1; internal_int = 0xff; ems_aut = 1; in_exms = 0; for (j = 0; j < NB_EMS; j++) in_exms |= t_ems[j].flag; FOND_VOIE = 0; DEF = (fond_haut << 4) + 15; STA = (fond_milieu << 4) + 15; INIT = (fond_menu << 4) + 15; SEND = (fond_bas << 4) + 15; RECV = (fond_bas << 4) + 15; HEADER = (fond_bas << 4) + 15; UI = (fond_bas << 4) + 15; CONS = (fond_bas << 4) + 15; INDIC = (fond_bas << 4) + 15; VOIE = (fond_bas << 4) + 15; *mypath = '\0'; myssid = 0; *qra_locator = '\0'; *my_city = '\0'; /* Ne pas reinitialiser */ if (first) { int i; for (i = 0; i < 10; i++) varx[i] = m_alloue (81); for (i = 1; i < NBPORT; i++) t_balise[i] = 900; } if (read_fbb_conf(NULL) > 0) { no_init_error = 0; ShowError ("fbb.conf", "Cannot open file", 0); window_init (); fbb_quit (0); return (0); } #ifdef __linux__ #ifdef ENGLISH cprintf ("Parameters set-up \n"); #else cprintf ("Initialisation des parametres\n"); #endif #else #ifdef ENGLISH cprintf ("Parameters set-up \r\n"); #else cprintf ("Initialisation des parametres\r\n"); #endif #endif libere_serveurs (); for (key = 0 ; inistr[key] ; key++) { ptr = find_fbb_conf(inistr[key], 0); if (ptr == NULL) { ptr = def_fbb_conf(inistr[key]); if (ptr == NULL) continue; } fprintf(stderr, "%4s : %s\n", inistr[key], ptr); switch (key) { case 0: /* Accept all versions !! sprintf (stemp, "FBB%s", VERSION); if (strncasecmp (stemp, ptr, strlen (stemp)) != 0) { #ifdef ENGLISH cprintf ("*** Error : Waiting for fbb.conf version %s \r\n", stemp); #else cprintf ("*** Erreur : Version de fbb.conf attendue %s\r\n", stemp); #endif err_init (0); } */ ok_init |= (1 << key); break; case 1: strn_cpy (39, mypath, ptr); if ((j = strlen (mypath)) && (mypath[j - 1] == '.')) mypath[j - 1] = '\0'; ok_init |= (1 << key); break; case 2: myssid = (char) atoi (ptr); ok_init |= (1 << key); break; case 3: strn_cpy (10, qra_locator, ptr); ok_init |= (1 << key); break; case 4: n_cpy (19, my_city, ptr); ok_init |= (1 << key); break; case 5: n_cpy (80, CONFDIR, test_back_slash (ptr, 0)); break; case 6: n_cpy (80, DATADIR, test_back_slash (ptr, 0)); break; case 7: n_cpy (80, MESSDIR, test_back_slash (ptr, 0)); break; case 8: n_cpy (80, MBINDIR, test_back_slash (ptr, 0)); break; case 9: for (j = 0; j < 8; j++) { *PATH[j] = '\0'; } printf("fbbd : <%s>\n", ptr); scan = strtok (ptr, " ,\t"); for (j = 0; j < 8; j++) { printf("%d : {%s}\n", j, scan); if (scan == NULL) break; if (*scan != '*') { n_cpy (80, PATH[j] + 2, slash2back (test_back_slash (scan, 0))); PATH[j][0] = getdisk () + 'A'; PATH[j][1] = ':'; } scan = strtok (NULL, " ,\t"); printf("%d : {%s}\n", j, PATH[j]); } break; case 10: n_cpy (80, YAPPDIR+2, slash2back (test_back_slash (ptr, 0))); YAPPDIR[0] = getdisk () + 'A'; YAPPDIR[1] = ':'; break; case 11: n_cpy (80, DOCSDIR, test_back_slash (ptr, 0)); ptr = DOCSDIR + strlen (DOCSDIR) - 1; if (*ptr == '\\') *ptr = '\0'; break; case 12: n_cpy (12, my_name, ptr); ok_init |= (1 << key); break; case 13: strn_cpy (6, admin, ptr); ok_init |= (1 << key); break; case 14: scan = strtok (ptr, " ,\t"); /* Delete la liste existante eventuellement */ while (mess_sysop) { sptr = mess_sysop; mess_sysop = mess_sysop->next; m_libere (sptr, sizeof (Msysop)); } if ((scan) && (isalpha (*scan))) { sptr = mess_sysop = (Msysop *) m_alloue (sizeof (Msysop)); strn_cpy (20, sptr->call, scan); } while ((scan = strtok (NULL, " ,\t")) != NULL) { sptr->next = (Msysop *) m_alloue (sizeof (Msysop)); sptr = sptr->next; strn_cpy (20, sptr->call, scan); } break; case 15: n_cpy (80, MAILIN, ptr); n_cpy (76, LOCK_IN, ptr); start = strrchr (LOCK_IN, '/'); if (start == NULL) start = LOCK_IN; scan = strrchr (start, '.'); if (scan) *scan = '\0'; strcat(LOCK_IN, ".lck"); break; case 16: comlog = (toupper (*ptr) == 'O'); break; case 17: DEBUG = (toupper (*ptr) == 'O'); miniserv = 0xffff; watchport = 0; sscanf (ptr, "%*s %d", &watchport); break; case 18: fbb_fwd = (toupper (*ptr) == 'O'); /* 1 : Espace obligatoire avant le @ dans l'adresse 2 : Ne teste pas la limite a 6 des champs de l'adresse 4 : Ne tronque pas le header a l'espace < 79 caracteres 8 : Header MBL/RLI 16 : Si pas de champ BBS envoie l'indicatif de ma BBS (->PMS) 32 : Supprime les messages data au SYSOP 64 : N'utilise pas le BID cree a partir des headers si pas de BID 128: N'accepte le forward que des BBS declarees. 256: Les messages WP ne sont pas HOLD 512: XWFD has priority on FBB 1024: Alternate BID generation 2048: XFWD with checksum 4096: Simple check for callsigns (3 to 6 chars, 1 digit, 1 alpha). */ std_header = 0; sscanf (ptr, "%*s %d", &std_header); break; case 19: /* 1 : Protocole de niveau 1 */ bin_fwd = (toupper (*ptr) == 'O'); /* 1 : Binaire FBB version 1 2 : Binaire RLI */ ntemp = -1; sscanf (ptr, "%*s %d", &ntemp); if ((bin_fwd) & (ntemp != -1) && (ntemp & 1)) { bin_fwd = 2; } prot_fwd = FWD_MBL; if (fbb_fwd) { prot_fwd |= FWD_FBB; if (bin_fwd) { prot_fwd |= FWD_BIN; if (bin_fwd == 2) prot_fwd |= FWD_BIN1; } } if ((ntemp == -1) || (ntemp & 2)) prot_fwd |= FWD_XPRO; break; case 20: info_ok = (toupper (*ptr) == 'O'); break; case 21: def_mask = (unsigned) atoi (ptr); break; case 22: if (sscanf (ptr, "%u %u %u", &d_droits, &ds_droits, &dss_droits) != 3) err_init (0); break; case 23: w_mask = (unsigned) atoi (ptr); break; case 24: h_maint = atoi (ptr); break; case 25: if (sscanf (ptr, "%d %d", &time_n, &time_b) != 2) err_init (0); time_n *= 60; time_b *= 60; break; case 26: if (sscanf (ptr, "%d %d", &max_yapp, &max_mod) != 2) err_init (0); break; case 27: /* tzone = 3600 * -atol(ptr) ; */ if (getenv ("TZ") == NULL) { /* memset(_tzname[1], 0, 4); strcpy(_tzname[0],"GMT"); _timezone = 3600L * -atol(ptr) ; _daylight = 0; stime */ /* Ne pas liberer... Sinon ca plante a l'appel suivant. */ char *tzl = malloc (20); sprintf (tzl, "TZ=GMT%d", -atoi (ptr)); j = putenv (tzl); } tzset (); break; case 28: if (toupper (*ptr) == 'B') { balbul = 1; do { ++ptr; } while (!ISGRAPH (*ptr)); } max_indic = atoi (ptr); break; case 29: winbuf.totlig = conbuf.totlig = monbuf.totlig = 1500; sscanf (ptr, "%d %d %d", &winbuf.totlig, &conbuf.totlig, &monbuf.totlig); break; case 30: txtfwd[0] = '\0'; n_cpy (51, txtfwd + 1, ptr); if (txtfwd[1]) txtfwd[0] = ' '; break; case 31: maxbbid = atoi (ptr); if (maxbbid < 0) maxbbid = 2000; break; case 32: multi_prive = 0; sscanf (ptr, "%ld %d", &nb_jour_val, &multi_prive); if (nb_jour_val < 1L) nb_jour_val = 1L; break; case 33: strn_cpy (256, wp_line, ptr); break; case 34: n_cpy (8, my_zip, ptr); break; case 35: nb_unproto = 300L; val = 6; mute_unproto = ack_unproto = via_unproto = priv_unproto = 0; sscanf (ptr, "%ld %d %s", &nb_unproto, &val, stemp); scan = strupr (stemp); while (*scan) { switch (*scan) { case 'V': via_unproto = 1; break; case 'P': priv_unproto = 1; break; case 'A': ack_unproto = 1; break; case 'M': mute_unproto = 1; break; } ++scan; } def_time_bcl = (val * 18); break; case 36: n_cpy (79, BBS_UP, ptr); break; case 37: n_cpy (79, BBS_DW, ptr); break; case 38: n_cpy (80, PGDIR, test_back_slash (ptr, 0)); break; case 39: n_cpy (80, FILTDIR, test_back_slash (ptr, 0)); break; case 40: n_cpy (80, SERVDIR, test_back_slash (ptr, 0)); break; case 41: n_cpy (80, TOOLDIR, test_back_slash (ptr, 0)); break; case 42: n_cpy (40, pop_host, ptr); break; } } /* Read services list */ ptr = find_fbb_conf("serv", 0); while (ptr) { init_serveur (ptr, 0); ptr = find_fbb_conf("serv", 1); } free_fbb_conf(); init_serveur ("WP * Request White pages info", 0); init_serveur ("REQCFG * Request configuration ", 0); init_serveur ("REDIST * Bulletin redistribution ", 0); i = 0; ptr = mypath; while (isalnum (*ptr)) { mycall[i] = *ptr++; if (++i == 6) break; } mycall[i] = '\0'; ind_console (1, mycall); strcpy (my_call, cons_call.call); if (first) window_init (); set_win_colors (); first = 0; if (ok_init != FIELDS) { int mask = 1; for (i = 0 ; i < 32 ; i++) { if (((mask << i) & FIELDS) && (((mask << i) & ok_init) == 0)) { #ifdef ENGLISH cprintf ("*** Error : Mandatory field \"%s\" missing in fbb.conf \r\n", inistr[i]); #else cprintf ("*** Erreur : Le champ \"%s\" n'est pas defini dans fbb.conf\r\n", inistr[i]); #endif } } err_init (0); no_init_error = 0; } return (no_init_error); } static void cree_etat (void) { FILE *fichier; if ((fichier = fopen (d_disque ("ETAT.SYS"), "wt")) == NULL) { fbb_error (ERR_CREATE, d_disque ("ETAT.SYS"), 0); } fprintf (fichier, "%-6s-%d\n", mycall, myssid); ind_console (1, mycall); fprintf (fichier, "Mise en service par %s-%d le %s\n", cons_call.call, cons_call.num, strdate (time (NULL))); fclose (fichier); } void init_etat (void) { FILE *fichier; char s[81]; if ((fichier = fopen (d_disque ("ETAT.SYS"), "r+t")) == NULL) { if (err_ouvert ("ETAT.SYS")) { cree_etat (); arret = FALSE; } else fbb_error (ERR_OPEN, d_disque ("ETAT.SYS"), 0); } else { fgets (s, 80, fichier); ind_console (1, sup_ln (s)); if (fgetc (fichier) == 'A') arret = TRUE; else arret = FALSE; fclose (fichier); } } fbb-7.0.10/src/waveplay.c0000644000175000017500000001710013613360505012035 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* vplay.c - plays and records CREATIVE LABS VOICE-files, Microsoft WAVE-files and raw data Autor: Michael Beck - beck@informatik.hu-berlin.de */ #include #include #include #include #include #ifndef __STDC__ #include #endif /* __STDC__ */ #include #include #ifdef __STDC__ #include #else /* __STDC__ */ #include #endif /* __STDC__ */ #include "fmtheaders.h" /* trying to define independent ioctl for sounddrivers version 1 and 2+ , but it dosn't work everywere */ #ifdef SOUND_VERSION #define IOCTL(a,b,c) ioctl(a,b,&c) #else #define IOCTL(a,b,c) (c = ioctl(a,b,c) ) #endif #define DEFAULT_DSP_SPEED 8000 #define AUDIO "/dev/dsp" #define min(a,b) ((a) <= (b) ? (a) : (b)) #define VOC_FMT 0 #define WAVE_FMT 1 #define RAW_DATA 2 /* global data */ static int dsp_speed = DEFAULT_DSP_SPEED, dsp_stereo = 0; static int samplesize = 8; static int quiet_mode = 0; static u_long count; static int audio, abuf_size, zbuf_size; static u_char *audiobuf, *zerobuf; /* needed prototypes */ static int r_play (char *name); /* test, if it's a .WAV file, 0 if ok (and set the speed, stereo etc.) < 0 if not */ int test_wavefile(void *buffer) { WaveHeader *wp = buffer; if (wp->main_chunk == RIFF && wp->chunk_type == WAVE && wp->sub_chunk == FMT && wp->data_chunk == DATA) { if (wp->format != PCM_CODE) { fprintf (stderr, "can't play not PCM-coded WAVE-files\n"); return (-1); } if (wp->modus > 2) { fprintf (stderr, "can't play WAVE-files with %d tracks\n", wp->modus); return (-1); } dsp_stereo = (wp->modus == WAVE_STEREO) ? 1 : 0; samplesize = wp->bit_p_spl; dsp_speed = wp->sample_fq; count = wp->data_length; return 0; } return -1; } /* if need a SYNC, (is needed if we plan to change speed, stereo ... during output) */ #ifdef __STDC__ int sync_dsp(void) #else /* __STDC__ */ inline int sync_dsp(void) #endif /* __STDC__ */ { if (ioctl (audio, SNDCTL_DSP_SYNC, NULL) < 0) { perror(AUDIO); return (0); } return(1); } /* setting the speed for output */ int set_dsp_speed (int dsp_speed) { if (IOCTL(audio, SNDCTL_DSP_SPEED, dsp_speed) < 0) { fprintf (stderr, "unable to set audio speed\n"); perror (AUDIO); return(0); } return(1); } /* if to_mono: compress 8 bit stereo data 2:1, needed if we want play 'one track'; this is usefull, if you habe SB 1.0 - 2.0 (I have 1.0) and want hear the sample (in Mono) if to_8: compress 16 bit to 8 by using hi-byte; wave-files use signed words, so we need to convert it in "unsigned" sample (0x80 is now zero) WARNING: this procedure can't compress 16 bit stereo to 16 bit mono, because if you have a 16 (or 12) bit card you should have stereo (or I'm wrong ?? ) */ #ifdef __STDC__ u_long one_channel(u_char *buf, u_long l, char to_mono, char to_8) #else /* __STDC__ */ inline u_long one_channel(char *buf, u_long l, char to_mono, char to_8) #endif /* __STDC__ */ { u_char *w = buf; u_char *w2 = buf; char ofs = 0; u_long incr = 0; u_long c, ret; if (to_mono) ++incr; if (to_8) { ++incr; ++w2; ofs = 128; } ret = c = l >> incr; incr = incr << 1; while (c--) { *w++ = *w2 + ofs; w2 += incr; } return ret; } int play (char *name) { int retour; audio = open (AUDIO, O_WRONLY, 0); if (audio == -1) { perror (AUDIO); return (0); } IOCTL(audio, SNDCTL_DSP_GETBLKSIZE, abuf_size); if (abuf_size < 4096 || abuf_size > 65536) { if (abuf_size == -1) perror (AUDIO); else fprintf (stderr, "Invalid audio buffers size %d\n", abuf_size); return(0); } zbuf_size = 256; if ( (audiobuf = (u_char *)malloc (abuf_size)) == NULL || (zerobuf = (u_char *)malloc (zbuf_size)) == NULL ) { fprintf (stderr, "unable to allocate input/output buffer\n"); return(0); } memset ((char *)zerobuf, 128, zbuf_size); retour = r_play (name); close (audio); return retour; } /* playing/recording raw data, this proc handels WAVE files and recording .VOCs (as one block) */ int recplay (int fd, int loaded, u_long count, int rtype, char *name) { int l, real_l; u_long c; char one_chn = 0; char to_8 = 0; int tmps; if (!sync_dsp()) return(0); if (!quiet_mode) { if (samplesize != 8) fprintf(stderr, "%d bit, ", samplesize); fprintf (stderr, "Speed %d Hz ", dsp_speed); fprintf (stderr, "%s ...\n", dsp_stereo ? "Stereo" : "Mono"); } tmps = samplesize; IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, tmps); if (tmps != samplesize) { fprintf (stderr, "unable to set %d bit sample size", samplesize); if (samplesize == 16) { samplesize = 8; IOCTL(audio, SNDCTL_DSP_SAMPLESIZE, samplesize); if (samplesize != 8) { fprintf(stderr, "unable to set 8 bit sample size!\n"); return(0); } fprintf (stderr, "; playing 8 bit\n"); to_8 = 1; } else { fprintf (stderr, "\n"); return(0); } } #ifdef SOUND_VERSION if (ioctl (audio, SNDCTL_DSP_STEREO, &dsp_stereo) < 0) { #else if (dsp_stereo != ioctl (audio, SNDCTL_DSP_STEREO, dsp_stereo) ) { #endif fprintf (stderr, "can't play in Stereo; playing only one channel\n"); dsp_stereo = MODE_MONO; one_chn = 1; } if (!set_dsp_speed (dsp_speed)) return(0); while (count) { c = count; if (c > abuf_size) c = abuf_size; if ((l = read (fd, (char *)audiobuf + loaded, c - loaded)) > 0) { l += loaded; loaded = 0; /* correct the count; ugly but ... */ real_l = (one_chn || to_8) ? one_channel(audiobuf, l, one_chn, to_8) : l; if (write (audio, (char *)audiobuf, real_l) != real_l) { perror (AUDIO); return(0); } count -= l; } else { if (l == -1) { perror (name); return(0); } count = 0; /* Stop */ } } /* while (count) */ return(1); } /* let's play or record it (record_type says VOC/WAVE/raw) */ int r_play(char *name) { int fd; int retour = 0; fprintf(stderr, "Playing %s : ", name); if ((fd = open (name, O_RDONLY, 0)) == -1) { perror (name); return(0); } /* read bytes for WAVE-header */ read (fd, (char *)audiobuf, sizeof(WaveHeader)); if (test_wavefile (audiobuf) >= 0) { retour = recplay (fd, 0, count, WAVE_FMT, name); } if (fd != 0) close(fd); return(retour); } fbb-7.0.10/src/mbl_log.c0000644000175000017500000000256013613360505011624 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MBL_LOG.C * */ #include void ouvre_log (void) { long temps; struct tm *sdate; char fichier[80]; temps = time (NULL); sdate = localtime (&temps); if (num_semaine == 53) num_semaine = 1; sprintf (fichier, "LOG\\FBBLOG%02d.%02d", sdate->tm_year %100, num_semaine); log_ptr = fappend (d_disque (fichier), "b"); } void ferme_log (void) { if (log_ptr) { fclose (log_ptr); log_ptr = NULL; } } fbb-7.0.10/src/fwdovl7.c0000644000175000017500000004016013613360505011577 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FORWARDING OVERLAY 7 */ #include static int all_digit (char *); static void maint_bid (char *); void delete_bid (char *bid) { FILE *fptr; bidfwd fwbid; int pos; int i; char *ptr; pos = search_bid (bid); if (bid_ptr) { ptr = bid_ptr + ((pos - 1) * BIDCOMP); for (i = 0; i < BIDCOMP; i++, *ptr++ = '\0'); } else if (EMS_BID_OK ()) { delete_exms_bid (pos); } if ((fptr = fopen (d_disque ("WFBID.SYS"), "r+b")) != NULL) { ptmes->type = '\0'; ptmes->numero = 0L; *ptmes->bid = '\0'; fseek (fptr, (long) pos * sizeof (bidfwd), 0); fwrite (&fwbid, sizeof (fwbid), 1, fptr); fclose (fptr); } } int dec_fwd (char *bbs) { Forward *pfwd; int port, noport; int voie; int nobbs; strupr (sup_ln (bbs)); if ((isdigit (*bbs)) && (!ISGRAPH (*(bbs + 1)))) { noport = *bbs - '0'; if (noport == 9) { /* Stoppe le forward sur tous les ports */ *bbs = '\0'; for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { if (pfwd->forward) { if (pfwd->forward > 0) { deconnexion (pfwd->forward, 1); deconnexion (pfwd->forward, 1); deconnexion (pfwd->forward, 1); svoie[pfwd->forward]->curfwd = NULL; } *pfwd->fwdbbs = '\0'; pfwd->forward = 0; pfwd->fwdpos = 0; pfwd->fin_fwd = pfwd->cptif = pfwd->fwdlig = 0; pfwd->reverse = 0; } pfwd = pfwd->suite; } } } } else if (noport >= 0) { /* Selectionne un port */ *bbs = '\0'; if (p_port[noport].pvalid) { pfwd = p_port[noport].listfwd; while (pfwd) { if (pfwd->forward) { if (pfwd->forward > 0) { deconnexion (pfwd->forward, 1); deconnexion (pfwd->forward, 1); deconnexion (pfwd->forward, 1); svoie[pfwd->forward]->curfwd = NULL; } *pfwd->fwdbbs = '\0'; pfwd->forward = 0; pfwd->fwdpos = 0; pfwd->fin_fwd = pfwd->cptif = pfwd->fwdlig = 0; pfwd->reverse = 0; } pfwd = pfwd->suite; } } } } else { nobbs = num_bbs (bbs); if (nobbs) { /* Selectionne une BBS */ noport = -1; for (port = 1; port < NBPORT; port++) { if (p_port[port].pvalid) { pfwd = p_port[port].listfwd; while (pfwd) { if (pfwd->no_bbs == nobbs) { if (pfwd->forward > 0) { voie = pfwd->forward; if (svoie[voie]->sta.connect) { deconnexion (voie, 1); deconnexion (voie, 1); deconnexion (voie, 1); } else { /* Incident, la voie n'est pas connect‚e */ pfwd->forward = -1; pfwd->no_bbs = 0; } } noport = port; break; } pfwd = pfwd->suite; } } } } else noport = -2; } aff_forward (); return (noport); } static int all_digit (char *ptr) { while (*ptr) { if (!isdigit (*ptr)) return (0); ++ptr; } return (1); } static void maint_bid (char *ptr) { FILE *fptr; bidfwd fwbid; char choix = '?'; char bid[25]; char s[80]; int err = 0; int pos; ptr[20] = '\0'; if (sscanf (ptr, "%s %c", bid, &choix) == 0) err = 1; strupr (bid); if (!err) { pos = search_bid (bid); switch (choix) { case '?': if (pos) { if ((fptr = fopen (d_disque ("WFBID.SYS"), "r+b")) != NULL) { fseek (fptr, (long) pos * sizeof (bidfwd), 0); fread (&fwbid, sizeof (fwbid), 1, fptr); sprintf (s, "$:%s #:%ld T:%c", fwbid.fbid, fwbid.numero, fwbid.mode); outsln (s, strlen (s)); fclose (fptr); } else texte (T_ERR + 19); } else texte (T_ERR + 19); break; case '+': if (!pos) { ptmes->type = 'M'; ptmes->numero = 0L; strn_cpy (12, ptmes->bid, bid); w_bid (); } break; case '-': if (pos) { delete_bid (bid); } else texte (T_ERR + 19); break; default: err = 1; break; } } if (err) texte (T_ERR + 0); } void fwd_value (char *maxfwd, char *typfwd, char *typdat) { int cptif; int nobbs = 0; int temp; int i; char combuf[80]; char *pcom; long h_time = time (NULL); for (i = 0; i <= NBBBS; i++) { maxfwd[i] = 0xff; typfwd[i] = 0; typdat[i] = 1; } cptif = 0; rewind_fwd (); while (fwd_get (combuf)) { pcom = combuf; switch (*pcom++) { case 'A': /* BBS destinataire */ nobbs = num_bbs (pcom); break; case 'E': /* ENDIF */ --cptif; break; case 'I': /* IF */ ++cptif; if (tst_fwd (pcom, nobbs, h_time, 0, NULL, 1, -1) == FALSE) { temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) break; pcom = combuf; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; case '@': if (cptif == (temp + 1)) ++temp; break; default: break; } } } break; case 'J': /* Selection des messages "data" */ typdat[nobbs] = atoi (pcom); break; case 'T': /* limite la taille du fichier forwarde */ while (*pcom) { if (toupper (*pcom) == 'M') { ++pcom; maxfwd[nobbs] = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else if (toupper (*pcom) == 'O') { ++pcom; while (isdigit (*pcom)) ++pcom; } else if (toupper (*pcom) == 'P') { typfwd[nobbs] |= FWD_PRIV; ++pcom; } else if (toupper (*pcom) == 'S') { typfwd[nobbs] |= FWD_SMALL; ++pcom; } else if (toupper (*pcom) == 'D') { typfwd[nobbs] |= FWD_DUPES; ++pcom; } else if (isdigit (*pcom)) { maxfwd[nobbs] = (uchar) atoi (pcom); while (isdigit (*pcom)) ++pcom; } else ++pcom; } break; case '@': /* ELSE */ temp = cptif - 1; while (cptif != temp) { if (fwd_get (combuf) == 0) break; pcom = combuf; switch (*pcom++) { case 'I': ++cptif; break; case 'E': --cptif; break; default: break; } } break; case '*': case '#': /* ligne commentaire */ break; case '-': /* fin de bloc */ break; } } } static void no_route (int c_r) { #ifdef ENGLISH out ("No route ", 12); #else out ("Pas de route", 12); #endif if (c_r) cr (); } int maint_fwd (void) { int c, voie, nobbs, trouve = 0, err = 0; int noport, port_fwd, reverse = 0; int nb; long nmess; char bbs[80], s[80]; char filename[MAXPATH]; atfwd *nbmess; char *ptr; char maxfwd[NBBBS + 1]; char typfwd[NBBBS + 1]; char typdat[NBBBS + 1]; strupr (indd); c = *indd++; if (!teste_espace ()) err = 2; ptr = indd; switch (c) { case 'A': /* Mark a message to be forwarded to a BBS */ if (err) break; if ((nmess = lit_chiffre (1)) != 0L) { if (sscanf (indd, "%s", bbs) != 1) texte (T_ERR + 0); else if (!ch_record (ptmes, nmess, '\0')) { ptmes->numero = nmess; texte (T_ERR + 10); } else if ((nobbs = num_bbs (bbs)) == 0) texte (T_ERR + 0); else { indd = ptr; set_bit_fwd (ptmes->fbbs, nobbs); clr_bit_fwd (ptmes->forw, nobbs); if (*(ptmes->bbsv) == '\0') strn_cpy (40, ptmes->bbsv, bbs); if (ptmes->status == 'F') { if (ptmes->type == 'B') ptmes->status = '$'; else { ptmes->status = 'Y'; } } maj_rec (nmess, ptmes); clear_fwd (nmess); ins_fwd (ptmes); mbl_disbul (); } } break; case 'B': /* Print the forward list of messages forwarded to a BBS */ if (*indd) { char maxfwd[NBBBS + 1]; char typfwd[NBBBS + 1]; char typdat[NBBBS + 1]; fwd_value (maxfwd, typfwd, typdat); if ((nobbs = num_bbs (sup_ln (indd))) == 0) { texte (T_ERR + 0); break; } pvoie->typlist = 1; print_fwd (nobbs, maxfwd[nobbs], 0, typfwd[nobbs], typdat[nobbs]); err = 3; } else { texte (T_ERR + 7); } break; case 'C': /* Forward check : Gives the route */ if (*indd) { if (err) break; ini_champs (voiecur); sup_ln (indd); strn_cpy (40, s, indd); ptr = bbs_via(indd); if (find (ptr)) { ptmes->type = 'P'; ptmes->status = 'N'; strn_cpy (40, ptmes->bbsv, s); } else if (all_digit (ptr)) { ptmes->type = 'T'; ptmes->status = 'N'; strn_cpy (6, ptmes->desti, indd); } else { ptmes->type = 'B'; ptmes->status = '$'; strn_cpy (40, ptmes->bbsv, s); } if (!test_forward (0)) no_route (0); cr (); } else { err = 0; nobbs = 0; } break; /* case 'K' : break ; */ case 'D': /* Un-mark a message to be forwarded to a BBS */ if (err) break; if ((nmess = lit_chiffre (1)) != 0L) { if (sscanf (indd, "%s", bbs) != 1) texte (T_ERR + 0); else if (!ch_record (ptmes, nmess, '\0')) { ptmes->numero = nmess; texte (T_ERR + 10); } else if ((nobbs = num_bbs (bbs)) == 0) texte (T_ERR + 0); else { indd = ptr; clr_bit_fwd (ptmes->fbbs, nobbs); set_bit_fwd (ptmes->forw, nobbs); if (*(ptmes->bbsv) == '\0') strn_cpy (40, ptmes->bbsv, bbs); maj_rec (nmess, ptmes); clear_fwd (nmess); ins_fwd (ptmes); mbl_disbul (); } } break; case 'G': /* Print the maessages partly sent */ err = 0; print_part (); break; case 'H': /* Prints the H-Route of a BBS */ if (*indd) { if (err) break; strn_cpy (40, ptmes->bbsv, indd); if (cherche_route (ptmes)) { texte (T_MBL + 41); } else no_route (1); } break; case 'I': /* BID maintenance */ if (*indd) { if (err) break; maint_bid (indd); } break; case 'L': /* Lists the pending forward */ if (*indd) { if (err) break; if ((nobbs = num_bbs (sup_ln (indd))) == 0) { texte (T_ERR + 0); break; } } else { err = 0; nobbs = 0; } if (!affiche_forward (nobbs)) texte (T_MBL + 3); break; case 'M': /* Import BBS forwarding from file*/ /* Read the callsign and the filename */ nb = sscanf (indd, "%s %s", bbs, filename); if (nb <= 0) texte (T_ERR + 7); else if (nb == 1) texte (T_ERR + 20); else if (nb == 2) { int fd; int sav_voie; if ((fd = open(filename, S_IREAD)) != -1) close(fd); else { strcpy(pvoie->appendf, filename); texte (T_ERR + 11); break; } /* Import channel free ? */ if ((!is_room ()) || (svoie[INEXPORT]->sta.connect) || (inexport)) { break; } sav_voie = voiecur; extind(bbs, svoie[INEXPORT]->sta.indicatif.call) ; svoie[INEXPORT]->sta.indicatif.num = 0 ; strcpy(io_fich, filename); mail_ch = INEXPORT; selvoie(mail_ch) ; pvoie->sta.connect = inexport = 4 ; pvoie->enrcur = 0L ; pvoie->debut = time(NULL); pvoie->mode = F_FOR | F_HIE | F_BID | F_MID ; pvoie->finf.lang = langue[0]->numlang ; aff_event(voiecur, 1); maj_niv(N_MBL, 99, 0) ; mbl_emul(); selvoie(sav_voie) ; outln("OK", 2); } else texte (T_ERR + 0); break; case 'N': /* Gives the forwarding status of a message */ if (err) break; mbl_disbul (); break; case 'P': /* Gives the swap information */ if (err) break; indd[50] = '\0'; ini_champs (voiecur); #define DIEZE "#" strcpy (ptmes->exped, DIEZE); strcpy (ptmes->bbsv, DIEZE); strcpy (ptmes->desti, DIEZE); nb = sscanf (indd, "%c %s", (char *)&c, s); if (nb == 2) { switch (c) { case '<': strn_cpy (6, ptmes->exped, s); swapp_bbs (ptmes); if (strcmp (ptmes->exped, s) == 0) strcpy (ptmes->exped, DIEZE); break; case '>': strn_cpy (6, ptmes->desti, s); swapp_bbs (ptmes); if (strcmp (ptmes->desti, s) == 0) strcpy (ptmes->desti, DIEZE); break; case '@': strn_cpy (6, ptmes->bbsv, s); swapp_bbs (ptmes); if (strcmp (ptmes->bbsv, s) == 0) strcpy (ptmes->bbsv, DIEZE); break; default: c = 0; break; } if (c > 0) { swapp_bbs (ptmes); if (*ptmes->exped != '#') { sprintf (s, "< %s ", ptmes->exped); out (s, strlen (s)); trouve = 1; } if (*ptmes->bbsv != '#') { sprintf (s, "@ %s ", ptmes->bbsv); out (s, strlen (s)); trouve = 1; } if (*ptmes->desti != '#') { sprintf (s, "> %s ", ptmes->desti); out (s, strlen (s)); trouve = 1; } if (trouve) cr (); } else texte (T_ERR + 0); } else texte (T_ERR + 0); break; case 'S': /* Forward stop */ if (err) break; if (*indd) { int save_voie = voiecur; switch (noport = dec_fwd (indd)) { case -1: sprintf (s, "BBS %s is not forwarding", indd); break; case -2: sprintf (s, "Unknown BBS %s", indd); break; default: if (*indd) sprintf (bbs, "with %s ", indd); else *bbs = '\0'; sprintf (s, "Stopping forwarding %son port %d", bbs, noport); break; } selvoie (save_voie); outln (s, strlen (s)); } else { texte (T_ERR + 7); } break; case 'T': /* Pending forward */ fwd_value (maxfwd, typfwd, typdat); if (*indd) { if ((nobbs = num_bbs (sup_ln (indd))) == 0) { texte (T_ERR + 0); break; } if ((nbmess = attend_fwd (nobbs, maxfwd[nobbs], 0, typfwd[nobbs], typdat[nobbs])) != 0L) { sprintf (s, "%s: %dP /%dB - %d KB", indd, nbmess->nbpriv, nbmess->nbbul, nbmess->nbkb); outln (s, strlen (s)); trouve = 1; } } else { ptr = bbs_ptr; for (nobbs = 1; nobbs <= NBBBS; ++nobbs, ptr += 7) { if ((nbmess = attend_fwd (nobbs, maxfwd[nobbs], 0, typfwd[nobbs], typdat[nobbs])) != 0L) { n_cpy (6, bbs, ptr); sprintf (s, "%-6s : %2dP /%3dB - %d KB", bbs, nbmess->nbpriv, nbmess->nbbul, nbmess->nbkb); outln (s, strlen (s)); trouve = 1; } } } if (!trouve) texte (T_MBL + 3); err = 0; break; case 'U': /* Disconnect a forwarding channel */ if (err) break; if (isdigit (*indd)) { voie = atoi (indd) + 1; if ((voie > 0) && (voie < NBVOIES) && (svoie[voie]->sta.connect)) { sprintf (s, "Disconnecting channel %d", virt_canal (voie)); force_deconnexion (voie, 1); } else { sprintf (s, "Channel %d is not connected", virt_canal (voie)); } outln (s, strlen (s)); } else texte (T_ERR + 3); break; case 'V': /* Start message scanning */ p_forward = 1; maj_options (); init_buf_fwd (); init_buf_swap (); init_buf_rej (); init_bbs (); aff_nbsta (); outln ("Message scanning ok", 19); err = 0; break; case 'R': /* Start reverse forwarding */ reverse = 1; case 'W': /* Start forwarding */ if (err) break; if (*indd) { switch (noport = val_fwd (indd, &port_fwd, reverse)) { case -1: sprintf (s, "No forwarding channel available on port %d", port_fwd); break; case -2: sprintf (s, "No port defined for %s", indd); break; case -3: sprintf (s, "Unknown BBS %s", indd); break; case -4: sprintf (s, "BBS %s already connected", indd); break; default: sprintf (s, "Forwarding %s on port %d", indd, noport); break; } outln (s, strlen (s)); } else { texte (T_ERR + 7); } break; default: err = 1; --indd; break; } if (err == 2) { texte (T_ERR + 2); err = 0; } if (err == 0) retour_mbl (); if (err == 3) err = 0; return (err); } fbb-7.0.10/src/gesfic.c0000644000175000017500000004170513613360505011455 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #define FBB_IO #include #if defined(__FBBDOS__) || defined(__WINDOWS__) #include #endif #define CTRL_Z '\032' static unsigned long *lmode = NULL; static int nb_lmode = 0; #define MODE_INC 32 #if !defined(__WIN32__) && (defined(__FBBDOS__) || defined(__WINDOWS__)) extern unsigned int _openfd[]; #endif int fbb_open (char *filename, int acces, unsigned mode); static int set_mode (int fd, unsigned long mode) { if (lmode == NULL) { nb_lmode = MODE_INC; lmode = malloc(sizeof(unsigned long) * nb_lmode); if (lmode == NULL) { nb_lmode = 0; return 0; } } while (fd >= nb_lmode) { nb_lmode += MODE_INC; lmode = realloc(lmode, sizeof(unsigned long) * nb_lmode); if (lmode == NULL) { nb_lmode = 0; return 0; } } lmode[fd] = mode; return 1; } static unsigned long get_mode (int fd) { return lmode[fd]; } char *lfile (char *filename) { static char lockname[256]; char *ptr; strcpy (lockname, filename); ptr = strrchr (lockname, '.'); if (ptr) *ptr = '\0'; strcat (lockname, ".lck"); return (lockname); } char *slash2back (char *str) { static char buf[256]; char *ptr = buf; int nb = 0; while (*str) { if (*str == '/') *ptr = '\\'; // else if (islower (*str)) // *ptr = toupper (*str); else *ptr = *str; ++ptr; ++str; if (++nb == 255) break; } *ptr = '\0'; return (buf); } char *back2slash (char *str) { static char buf[256]; char *ptr = buf; int nb = 0; if ((strlen (str) > 2) && (str[1] == ':')) str += 2; while (*str) { if (*str == '\\') *ptr = '/'; // else if (isupper (*str)) // *ptr = tolower (*str); else *ptr = *str; ++ptr; ++str; if (++nb == 255) break; } *ptr = '\0'; return (buf); } int fbb_access (char *filename, int mode) { #ifdef __linux__ return (access (back2slash (filename), mode)); #else return (access (filename, mode)); #endif } int fbb_stat (char *filename, struct stat *buf) { #ifdef __linux__ return (stat (back2slash (filename), buf)); #else return (stat (filename, buf)); #endif } #ifdef __linux__ int fbb_mkdir (char *filename, int mode) { return (mkdir (back2slash (filename), mode)); } #else int fbb_mkdir (char *filename) { return (mkdir (filename)); } #endif int fbb_rmdir (char *filename) { #ifdef __linux__ return (rmdir (back2slash (filename))); #else return (rmdir (filename)); #endif } #ifdef __linux__ int fbb_statfs (char *filename, struct statfs *buf) { return (statfs (back2slash (filename), buf)); } #endif void fbb_textattr (int att) { #ifdef __FBBDOS__ if (video_off == 2) att = 0; textattr (att); #endif } char *fbb_fgets (char *s, int n, FILE * fptr) { char *pres; #ifdef __linux__ pres = fgets (s, n, fptr); if (lmode[fileno (fptr)] & O_TEXT) { if (pres) { char *ptr = pres; char *out = pres; while (*ptr) { if (*ptr == '\r') { ++ptr; continue; } if (*ptr == CTRL_Z) break; *out++ = *ptr++; } *out = '\0'; } } #else deb_io (); pres = fgets (s, n, fptr); fin_io (); #endif return (pres); } int fbb_fputs (char *s, FILE * fptr) { int res; deb_io (); res = fputs (s, fptr); fin_io (); return (res); } int fbb_fgetc (FILE * fptr) { int res; deb_io (); res = fgetc (fptr); #ifdef __linux__ if (get_mode(fileno (fptr)) & O_TEXT) { if (res == CTRL_Z) res = EOF; else if (res == '\r') { res = fgetc (fptr); if (res == CTRL_Z) res = EOF; } } #endif fin_io (); return (res); } int fbb_fputc (int c, FILE * fptr) { int res; deb_io (); res = fputc (c, fptr); fin_io (); return (res); } FILE *fbb_fopen (char *filename, char *mode) { FILE *fptr; deb_io (); #ifdef __linux__ fptr = fopen (back2slash (filename), mode); #else fptr = fopen (filename, mode); #endif fin_io (); if (fptr) { char *ptr = mode; set_mode(fileno (fptr), 0); while (*ptr) { if (*ptr == 't') set_mode(fileno (fptr), O_TEXT); if (*ptr == 'a') fseek (fptr, 0L, SEEK_END); ++ptr; } } return (fptr); } FILE *fsopen (char *filename, char *mode) { #ifdef __linux__ FILE *fptr; fptr = fopen (back2slash (filename), mode); if (fptr) { char *ptr = mode; set_mode(fileno (fptr), 0); while (*ptr) { if (*ptr == 't') set_mode(fileno (fptr), O_TEXT); if (*ptr == 'a') fseek (fptr, 0L, SEEK_END); ++ptr; } } return (fptr); #endif #if defined(__FBBDOS__) || defined(__WINDOWS__) int fd; char s[80]; FILE *fptr; deb_io (); for (;;) { fd = sopen (filename, O_RDONLY | O_TEXT, SH_DENYWR, 0); if ((fd >= 0) || (errno != EACCES)) break; aff_etat ('Z'); fin_io (); #ifdef ENGLISH sprintf (s, "SHARING VIOLATION (%s)", filename); #else sprintf (s, "VIOLATION PARTAGE (%s)", filename); #endif win_message (2, s); deb_io (); } if (fd < 0) fptr = NULL; else fptr = fdopen (fd, mode); fin_io (); return (fptr); #endif } int fbb_fclose (FILE * fptr) { int res; int fd = fileno (fptr); deb_io (); res = fclose (fptr); set_mode(fd, 0); fin_io (); return (res); } int fbb_open (char *filename, int acces, unsigned mode) { int fd; deb_io (); #ifdef __linux__ fd = open (back2slash (filename), acces & (~O_TEXT), mode); #else fd = open (filename, acces, mode); #endif fin_io (); if (fd > 0) set_mode(fd, acces & O_TEXT); return (fd); } int fbb_close (int fd) { int res; deb_io (); res = close (fd); set_mode(fd, 0); fin_io (); return (res); } int fbb_read (int fd, void *buf, unsigned nb) { int retour; deb_io (); #ifdef __linux__ retour = read (fd, buf, nb); /* search for ^Z */ if ((retour > 0) && (get_mode(fd) & O_TEXT)) { int n; char *ptr = (char *) buf; for (n = 0; n < retour; n++) { if (ptr[n] == CTRL_Z) { retour = n; break; } } } #else retour = _read (fd, buf, nb); if ((retour > 0) && (get_mode(fd) & O_TEXT)) { int i, n; char *ptri = (char *) buf; char *ptro = (char *) buf; for (i = 0, n = 0; i < retour; i++) { if (ptri[i] == '\r') continue; else if (ptri[i] == CTRL_Z) break; else ptro[n++] = ptri[i]; } retour = n; } #endif fin_io (); return (retour); } int fbb_write (int fd, void *buf, unsigned nb) { int retour; deb_io (); #ifdef __linux__ if (get_mode(fd) & O_TEXT) { int i; int len; char *ptro, *ptri; /* Ignorer CR, Remplacer LF par CRLF */ ptri = (char *) buf; if (nb) { ptro = (char *) malloc (nb * 2); for (len = 0, i = 0; i < nb; i++) { if (ptri[i] == '\r') { continue; } else if (ptri[i] == '\n') { ptro[len++] = '\r'; ptro[len++] = '\n'; } else { ptro[len++] = ptri[i]; } } retour = write (fd, ptro, len); if (retour == len) retour = nb; free (ptro); } else { retour = write (fd, ptri, nb); } } else #endif retour = write (fd, buf, nb); fin_io (); return (retour); } int fbb_fread (void *ptr, size_t taille, size_t n, FILE * fp) { int retour; deb_io (); retour = fread (ptr, taille, n, fp); #ifdef __linux__ /* search for ^Z */ if ((retour > 0) && (get_mode(fileno (fp)) & O_TEXT)) { int i; char *p = (char *) ptr; for (i = 0; i < taille * n; i++) { if (p[i] == CTRL_Z) { p[i] = '\0'; break; } } } #endif fin_io (); return (retour); } int fbb_fwrite (void *ptr, size_t taille, size_t n, FILE * fp) { int retour; deb_io (); retour = fwrite (ptr, taille, n, fp); fin_io (); return (retour); } int fbb_findfirst (char *chemin, struct ffblk *ffblk, int attribut) { int retour; deb_io (); retour = findfirst (chemin, ffblk, attribut); fin_io (); return (retour); } int fbb_findnext (struct ffblk *ffblk) { int retour; deb_io (); retour = findnext (ffblk); fin_io (); return (retour); } int fbb_unlink (char *filename) { int retour; deb_io (); #ifdef __linux__ retour = unlink (back2slash (filename)); #else retour = unlink (filename); #endif fin_io (); return (retour); } long fbb_filelength (int fd) { long retour; deb_io (); retour = filelength (fd); fin_io (); return (retour); } FILE *ouvre_stats (void) { FILE *fptr; while (TRUE) { if ((fptr = fbb_fopen (d_disque ("statis.dat"), "r+b")) == NULL) { if (err_ouvert (d_disque ("statis.dat"))) cree_stat (); else fbb_error (ERR_CREATE, d_disque ("statis.dat"), 0); } else break; } return (fptr); } FILE *ouvre_sat (void) { FILE *fptr; while (TRUE) { if ((fptr = fbb_fopen (d_disque ("sat\\satel.dat"), "r+b")) == NULL) { if (err_ouvert (d_disque ("sat\\satel.dat"))) cree_sat (); else fbb_error (ERR_CREATE, d_disque ("sat\\satel.dat"), 0); } else break; } return (fptr); } int compress_mess (bullist * pbul) { FILE *fptr; unsigned short crc = 0; char temp[128]; unsigned int textsize = 0; strcpy (pvoie->sr_fic, mess_name (MBINDIR, pbul->numero, temp)); if ((fptr = fbb_fopen (pvoie->sr_fic, "rb")) != NULL) { if (fread (&crc, sizeof (crc), 1, fptr) == 0) textsize = 0; if (fread (&textsize, sizeof (textsize), 1, fptr) == 0) textsize = 0; fclose (fptr); if (moto) { crc = xendien (crc); textsize = xendienl (textsize); } if (textsize > 1000000) { cprintf ("%s :\r\nCRC = %04x Size = %u ... ", pvoie->sr_fic, crc, textsize); cprintf ("Error bin file. Recompressed !\r\n"); sleep_ (2); textsize = 0; } if (textsize == 0) { fbb_unlink (pvoie->sr_fic); } } if (textsize == 0) { dde_huf (voiecur, pbul, ENCODE); #ifdef HUFF_TASK return (0); #else pvoie->ask = 0; return (1); #endif } return (1); } /* #pragma warn -par */ FILE *ouvre_mess (unsigned mode, long nmess, char status) { char strmode[3]; char chaine[256]; FILE *fptr; strmode[0] = 'r'; strmode[1] = (mode == O_BINARY) ? 'b' : 't'; strmode[2] = '\0'; strcpy (pvoie->sr_fic, mess_name ((mode == O_BINARY) ? MBINDIR : MESSDIR, nmess, chaine)); if ((fptr = fbb_fopen (pvoie->sr_fic, strmode)) == NULL) { if ((voiecur != CONSOLE) || (!inexport)) { sprintf (chaine, "\rMessage file %s missing in %s\r", pvoie->sr_fic, mycall); outln (chaine, strlen (chaine)); dde_warning ((mode == O_BINARY) ? W_BIN : W_ASC); } } return (fptr); } /* #pragma warn .par */ FILE *ouvre_dirmes (void) { FILE *fptr; int erreur; while (TRUE) { if ((fptr = fbb_fopen (d_disque ("dirmes.sys"), "r+b")) == NULL) { erreur = errno; if (err_ouvert (d_disque ("dirmes.sys"))) cree_dir (erreur); else fbb_error (ERR_CREATE, d_disque ("DIRMES.SYS"), 0); } else break; } return (fptr); } void ferme (FILE * fptr, int err) { if (fbb_fclose (fptr)) fbb_warning (ERR_CLOSE, "fclose", err); } FILE *ouvre_nomenc () { FILE *fptr; while (TRUE) { if ((fptr = fbb_fopen (d_disque ("inf.sys"), "r+b")) == NULL) { if (err_ouvert (d_disque ("INF.SYS"))) cree_info (); else fbb_error (ERR_CREATE, d_disque ("inf.sys"), 0); } else break; } return (fptr); } char *mess_name (char *path, long numero, char *nom) { unsigned int final; final = (unsigned int) (numero % 10); sprintf (nom, "%smail%u\\m_%06ld.mes", path, final, numero); #ifdef __linux__ strcpy (nom, back2slash (nom)); #endif return (nom); } char *temp_name (int voie, char *tempname) { sprintf (tempname, "%stemp.%02d", MBINDIR, voie); #ifdef __linux__ strcpy (tempname, back2slash (tempname)); #endif return (tempname); } char *copy_name (int voie, char *tempname) { sprintf (tempname, "%scopy.%02d", MBINDIR, voie); #ifdef __linux__ strcpy (tempname, back2slash (tempname)); #endif return (tempname); } char *xfwd_name (int voie, char *tempname) { sprintf (tempname, "%sxfwd.%02d", MBINDIR, voie); #ifdef __linux__ strcpy (tempname, back2slash (tempname)); #endif return (tempname); } char *hold_name (long val, char *tempname) { sprintf (tempname, "%s%08lx.hld", MESSDIR, val); #ifdef __linux__ strcpy (tempname, back2slash (tempname)); #endif return (tempname); } void del_temp (int voie) { char temp[128]; deb_io (); fbb_unlink (temp_name (voie, temp)); fin_io (); } void del_copy (int voie) { char temp[128]; deb_io (); fbb_unlink (copy_name (voie, temp)); fin_io (); } #define TAIBUF 5000 static char buffer[TAIBUF]; long copy_fic (int fd_orig, int fd_dest, char *lc) { int nb_lus; int ret; long nb_oct = 0L; if (lc) *lc = '\0'; while (1) { nb_lus = fbb_read (fd_orig, buffer, TAIBUF); nb_oct += (long) nb_lus; if (nb_lus > 0) { ret = fbb_write (fd_dest, buffer, nb_lus); if (lc) *lc = buffer[nb_lus - 1]; if (ret == -1) break; } else { break; } } return (nb_oct); } int rename_temp (int voie, char *newname) { int retour; int orig, dest; char temp[128]; deb_io (); temp_name (voie, temp); fbb_unlink (newname); if ((0) && (*newname == *temp)) { retour = rename (temp, newname); } else { retour = 0; orig = fbb_open (temp, O_RDONLY | O_BINARY, 0); if (orig < 0) { fin_io (); return (-1); } dest = fbb_open (newname, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE); if (dest < 0) { close (orig); fin_io (); return (-1); } copy_fic (orig, dest, NULL); fbb_close (orig); fbb_close (dest); fbb_unlink (temp); } fin_io (); return (retour); } int hold_temp (int voie, char *tempfile, char *newname, int erase) { int retour = 1; int orig, dest; char header[256]; deb_io (); orig = fbb_open (tempfile, O_RDONLY | O_BINARY, 0); if (orig < 0) { fin_io (); return (-1); } dest = fbb_open (newname, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, S_IREAD | S_IWRITE); if (dest < 0) { close (orig); fin_io (); return (-1); } /* Reserve la place du header dans le fichier destination */ memset (header, 0, sizeof (header)); fbb_write (dest, header, sizeof (header)); /* Copie le fichier temporaire */ copy_fic (orig, dest, NULL); fbb_close (orig); if (*(svoie[voie]->appendf)) { /* Ajoute le fichier d'append s'il existe */ orig = fbb_open (svoie[voie]->appendf, O_RDONLY | O_BINARY, 0); if (orig < 0) { fin_io (); return (-1); } svoie[voie]->entmes.taille += copy_fic (orig, dest, NULL); fbb_close (orig); *(svoie[voie]->appendf) = '\0'; } /* Mise a jour du header */ lseek (dest, 0L, SEEK_SET); fbb_write (dest, &(svoie[voie]->entmes), sizeof (bullist)); fbb_write (dest, svoie[voie]->mess_home, sizeof (svoie[voie]->mess_home)); fbb_close (dest); if (erase) fbb_unlink (tempfile); fin_io (); return (retour); } FILE *fappend (char *filename, char *mode) { FILE *fptr; #if defined(__FBBDOS__) || defined(__WINDOWS__) char fullmode[5]; #ifdef __WIN32__ int c; fullmode[0] = 'r'; fullmode[1] = '+'; fullmode[2] = *mode; fullmode[3] = '\0'; if ((fptr = fbb_fopen (filename, fullmode)) != NULL) { fseek (fptr, -1L, SEEK_END); c = getc (fptr); if (c == CTRL_Z) fseek (fptr, -1L, SEEK_END); else fseek (fptr, 0L, SEEK_END); return (fptr); } else { fullmode[0] = 'w'; fullmode[1] = *mode; fullmode[2] = '\0'; return (fbb_fopen (filename, fullmode)); } #else if ((fptr = fbb_fopen (filename, "r+b")) != NULL) { fseek (fptr, -1L, SEEK_END); c = getc (fptr); if (c == CTRL_Z) fseek (fptr, -1L, SEEK_END); else fseek (fptr, 0L, SEEK_END); if (*mode == 't') { _openfd[fileno (fptr)] &= (~O_BINARY); _openfd[fileno (fptr)] |= O_TEXT; } return (fptr); } else { fullmode[0] = 'w'; fullmode[1] = *mode; fullmode[2] = '\0'; return (fbb_fopen (filename, fullmode)); } #endif #endif #ifdef __linux__ if ((fptr = fbb_fopen (back2slash (filename), "r+")) != NULL) { fseek (fptr, 0L, SEEK_END); return (fptr); } else return (fbb_fopen (back2slash (filename), "w")); #endif } int fbb_fcloseall (void) { #ifdef __linux__ return 0; #else #if defined(__DPMI16__) || defined(__WINDOWS__) int cnt; cnt = fcloseall (); return (cnt); #else int i; FILE *fp; for (i = 5, fp = _streams + 5, cnt = 0; i < FOPEN_MAX; fp++, i++) { if (fp->fd != 0xff) { if (fclose (fp)) cnt = -9999; else cnt++; } } return (cnt < 0 ? EOF : cnt); #endif /* DPMI16 / WINDWOS */ #endif /* LINUX */ } void fbb_clrscr (void) { #ifdef __FBBDOS__ clrscr (); #endif } /* Returns true if there is more than 1000K available in disks */ int is_room (void) { return ((sys_disk > MIN_DISK) && (tmp_disk > MIN_DISK)); } fbb-7.0.10/src/pacsat.c0000644000175000017500000006630013613360505011466 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* pbdir.c 1993.8.6 */ /*#ifdef __linux__ #define __a1__ __attribute__ ((packed, aligned(1))) #else */ #define __a1__ /*#endif*/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define PFH_MSG 1 #define PFH_FILE 2 static BOOL f_beacon = OFF; static struct stqueue actuser; static struct stqueue freeuser; static struct stqueue freehole; static char rkss[FRMSIZE]; static ushort chck; static ushort crc; static struct stuser user[MAXUSER]; static struct sthole hole[MAXHOLE]; static long tim_0; static long tim_1; static long tim_2; static long tim_3; static int baud; typedef struct full_sockaddr_ax25 fs_ax25; static BOOL f_rkss; /* pbsv.c */ static int lnrkss; static struct stpfhdir pfhdir[MAXPFHDIR]; static char pac_call[12]; static char pac_port[12]; static int npfhdir; static int msock = -1; /* Rx monitoring socket */ static int pacsat; static long to_empty; static long to_user; #ifdef PACDBG static void dispdir (void); #endif static int add_buf (char *buf, void *data, int nb); static uchar send_pfh (int dirent, int block_size); static int req_dir (char *callsign); static int pfhstat ( char *name, struct stpfh *pfh); static void initq (struct stqueue *q); static void putq (struct stqueue *q, struct stqcell *d); static struct stqcell *getq (struct stqueue *q); static void delq (struct stqueue *q, struct stqcell *d); static void timer (void); static void pblist (int ctl); static void qst (void); static void qst_dir (struct stuser *user); static void qst_bul (struct stuser *user); static void rcvreq (void); static void res_msg (char *callsign, int errorcode); static int findfile (int id); static int compare (struct stpfhdir *d1, struct stpfhdir *d2); static int req_bul (char *callsign); static void set_user (struct stuser *user, char *callsign, long file_id, ushort block_size); static void add_hole (struct stuser *user, long offset, ushort length); static struct stuser *sch_user (char *callsign); static void del_user (struct stuser *user); static int add_struct (char *buf, int id, void *data, int lg_data); static int pfh_msg (FILE * fpth, long numero); static int mk_pfh (char *buf, bullist * pbul, long numero); static int mk_pfh_file (long numero, int type); static char *dlname (long numero); static void rm_pfh_file (long numero); static int add_crc (char *buf, int nb); static void snd_pac (char *desti, char *buf, int len, int pid); static int rcvkss (void); static char *ax25_ntoaii (char *call); /* * ax25 -> ascii conversion */ static char *_ax25_ntoa(const ax25_address *a) { static char buf[11]; char c, *s; int n; for (n = 0, s = buf; n < 6; n++) { c = (a->ax25_call[n] >> 1) & 0x7F; if (c != ' ') *s++ = c; } *s++ = '-'; n = (a->ax25_call[6] >> 1) & 0x0F; if (n > 9) { *s++ = '1'; n -= 10; } *s++ = n + '0'; *s++ = '\0'; return buf; } void pbsv (void) { if (pacsat == 0) return; timer (); while (rcvkss ()) rcvreq (); qst (); pblist (0); } #define TIME(x) ((((long)(x)) << 16) / 3600L) void init_pac (void) { FILE *fptr; char buf[256]; char *av1, *av2; if ((fptr = fopen ("init.pac", "r")) == NULL) { pacsat = 0; /* removed warning until this protocol is used by future satellites ??? * printf ("No PACSAT satellit protocol configuration file 'init.pac'\n"); */ return; } printf ("Reading PACSAT satellite protocol configuration file 'init.pac'\n"); /* Default values */ strcpy (pac_call, mycall); if (myssid) { sprintf (pac_call + strlen (pac_call), "-%d", myssid); } n_cpy (10, pac_port, p_port[1].name); to_empty = TIME (2); to_user = TIME (10); baud = 1200; while (fgets (buf, 128, fptr) != NULL) { av1 = strtok (buf, " \t\r\n"); strupr (av1); if (av1 == NULL) continue; av2 = strtok (NULL, " \t\r\n"); if (av2 == NULL) continue; if (strcmp (av1, "CALLSIGN") == 0) { strupr (av2); n_cpy (10, pac_call, av2); } else if (strcmp (av1, "PORT") == 0) { n_cpy (10, pac_port, av2); } else if (strcmp (av1, "USER") == 0) { to_user = TIME (atoi (av2)); printf ("User time-out = %s sec\n", av2); } else if (strcmp (av1, "EMPTY") == 0) { to_empty = TIME (atoi (av2)); printf ("PB empty time-out = %s sec\n", av2); } else if (strcmp (av1, "BAUD") == 0) { baud = atoi (av2); printf ("Baud rate = %d\n", baud); } } fclose (fptr); printf ("Broadcast callsign [%s]\n", pac_call); printf ("Broadcast port [%s]\n", pac_port); pacsat = 1; } /* * < initdir > initialize directory entry * Opens dirmes.sys and initialises the PFH list */ int init_pfh (void) { bloc_mess *bptr = tete_dir; mess_noeud *mptr; int offset; bullist bul; int i; FILE *fptr; init_pac (); if (pacsat == 0) return 0; initq (&actuser); initq (&freeuser); for (i = 0; i < MAXUSER; i++) putq (&freeuser, (struct stqcell *)&user[i]); initq (&freehole); for (i = 0; i < MAXHOLE; i++) putq (&freehole, (struct stqcell *)&hole[i]); npfhdir = 0; ouvre_dir (); offset = 0; while (bptr) { mptr = &(bptr->st_mess[offset]); if (mptr->noenr) { read_dir (mptr->noenr, &bul); if ((bul.status != 'K') && (bul.status != 'A') && (npfhdir < MAXPFHDIR)) { pfhdir[npfhdir].t_new = bul.date; pfhdir[npfhdir].file_id = bul.numero; pfhdir[npfhdir].pfh_type = PFH_MSG; npfhdir++; } } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } ferme_dir (); /* Idem for YAPPLBL.DAT */ fptr = fopen (d_disque ("YAPPLBL.DAT"), "rb"); if (fptr) { Rlabel rlabel; while (fread (&rlabel, sizeof (Rlabel), 1, fptr)) { if ((*rlabel.nomfic) && (npfhdir < MAXPFHDIR)) { pfhdir[npfhdir].t_new = rlabel.date_creation; pfhdir[npfhdir].file_id = rlabel.index; pfhdir[npfhdir].pfh_type = PFH_FILE; npfhdir++; } } fclose (fptr); } qsort (&pfhdir[0], npfhdir, sizeof (struct stpfhdir), (int (*)(const void *, const void *))compare); pfhdir[0].t_old = 0; for (i = 1; i < npfhdir; i++) { pfhdir[i].t_old = pfhdir[i - 1].t_new + 1; } #ifdef PACDBG dispdir (); #endif if (fbb_ax25_config_load_ports () == 0) fprintf (stderr, "no AX.25 port data configured\n"); /* Creates RX monitoring socket */ if ((msock = socket (AF_PACKET, SOCK_PACKET, htons (ETH_P_AX25))) == -1) { perror ("pacsat socket_monitoring"); } else { /* Non blocking socket */ int ioc = 1; ioctl (msock, FIONBIO, &ioc); } return (npfhdir); } void add_pfh (bullist * pbul) { if (pacsat == 0) return; if ((pbul->status != 'K') && (pbul->status != 'A') && (npfhdir < MAXPFHDIR)) { if (npfhdir) pfhdir[npfhdir].t_old = pfhdir[npfhdir - 1].t_new + 1; else pfhdir[npfhdir].t_old = 0; pfhdir[npfhdir].t_new = pbul->date; pfhdir[npfhdir].file_id = pbul->numero; send_pfh (npfhdir, MAXBLKSIZE); npfhdir++; } } static int compare (struct stpfhdir *d1, struct stpfhdir *d2) { if (d1->t_new == d2->t_new) { return (0); } else if ((u_long) d1->t_new > (u_long) d2->t_new) { return (1); } else { return (-1); } } #ifdef PACDBG /* * < dispdir > display directory */ static void dispdir (void) { int i; for (i = 0; i < npfhdir; i++) { printf (" %4d %lu,%lu %lX %d\n", i, pfhdir[i].t_old, pfhdir[i].t_new, pfhdir[i].file_id, pfhdir[i].pfh_size); } } #endif static int add_buf (char *buf, void *data, int nb) { memcpy (buf, data, nb); return (nb); } /* * < send_pfh > send PFH */ static uchar send_pfh (int dirent, int block_size) { char buf[256]; char out[256]; char *pbuf; uchar flags; int psize, size, nb; long file_id, offset; file_id = pfhdir[dirent].file_id; psize = mk_pfh (buf, NULL, file_id); flags = 0x00; if ((dirent + 1) == npfhdir) flags |= 0x40; offset = 0; for (;;) { size = psize - offset; if (size <= block_size) { flags |= 0x20; } else { size = block_size; } pbuf = buf + offset; nb = 0; nb += add_buf (&out[nb], &flags, 1); nb += add_buf (&out[nb], &file_id, 4); nb += add_buf (&out[nb], &offset, 4); nb += add_buf (&out[nb], &pfhdir[dirent].t_old, 4); nb += add_buf (&out[nb], &pfhdir[dirent].t_new, 4); nb += add_buf (&out[nb], pbuf, size); nb = add_crc (out, nb); snd_pac ("QST-1", out, nb, 0xbd); if (flags & 0x20) { break; } offset += size; } return (flags); } /* * < req_dir > request directory */ static int req_dir (char *callsign) { u_char flags; ushort block_size; struct stuser *user; struct sthole *hole; time_t start, end; int i; i = HDRSIZE; flags = rkss[i]; i += 1; memcpy (&block_size, &rkss[i], 2); i += 2; user = (struct stuser *) getq (&freeuser); if (user == NULL) { return (-1); /* queue full */ } user->entry_t = time (NULL); user->flags = F_DIR; strcpy (user->call, callsign); user->block_size = block_size; initq (&user->hole); putq (&actuser, (struct stqcell *)user); for (; i < lnrkss; i += (4 + 4)) { memcpy (&start, &rkss[i], 4); memcpy (&end, &rkss[i + 4], 4); hole = (struct sthole *) getq (&freehole); if (hole == NULL) break; hole->start = start; hole->end = end; putq (&user->hole, (struct stqcell *)hole); } return (0); /* OK */ } /* * < pfhstat > PFH stat */ static int pfhstat ( char *name, struct stpfh *pfh) { FILE *fp; int c, i, s, length; char data[256]; ushort id; s = 0; if ((fp = fopen (name, "rb")) == NULL) { return (-1); } c = fgetc (fp); s++; id = (c << 8); c = fgetc (fp); s++; id |= c; if (id != 0xaa55) { /* PFH check ? */ fclose (fp); return (-1); } for (;;) { c = fgetc (fp); if (c == EOF) break; id = c; c = fgetc (fp); id |= (c << 8); c = fgetc (fp); length = c; s += 3; if (id == 0 && length == 0) /* termination ? */ break; for (i = 0; i < length; i++) { data[i] = fgetc (fp); s++; } switch (id) { case 0x04: memcpy (&pfh->file_size, data, 4); break; case 0x08: pfh->file_type = data[0]; break; case 0x0b: memcpy (&pfh->body_offset, data, 2); break; default: break; } } fclose (fp); pfh->pfh_size = s; return (0); } /* * < initq > initialize queue */ static void initq (struct stqueue *q) { q->head = q->tail = NULL; } /* * < putq > put queue */ static void putq (struct stqueue *q, struct stqcell *d) { if (q == NULL || d == NULL) { assert (0); } d->next = NULL; if (q->head == NULL) { q->head = q->tail = d; } else { q->tail->next = d; q->tail = d; } } /* * < getq > get queue */ static struct stqcell *getq (struct stqueue *q) { struct stqcell *r; if (q == NULL) { assert (0); } r = q->head; if (r != NULL) { q->head = r->next; } if (q->head == NULL) { q->tail = NULL; } return (r); } /* * < delq > delete queue */ static void delq (struct stqueue *q, struct stqcell *d) { struct stqcell *d2; struct stqueue temp; initq (&temp); while ((d2 = getq (q)) != NULL) { if (d2 != d) { putq (&temp, d2); } } *q = temp; } /* * < timer > timer */ static void timer (void) { static long t1; long clk, t; clk = btime (); t = clk - t1; t1 = clk; if ((u_long) tim_0 > (u_long) t) { tim_0 -= t; } else tim_0 = 0; if ((u_long) tim_1 > (u_long) t) { tim_1 -= t; } else tim_1 = 0; if ((u_long) tim_2 > (u_long) t) { tim_2 -= t; } else tim_2 = 0; t *= 100; if ((u_long) tim_3 > (u_long) t) { tim_3 -= t; } else tim_3 = 0; } /* * < pblist > PB list */ static void pblist (int ctl) { VOID add_kss (char *, int); char buf[256]; int n; struct stuser *user; if (f_beacon) { f_beacon = OFF; tim_0 = 0; } if (ctl == 1) tim_0 = 0; else { if (tim_0 != 0 || actuser.head != NULL) return; } if (tim_0 != 0) return; tim_0 = to_empty; strcpy (buf, "PB:"); user = (struct stuser *) actuser.head; n = 0; if (user == NULL) { strcat (buf, " Empty."); } else { while (user != NULL) { strcat (buf, " "); strcat (buf, user->call); if (user->flags & F_DIR) strcat (buf, "\\D"); user = user->next; n++; } } strcat (buf, "\r"); snd_pac ("PBLIST", buf, strlen (buf), 0xf0); } /* * < qst > */ static void qst (void) { struct stuser *user; if (actuser.head == NULL) return; if (tim_3) { return; } pblist (1); user = (struct stuser *) getq (&actuser); /* check time over ? */ if ((time (NULL) - user->entry_t) > to_user) { del_user (user); return; } if (user->flags & F_DIR) { qst_dir (user); } else { qst_bul (user); } if (user->hole.head == NULL) { putq (&freeuser, (struct stqcell *)user); /* Termine... Supprime le fichier si pas utilise */ rm_pfh_file (user->file_id); } else { putq (&actuser, (struct stqcell *)user); } if (actuser.head == NULL) { pblist (1); } } /* * < qst_dir > directory */ static void qst_dir (struct stuser *user) { struct sthole *hole; u_char flags; int i, j, dirent; int nb_blk = (baud / 600); if (nb_blk > 10) nb_blk = 10; for (i = 0; i < nb_blk; i++) { hole = (struct sthole *) user->hole.head; if (hole == NULL) break; dirent = npfhdir - 1; for (j = 0; j < npfhdir; j++) { if ((u_long) hole->start >= (u_long) pfhdir[j].t_old && (u_long) hole->start <= (u_long) pfhdir[j].t_new) { dirent = j; break; } } flags = send_pfh (dirent, user->block_size); hole->start = pfhdir[dirent].t_new + 1; if ((u_long) hole->start > (u_long) hole->end || (flags & 0x40)) { /* hole delete ? */ hole = (struct sthole *) getq (&user->hole); putq (&freehole, (struct stqcell *)hole); } } } /* * < qst_bul > */ static void qst_bul (struct stuser *user) { struct sthole *hole; char name[128]; char buf[256]; char out[256]; FILE *fp; char flags, file_type; long file_id, offset; int i; int nb; int size; int nb_blk = (baud / 600); if (nb_blk > 10) nb_blk = 10; file_id = user->file_id; file_type = user->file_type; strcpy (name, dlname (file_id)); if ((fp = fopen (name, "rb")) == NULL) { printf ("QST-1 file[%s] open error\n", name); exit (1); } flags = 0x02; for (i = 0; i < nb_blk; i++) { hole = (struct sthole *) user->hole.head; if (hole == NULL) { break; } offset = hole->offset; if (user->block_size > hole->length) { size = hole->length; } else { size = user->block_size; } hole->offset += (long) size; hole->length -= size; if (hole->length == 0) { hole = (struct sthole *) getq (&user->hole); putq (&freehole, (struct stqcell *)hole); } fseek (fp, offset, SEEK_SET); fread (buf, size, 1, fp); nb = 0; nb += add_buf (&out[nb], &flags, 1); nb += add_buf (&out[nb], &file_id, 4); nb += add_buf (&out[nb], &file_type, 1); nb += add_buf (&out[nb], &offset, 3); nb += add_buf (&out[nb], buf, size); nb = add_crc (out, nb); snd_pac ("QST-1", out, nb, 0xbb); } fclose (fp); } /* * < rcvreq > receive request */ static void rcvreq (void) { char callsign[12]; int r; u_char pid; if (!f_rkss) return; f_rkss = OFF; if (lnrkss <= HDRSIZE) return; pid = rkss[HDRSIZE - 1] & 0xff; /* Verify if the request is for me */ if (strcmp (pac_call, ax25_ntoaii (rkss + 1)) != 0) { return; } strcpy (callsign, ax25_ntoaii (rkss + 1 + ADRSIZE)); del_user (sch_user (callsign)); switch (pid) { case 0xbb: /* pid = bb */ r = req_bul (callsign); break; case 0xbd: /* pid = bd */ r = req_dir (callsign); break; default: return; } res_msg (callsign, r); } /* * < res_msg > response messages */ static void res_msg (char *callsign, int errorcode) { char buf[64]; if (errorcode == 0) { sprintf (buf, "OK %s\r", callsign); } else { sprintf (buf, "NO %d %s\r", errorcode, callsign); } snd_pac (callsign, buf, strlen (buf), 0xf0); } static int findfile (int id) { FILE *fptr; Rlabel rlabel; int ret = -1; int record = 0; /* Seach file in the existing labels */ if ((fptr = fopen (d_disque ("YAPPLBL.DAT"), "rb")) == NULL) return (ret); while (fread (&rlabel, sizeof (Rlabel), 1, fptr)) { if ((*rlabel.nomfic) && (rlabel.index == id)) { ret = record; break; } ++record; } fclose (fptr); return (ret); } /* * < req_bul > request */ static int req_bul (char *callsign) { uchar flags; long file_id, offset; ushort block_size, length; int i; int file_type; struct stuser *user; i = HDRSIZE; flags = rkss[i]; i += 1; memcpy (&file_id, &rkss[i], 4); i += 4; memcpy (&block_size, &rkss[i], 2); i += 2; if (findmess (file_id) == NULL) { /* Not a msg... Is it a file ? */ if (findfile (file_id) != -1) { file_type = PFH_FILE; } else { /* None exist */ return (-2); } } else { file_type = PFH_MSG; } user = (struct stuser *) getq (&freeuser); if (user == NULL) { return (-1); /* queue full */ } /* Create the DL file */ if (mk_pfh_file (file_id, file_type) == 0) return (-2); if (access (dlname (file_id), 00) != 0) { /* DL file exist ? */ return (-2); /* file does not exist */ } switch (flags & 0x03) { case 0x00: /* start */ set_user (user, callsign, file_id, block_size); offset = 0; length = block_size * 10; for (i = 0; i < 10; i++) { add_hole (user, offset, length); offset += length; } break; case 0x01: /* stop */ break; case 0x02: /* hole list */ set_user (user, callsign, file_id, block_size); for (; i < lnrkss; i += (3 + 2)) { offset = 0; memcpy (&offset, &rkss[i], 3); memcpy (&length, &rkss[i + 3], 2); add_hole (user, offset, length); } break; default: return (-4); /* debug */ break; } return (0); /* OK */ } /* * < set_user > set user list */ static void set_user (struct stuser *user, char *callsign, long file_id, ushort block_size) { struct stat sbuf; struct stpfh pfh; char pathname[128]; strcpy (pathname, dlname (file_id)); stat (pathname, &sbuf); pfhstat (pathname, &pfh); user->entry_t = time (NULL); user->flags = 0x0000; strcpy (user->call, callsign); user->file_id = file_id; user->file_type = pfh.file_type; user->file_size = sbuf.st_size; if (block_size > MAXBLKSIZE) { /* block size adjust */ user->block_size = MAXBLKSIZE; } else { user->block_size = block_size; } initq (&user->hole); putq (&actuser, (struct stqcell *)user); } /* * < add_hole > */ static void add_hole (struct stuser *user, long offset, ushort length) { struct sthole *hole; if (offset >= user->file_size) return; if (offset + length > user->file_size) /* adjust */ length = user->file_size - offset; hole = (struct sthole *) getq (&freehole); if (hole == NULL) { assert (0); } hole->offset = offset; hole->length = length; putq (&user->hole, (struct stqcell *)hole); } /* * < sch_user > search user */ static struct stuser *sch_user (char *callsign) { struct stuser *user; user = (struct stuser *) actuser.head; while (user) { if (strcmp (user->call, callsign) == 0) { break; } user = (struct stuser *) user->next; } return (user); } /* * < del_user > delete user */ static void del_user (struct stuser *user) { struct sthole *hole; if (user == NULL) return; while ((hole = (struct sthole *) getq (&user->hole)) != NULL) { putq (&freehole, (struct stqcell *)hole); } delq (&actuser, (struct stqcell *)user); putq (&freeuser, (struct stqcell *)user); } static int add_struct (char *buf, int id, void *data, int lg_data) { *buf++ = id & 0xff; *buf++ = id >> 8; *buf++ = lg_data; memcpy (buf, data, lg_data); lg_data += 3; return (lg_data); } static int pfh_msg (FILE * fpth, long numero) { /* int verbose = 1; */ FILE *fptm; int fd_msg; int fd_pfh; int i, nb, wr, tot, lgbuf; uchar buf[4096]; if (fpth) { fflush (fpth); fd_pfh = fileno (fpth); } else fd_pfh = 0; if ((fptm = ouvre_mess (O_TEXT, numero, '\0')) != NULL) { fd_msg = fileno (fptm); } else return 0; crc = 0; tot = 0; wr = 0; lgbuf = sizeof (buf); for (;;) { nb = read (fd_msg, buf, lgbuf); if (nb <= 0) break; if (fd_pfh) wr = write (fd_pfh, buf, nb); for (i = 0; i < nb; i++) { crc += buf[i]; } tot += nb; } fclose (fptm); return tot; } struct pfh1 { unsigned short id __a1__; uchar len __a1__; uchar val __a1__; }; struct pfh2 { unsigned short id __a1__; uchar len __a1__; unsigned short val __a1__; }; struct pfh3 { unsigned short id __a1__; uchar len __a1__; uchar val[3] __a1__; }; struct pfh4 { unsigned short id __a1__; uchar len __a1__; unsigned long val __a1__; }; struct pfh8 { unsigned short id __a1__; uchar len __a1__; uchar val[8] __a1__; }; struct pfh { unsigned short magic_number __a1__; struct pfh4 file_number __a1__; struct pfh8 file_name __a1__; struct pfh3 file_ext __a1__; struct pfh4 file_size __a1__; struct pfh4 create_time __a1__; struct pfh4 last_modif_time __a1__; struct pfh1 seu_flag __a1__; struct pfh1 file_type __a1__; struct pfh2 body_checksum __a1__; struct pfh2 header_checksum __a1__; struct pfh2 body_offset __a1__; }; static int mk_pfh (char *buf, bullist * pbul, long numero) { bullist bul; mess_noeud *lptr; int lg; int i; int nb; int zero = 0; struct pfh *pfh = (struct pfh *) buf; uchar *ptr; char lbuf[80]; if (pbul == NULL) { lptr = findmess (numero); if (lptr == NULL) return (0); ouvre_dir (); read_dir (lptr->noenr, &bul); ferme_dir (); pbul = &bul; } lg = pfh_msg (NULL, pbul->numero); pfh->magic_number = 0x55aa; pfh->file_number.id = 1; pfh->file_number.len = 4; pfh->file_number.val = pbul->numero; pfh->file_name.id = 2; pfh->file_name.len = 8; sprintf (pfh->file_name.val, " "); pfh->file_ext.id = 3; pfh->file_ext.len = 3; sprintf (pfh->file_ext.val, " "); pfh->create_time.id = 5; pfh->create_time.len = 4; pfh->create_time.val = pbul->date; pfh->last_modif_time.id = 6; pfh->last_modif_time.len = 4; pfh->last_modif_time.val = 0; pfh->seu_flag.id = 7; pfh->seu_flag.len = 1; pfh->seu_flag.val = 0; pfh->file_type.id = 8; pfh->file_type.len = 1; pfh->file_type.val = 0; pfh->body_checksum.id = 9; pfh->body_checksum.len = 2; pfh->body_checksum.val = crc; pfh->header_checksum.id = 0xa; pfh->header_checksum.len = 2; pfh->header_checksum.val = 0; nb = sizeof (struct pfh); nb += add_struct (&buf[nb], 0x10, pbul->exped, strlen (pbul->exped)); sprintf (lbuf, "%-6s", pbul->exped); nb += add_struct (&buf[nb], 0x11, lbuf, 6); nb += add_struct (&buf[nb], 0x12, &pbul->date, 4); nb += add_struct (&buf[nb], 0x13, &pbul->nblu, 1); if (*pbul->bbsv) sprintf (lbuf, "%s@%s", pbul->desti, pbul->bbsv); else sprintf (lbuf, "%s", pbul->desti); nb += add_struct (&buf[nb], 0x14, lbuf, strlen (lbuf)); nb += add_struct (&buf[nb], 0x15, " ", 6); nb += add_struct (&buf[nb], 0x16, &zero, 4); nb += add_struct (&buf[nb], 0x17, &zero, 4); nb += add_struct (&buf[nb], 0x18, &zero, 1); nb += add_struct (&buf[nb], 0x19, &zero, 1); nb += add_struct (&buf[nb], 0x20, &pbul->type, 1); nb += add_struct (&buf[nb], 0x21, pbul->bid, strlen (pbul->bid)); nb += add_struct (&buf[nb], 0x22, pbul->titre, strlen (pbul->titre)); buf[nb++] = '\0'; buf[nb++] = '\0'; buf[nb++] = '\0'; pfh->file_size.id = 4; pfh->file_size.len = 4; pfh->file_size.val = lg + nb; pfh->body_offset.id = 0xb; pfh->body_offset.len = 2; pfh->body_offset.val = (unsigned short) nb; /* Computing header checksum */ ptr = (char *) pfh; for (chck = 0, i = 0; i < nb; ptr++, i++) { chck += 0xff & (unsigned short) *ptr; } pfh->header_checksum.val = chck; return (nb); } static int mk_pfh_file (long numero, int type) { int nb = 0; FILE *fptr; char header[256]; if (type == PFH_MSG) { nb = mk_pfh (header, NULL, numero); if (nb == 0) return (0); if (access (dlname (numero), 00) == 0) return (1); fptr = fopen (dlname (numero), "wb"); if (fptr == NULL) return (0); fwrite (header, nb, 1, fptr); nb = pfh_msg (fptr, numero); fclose (fptr); } if (type == PFH_FILE) { nb = 0; } return nb; } /* * < dlname > pathname DL file */ static char *dlname (long numero) { static char pathname[128]; sprintf (pathname, "%s%lx.dl", MBINDIR, numero); return (pathname); } static void rm_pfh_file (long numero) { struct stuser *user; user = (struct stuser *) actuser.head; while (user) { if (((user->flags & F_DIR) == 0) && (user->file_id == numero)) { /* used by another user */ return; } user = user->next; } /* unlink the DL file */ unlink (dlname (numero)); } static int add_crc (char *buf, int nb) { int j; short crc; for (j = 0, crc = 0; j < nb; j++) { crc = calc_crc (buf[j], crc); } buf[j++] = (crc >> 8) & 0xff; buf[j++] = crc & 0xff; return (j); } static void snd_pac (char *desti, char *buf, int len, int pid) { static int s_f0 = -1; static int s_bb = -1; static int s_bd = -1; int slen; int dlen; fs_ax25 dst; fs_ax25 src; char *call = NULL; int s = -1; long temps; switch (pid) { case 0xbb: s = s_bb; break; case 0xbd: s = s_bd; break; case 0xf0: s = s_f0; break; } if (s == -1) { slen = ax25_aton (pac_call, &src); call = ax25_config_get_addr (pac_port); if (call == NULL) { printf ("Cannot find a callsign for port %s\n", pac_port); return; } ax25_aton_entry (call, src.fsa_digipeater[0].ax25_call); src.fsa_ax25.sax25_ndigis = 1; if ((s = socket (AF_AX25, SOCK_DGRAM, pid)) == -1) { perror ("beacon:socket"); return; } if (bind (s, (struct sockaddr *) &src, slen) == -1) { perror ("beacon:bind"); return; } switch (pid) { case 0xbb: s_bb = s; break; case 0xbd: s_bd = s; break; case 0xf0: s_f0 = s; break; } } if ((dlen = ax25_aton (desti, &dst)) == -1) { fprintf (stderr, "beacon: unable to convert '%s'\n", call); return; } if (sendto (s, buf, len, 0, (struct sockaddr *) &dst, dlen) == -1) { perror ("beacon: sendto"); return; } temps = (TIME ((len + HDRSIZE))) * 1000 / baud; tim_3 += temps; } static int rcvkss (void) { struct sockaddr sa; unsigned asize = sizeof (sa); int lg; char *ptr; lnrkss = 0; if (msock == -1) return (0); lg = recvfrom (msock, rkss, FRMSIZE, 0, &sa, &asize); if (lg <= 0) return (0); if ((ptr = ax25_config_get_name (sa.sa_data)) != NULL) { /* printf("Received UI on port %s, lg=%d\n", ptr, lg); */ } lnrkss = lg; f_rkss = ON; return (lg); } static char *ax25_ntoaii (char *call) { char *scan; char *ptr = _ax25_ntoa ((ax25_address *)call); scan = strrchr (ptr, '-'); if ((scan) && (*(scan + 1) == '0')) *scan = '\0'; return (ptr); } fbb-7.0.10/src/aff_stat.c0000644000175000017500000000350713613360505012002 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* Affiche une ligne de liste message */ static char *ltitre (int mode, bullist * pbul) /* Mode = 1 pour LS */ { /* int lg = (mode) ? 80 : 36 ; */ int lg = 80; static char buf[100]; if (pvoie->typlist) { sprintf (buf, "%-12s ", pbul->bid); if (mode) strn_cpy (lg, buf + 13, pbul->titre); else n_cpy (lg, buf + 13, pbul->titre); } else { if (mode) strn_cpy (lg, buf, pbul->titre); else n_cpy (lg, buf, pbul->titre); } return (buf); } #ifndef NO_STATUS static void aff_status (bullist * ligne) { char *ptr; *ptmes = *ligne; if (*(ligne->bbsv)) sprintf (varx[0], "@%-6s", bbs_via (ligne->bbsv)); else strcpy (varx[0], " "); var_cpy (1, ltitre (0, ligne)); ptr = var_txt (langue[vlang]->plang[T_MBL + 37 - 1]); /* texte(T_MBL+37) ; */ if (strlen (ptr) > 80) { ptr[79] = '\r'; ptr[80] = '\0'; } outs (ptr, strlen (ptr)); } #endif fbb-7.0.10/src/fortify.c0000644000175000017500000006140613613360505011677 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * FILE: * fortify.c * * DESCRIPTION: * A fortified shell for malloc, realloc, calloc and free. * To use Fortify, each source file will need to #include "fortify.h". To * enable Fortify, define the symbol FORTIFY. If FORTIFY is not defined, it * will compile away to nothing. If you do not have stdout available, you may * wish to set an alternate output function. See Fortify_SetOutputFunc(), * below. * You will also need to link in fortify.o * * None of the functions in this file should really be called * directly; they really should be called through the macros * defined in fortify.h * */ #define __FORTIFY_C__ /* So fortify.h knows to not define the fortify macros */ #include #ifdef FORTIFY #include #include #include #include #include #ifndef __linux__ #include #endif #include "fortify.h" #include "ufortify.h" /* the user's options */ struct Header { char *File; /* The sourcefile of the caller */ unsigned long Line; /* The sourceline of the caller */ size_t Size; /* The size of the malloc'd block */ struct Header *Prev, /* List pointers */ *Next; int Scope; int Checksum; /* For validating the Header structure; see ChecksumHeader() */ }; static int CheckBlock(struct Header *h, char *file, unsigned long line); static int CheckFortification(unsigned char *ptr, unsigned char value, size_t size); static void SetFortification(unsigned char *ptr, unsigned char value, size_t size); static void OutputFortification(unsigned char *ptr, unsigned char value, size_t size); static int IsHeaderValid(struct Header *h); static void MakeHeaderValid(struct Header *h); static int ChecksumHeader(struct Header *h); static int IsOnList(struct Header *h); static void OutputHeader(struct Header *h); static void OutputMemory(struct Header *h); static void st_DefaultOutput(char *String) { /* cprintf(String); cprintf("\r"); */ FILE *fptr; char *ptri; char tro[128]; int i; #ifdef __WINDOWS__ WinDebug(String); #endif #ifdef __FBBDOS__ // dprintf(String); cprintf(String); #endif for (i = 0 ; (*String) ; String++) { if (*String != '\r') tro[i++] = *String; } tro[i] = '\0'; fptr = fopen ("error.sys", "a+"); if (fptr) { fputs(tro, fptr); fclose(fptr); } #ifdef __linux__ fprintf(stderr, tro); #endif } static struct Header *st_Head = 0; /* Head of alloc'd memory list */ static OutputFuncPtr st_Output = st_DefaultOutput; /* Output function for errors */ static char st_Buffer[256]; /* Temporary buffer for sprintf's */ static int st_Disabled = 0; /* If true, Fortify is inactive */ static int st_MallocFailRate = 0; /* % of the time to fail mallocs */ static char *st_LastVerifiedFile = "unknown"; static unsigned long st_LastVerifiedLine = 0; static int st_Scope = 0; static void OutputLastVerifiedPoint(void); /* * Fortify_malloc() - Allocates a block of memory, with extra bits for * misuse protection/detection. * * Features: * + Adds the malloc'd memory onto Fortify's own private list. * (With a checksum'd header to detect corruption of the memory list) * + Places sentinals on either side of the user's memory with * known data in them, to detect use outside of the bounds * of the block * + Initializes the malloc'd memory to some "nasty" value, so code * can't rely on it's contents. * + Can check all sentinals on every malloc. * + Can generate a warning message on a malloc fail. * + Can randomly "fail" at a set fail rate */ void *FORTIFY_STORAGE Fortify_malloc(size_t size, char *file, unsigned long line) { unsigned char *ptr; struct Header *h; FORTIFY_LOCK(); if(st_Disabled) { ptr = malloc(size); FORTIFY_UNLOCK(); return(ptr); } #ifdef CHECK_ALL_MEMORY_ON_MALLOC Fortify_CheckAllMemory(file, line); #endif if(size == 0) { #ifdef WARN_ON_ZERO_MALLOC sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n malloc(0) attempted failed\r\n", file, line); st_Output(st_Buffer); /* sleep(10); */ #endif FORTIFY_UNLOCK(); return(0); } if(st_MallocFailRate > 0) { if(rand() % 100 < st_MallocFailRate) { #ifdef WARN_ON_FALSE_FAIL sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n malloc(%ld) \"false\" failed\r\n", file, line, (unsigned long)size); st_Output(st_Buffer); /* sleep(10); */ #endif FORTIFY_UNLOCK(); return(0); } } /* * malloc the memory, including the space for the header and fortification * buffers */ #ifdef WARN_ON_SIZE_T_OVERFLOW { size_t private_size = sizeof(struct Header) + FORTIFY_BEFORE_SIZE + size + FORTIFY_AFTER_SIZE; if(private_size < size) /* Check to see if the added baggage is larger than size_t */ { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n malloc(%ld) has overflowed size_t.\r\n", file, line, (unsigned long)size); st_Output(st_Buffer); /* sleep(10); */ FORTIFY_UNLOCK(); return(0); } } #endif ptr = malloc(sizeof(struct Header) + FORTIFY_BEFORE_SIZE + size + FORTIFY_AFTER_SIZE); if(!ptr) { #ifdef WARN_ON_MALLOC_FAIL sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n malloc(%ld) failed\r\n", file, line, (unsigned long)size); st_Output(st_Buffer); /* sleep(10); */ #endif FORTIFY_UNLOCK(); return(0); } /* * Initialize and validate the header */ h = (struct Header *)ptr; h->Size = size; h->File = file; h->Line = line; h->Next = st_Head; h->Prev = 0; h->Scope = st_Scope; if(st_Head) { st_Head->Prev = h; MakeHeaderValid(st_Head); } st_Head = h; MakeHeaderValid(h); /* * Initialize the fortifications */ SetFortification(ptr + sizeof(struct Header), FORTIFY_BEFORE_VALUE, FORTIFY_BEFORE_SIZE); SetFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE + size, FORTIFY_AFTER_VALUE, FORTIFY_AFTER_SIZE); #ifdef FILL_ON_MALLOC /* * Fill the actual user memory */ SetFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, FILL_ON_MALLOC_VALUE, size); #endif /* * We return the address of the user's memory, not the start of the block, * which points to our magic cookies */ FORTIFY_UNLOCK(); return(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE); } /* * Fortify_free() - This free must be used for all memory allocated with * Fortify_malloc(). * * Features: * + Pointers are validated before attempting a free - the pointer * must point to a valid malloc'd bit of memory. * + Detects attempts at freeing the same block of memory twice * + Can clear out memory as it is free'd, to prevent code from using * the memory after it's been freed. * + Checks the sentinals of the memory being freed. * + Can check the sentinals of all memory. */ void FORTIFY_STORAGE Fortify_free(void *uptr, char *file, unsigned long line) { unsigned char *ptr = (unsigned char *)uptr - sizeof(struct Header) - FORTIFY_BEFORE_SIZE; struct Header *h = (struct Header *)ptr; FORTIFY_LOCK(); if(st_Disabled) { free(uptr); FORTIFY_UNLOCK(); return; } #ifdef CHECK_ALL_MEMORY_ON_FREE Fortify_CheckAllMemory(file, line); #endif #ifdef PARANOID_FREE if(!IsOnList(h)) { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n Invalid pointer, corrupted header, or possible free twice\r\n", file, line); st_Output(st_Buffer); /* sleep(10); */ OutputLastVerifiedPoint(); goto fail; } #endif if(!CheckBlock(h, file, line)) goto fail; /* * Remove the block from the list */ if(h->Prev) { if(!CheckBlock(h->Prev, file, line)) goto fail; h->Prev->Next = h->Next; MakeHeaderValid(h->Prev); } else st_Head = h->Next; if(h->Next) { if(!CheckBlock(h->Next, file, line)) goto fail; h->Next->Prev = h->Prev; MakeHeaderValid(h->Next); } #ifdef FILL_ON_FREE /* * Nuke out all memory that is about to be freed */ SetFortification(ptr, FILL_ON_FREE_VALUE, sizeof(struct Header) + FORTIFY_BEFORE_SIZE + h->Size + FORTIFY_AFTER_SIZE); #endif /* * And do the actual free */ free(ptr); FORTIFY_UNLOCK(); return; fail: sprintf(st_Buffer, " free(%p) failed\r\n", uptr); st_Output(st_Buffer); /* sleep(10); */ FORTIFY_UNLOCK(); } /* * Fortify_realloc() - Uses Fortify_malloc() and Fortify_free() to implement * realloc(). * * Features: * + The realloc'd block is ALWAYS moved. * + The pointer passed to realloc() is verified in the same way that * Fortify_free() verifies pointers before it frees them. * + All the Fortify_malloc() and Fortify_free() protection */ void *FORTIFY_STORAGE Fortify_realloc(void *ptr, size_t new_size, char *file, unsigned long line) { void *new_ptr; struct Header *h = (struct Header *) ((unsigned char *)ptr - sizeof(struct Header) - FORTIFY_BEFORE_SIZE); if(st_Disabled) { FORTIFY_LOCK(); new_ptr = realloc(ptr, new_size); FORTIFY_UNLOCK(); return(new_ptr); } if(!ptr) return(Fortify_malloc(new_size, file, line)); FORTIFY_LOCK(); if(!IsOnList(h)) { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n Invalid pointer or corrupted header passed to realloc\r\n", file, line); st_Output(st_Buffer); /* sleep(10); */ goto fail; } if(!CheckBlock(h, file, line)) goto fail; new_ptr = Fortify_malloc(new_size, file, line); if(!new_ptr) { FORTIFY_UNLOCK(); return(0); } if(h->Size < new_size) memcpy(new_ptr, ptr, h->Size); else memcpy(new_ptr, ptr, new_size); Fortify_free(ptr, file, line); FORTIFY_UNLOCK(); return(new_ptr); fail: sprintf(st_Buffer, " realloc(%p, %ld) failed\r\n", ptr, (unsigned long)new_size); st_Output(st_Buffer); /* sleep(10); */ FORTIFY_UNLOCK(); return (NULL); } /* * Fortifty_calloc() - Uses Fortify_malloc() to implement calloc(). Much * the same protection as Fortify_malloc(). */ void *FORTIFY_STORAGE Fortify_calloc(size_t num, size_t size, char *file, unsigned long line) { void *ptr; ptr = Fortify_malloc(num * size, file, line); if(ptr) memset(ptr, 0, num * size); return(ptr); } /* * Fortifty_strdup() - Uses Fortify_malloc() to implement strdup(). Much * the same protection as Fortify_malloc(). */ char * Fortify_strdup(char *str, char *file, unsigned long line) { char *ptr; size_t size = strlen(str)+1; ptr = Fortify_malloc(size, file, line); if(ptr) strcpy(ptr, str); return(ptr); } /* * Fortify_CheckPointer() - Returns true if the uptr points to a valid * piece of Fortify_malloc()'d memory. The memory must be on the malloc'd * list, and it's sentinals must be in tact. * If anything is wrong, an error message is issued. * * (Note - if fortify is disabled, this function always returns true). */ int FORTIFY_STORAGE Fortify_CheckPointer(void *uptr, char *file, unsigned long line) { unsigned char *ptr = (unsigned char *)uptr - sizeof(struct Header) - FORTIFY_BEFORE_SIZE; int r; if(st_Disabled) return(1); FORTIFY_LOCK(); if(!IsOnList((struct Header *)ptr)) { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n Invalid pointer or corrupted header detected (%p)\r\n", file, line, uptr); st_Output(st_Buffer); /* sleep(10); */ FORTIFY_UNLOCK(); return(0); } r = CheckBlock((struct Header *)ptr, file, line); FORTIFY_UNLOCK(); return r; } /* * Fortify_SetOutputFunc(OutputFuncPtr Output) - Sets the function used to * output all error and diagnostic messages by fortify. The output function * takes a single unsigned char * argument, and must be able to handle newlines. * The function returns the old pointer. */ Fortify_OutputFuncPtr FORTIFY_STORAGE Fortify_SetOutputFunc(Fortify_OutputFuncPtr Output) { OutputFuncPtr Old = st_Output; st_Output = Output; return(Old); } /* * Fortify_SetMallocFailRate(int Percent) - Fortify_malloc() will make the * malloc attempt fail this Percent of the time, even if the memory is * available. Useful to "stress-test" an application. Returns the old * value. The fail rate defaults to 0. */ int FORTIFY_STORAGE Fortify_SetMallocFailRate(int Percent) { int Old = st_MallocFailRate; st_MallocFailRate = Percent; return(Old); } /* * Fortify_CheckAllMemory() - Checks the sentinals of all malloc'd memory. * Returns the number of blocks that failed. * * (If Fortify is disabled, this function always returns 0). */ int FORTIFY_STORAGE Fortify_CheckAllMemory(char *file, unsigned long line) { struct Header *curr = st_Head; int count = 0; if(st_Disabled) return(0); FORTIFY_LOCK(); while(curr) { if(!CheckBlock(curr, file, line)) count++; curr = curr->Next; } if(file) { st_LastVerifiedFile = file; st_LastVerifiedLine = line; } FORTIFY_UNLOCK(); return(count); } /* Fortify_EnterScope - enters a new Fortify scope level. * returns the new scope level. */ int FORTIFY_STORAGE Fortify_EnterScope(char *file, unsigned long line) { return(++st_Scope); } /* Fortify_LeaveScope - leaves a Fortify scope level, * also prints a memory dump of all non-freed memory that was allocated * during the scope being exited. */ int FORTIFY_STORAGE Fortify_LeaveScope(char *file, unsigned long line) { struct Header *curr = st_Head; int count = 0; unsigned long size = 0; if(st_Disabled) return(0); FORTIFY_LOCK(); st_Scope--; while(curr) { if(curr->Scope > st_Scope) { if(count == 0) { sprintf(st_Buffer, "\r\nFortify: Memory Dump at %s.%ld\r\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); sprintf(st_Buffer, "%11s %8s %s\r\n", "Address", "Size", "Allocator"); st_Output(st_Buffer); } OutputHeader(curr); count++; size += curr->Size; } curr = curr->Next; } if(count) { sprintf(st_Buffer, "%11s %8ld bytes overhead\r\n", "and", (unsigned long)(count * (sizeof(struct Header) + FORTIFY_BEFORE_SIZE + FORTIFY_AFTER_SIZE))); st_Output(st_Buffer); sprintf(st_Buffer,"%11s %8ld bytes in %d blocks\r\n", "total", size, count); st_Output(st_Buffer); } FORTIFY_UNLOCK(); return(count); } /* * Fortify_OutputAllMemory() - Outputs the entire list of currently * malloc'd memory. For each malloc'd block is output it's Address, * Size, and the SourceFile and Line that allocated it. * * If there is no memory on the list, this function outputs nothing. * * It returns the number of blocks on the list, unless fortify has been * disabled, in which case it always returns 0. */ int FORTIFY_STORAGE Fortify_OutputAllMemory(char *file, unsigned long line) { struct Header *curr = st_Head; int count = 0; unsigned long size = 0; if(st_Disabled) return(0); FORTIFY_LOCK(); if(curr) { sprintf(st_Buffer, "\r\nFortify: Memory Dump at %s.%ld\r\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); sprintf(st_Buffer, "%11s %8s %s\r\n", "Address", "Size", "Allocator"); st_Output(st_Buffer); while(curr) { OutputHeader(curr); count++; size += curr->Size; curr = curr->Next; } sprintf(st_Buffer, "%11s %8ld bytes overhead\r\n", "and", (unsigned long)(count * (sizeof(struct Header) + FORTIFY_BEFORE_SIZE + FORTIFY_AFTER_SIZE))); st_Output(st_Buffer); sprintf(st_Buffer,"%11s %8ld bytes in %d blocks\r\n", "total", size, count); st_Output(st_Buffer); } FORTIFY_UNLOCK(); return(count); } /* Fortify_DumpAllMemory(Scope) - Outputs the entire list of currently * new'd memory within the specified scope. For each new'd block is output * it's Address, Size, the SourceFile and Line that allocated it, a hex dump * of the contents of the memory and an ascii dump of printable characters. * * If there is no memory on the list, this function outputs nothing. * * It returns the number of blocks on the list, unless Fortify has been * disabled, in which case it always returns 0. */ int FORTIFY_STORAGE Fortify_DumpAllMemory(int scope, char *file, unsigned long line) { struct Header *curr = st_Head; int count = 0; unsigned long size = 0; if(st_Disabled) return(0); FORTIFY_LOCK(); while(curr) { if(curr->Scope >= scope) { if(count == 0) { sprintf(st_Buffer, "\r\nFortify: Memory Dump at %s.%ld\r\n", file, line); st_Output(st_Buffer); OutputLastVerifiedPoint(); sprintf(st_Buffer, "%11s %8s %s\r\n", "Address", "Size", "Allocator"); st_Output(st_Buffer); } OutputHeader(curr); OutputMemory(curr); st_Output("\r\n"); count++; size += curr->Size; } curr = curr->Next; } if(count) { sprintf(st_Buffer, "%11s %8ld bytes overhead\r\n", "and", (unsigned long)(count * (sizeof(struct Header) + FORTIFY_BEFORE_SIZE + FORTIFY_AFTER_SIZE))); st_Output(st_Buffer); sprintf(st_Buffer,"%11s %8ld bytes in %d blocks\r\n", "total", size, count); st_Output(st_Buffer); } FORTIFY_UNLOCK(); return(count); } /* * Fortify_Disable() - This function provides a mechanism to disable Fortify * without recompiling all the sourcecode. It can only be called, though, * when there is no memory on the Fortify malloc'd list. (Ideally, at the * start of the program before any memory has been allocated). If you * call this function when there IS memory on the Fortify malloc'd list, * it will issue an error, and fortify will not be disabled. */ int FORTIFY_STORAGE Fortify_Disable(char *file, unsigned long line) { int result; FORTIFY_LOCK(); if(st_Head) { sprintf(st_Buffer, "Fortify: %s.%d\r\n", file, line); st_Output(st_Buffer); st_Output(" Fortify_Disable failed\r\n"); st_Output(" (because there is memory on the Fortify memory list)\r\n"); Fortify_OutputAllMemory(file, line); result = 0; } else { st_Disabled = 1; result = 1; } FORTIFY_UNLOCK(); return(result); } /* * Check a block's header and fortifications. */ static int CheckBlock(struct Header *h, char *file, unsigned long line) { unsigned char *ptr = (unsigned char *)h; int result = 1; if(!IsHeaderValid(h)) { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n Invalid pointer or corrupted header detected (%p)\r\n", file, line, ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE); st_Output(st_Buffer); /* sleep(10); */ OutputLastVerifiedPoint(); return(0); } if(!CheckFortification(ptr + sizeof(struct Header), FORTIFY_BEFORE_VALUE, FORTIFY_BEFORE_SIZE)) { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n Memory overrun detected before block\r\n", file, line); st_Output(st_Buffer); /* sleep(10); */ sprintf(st_Buffer," (%p,%ld,%s.%ld)\r\n", ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, (unsigned long)h->Size, h->File, h->Line); st_Output(st_Buffer); /* sleep(10); */ OutputFortification(ptr + sizeof(struct Header), FORTIFY_BEFORE_VALUE, FORTIFY_BEFORE_SIZE); OutputLastVerifiedPoint(); result = 0; } if(!CheckFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE + h->Size, FORTIFY_AFTER_VALUE, FORTIFY_AFTER_SIZE)) { sprintf(st_Buffer, "\r\nFortify: %s.%ld\r\n Memory overrun detected after block\r\n", file, line); st_Output(st_Buffer); /* sleep(10); */ sprintf(st_Buffer," (%p,%ld,%s.%ld)\r\n", ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, (unsigned long)h->Size, h->File, h->Line); st_Output(st_Buffer); /* sleep(10); */ OutputFortification(ptr + sizeof(struct Header) + FORTIFY_BEFORE_SIZE + h->Size, FORTIFY_AFTER_VALUE, FORTIFY_AFTER_SIZE); OutputLastVerifiedPoint(); result = 0; } return(result); } /* * Checks if the _size_ bytes from _ptr_ are all set to _value_ */ static int CheckFortification(unsigned char *ptr, unsigned char value, size_t size) { while(size--) if(*ptr++ != value) return(0); return(1); } /* * Set the _size_ bytes from _ptr_ to _value_. */ static void SetFortification(unsigned char *ptr, unsigned char value, size_t size) { memset(ptr, value, size); } /* * Output the corrupted section of the fortification */ static void OutputFortification(unsigned char *ptr, unsigned char value, size_t size) { unsigned long offset, column; char ascii[17]; st_Output("Address Offset Data"); offset = 0; column = 0; while(offset < size) { if(column == 0) { sprintf(st_Buffer, "\r\n%8p %8d ", ptr, offset); st_Output(st_Buffer); } sprintf(st_Buffer, "%02x ", *ptr); st_Output(st_Buffer); ascii[ column ] = isprint( *ptr ) ? (char)(*ptr) : (char)(' '); ascii[ column + 1 ] = '\0'; ptr++; offset++; column++; if(column == 16) { st_Output( " \"" ); st_Output( ascii ); st_Output( "\"" ); column = 0; } } if ( column != 0 ) { while ( column ++ < 16 ) { st_Output( " " ); } st_Output( " \"" ); st_Output( ascii ); st_Output( "\"" ); } st_Output("\r\n"); } /* * Returns true if the supplied pointer does indeed point to a real Header */ static int IsHeaderValid(struct Header *h) { return(!ChecksumHeader(h)); } /* * Updates the checksum to make the header valid */ static void MakeHeaderValid(struct Header *h) { h->Checksum = 0; h->Checksum = -ChecksumHeader(h); } /* * Calculate (and return) the checksum of the header. (Including the Checksum * variable itself. If all is well, the checksum returned by this function should * be 0. */ static int ChecksumHeader(struct Header *h) { int c, checksum, *p; for(c = 0, checksum = 0, p = (int *)h; c < sizeof(struct Header)/sizeof(int); c++) checksum += *p++; return(checksum); } /* * Examines the malloc'd list to see if the given header is on it. */ static int IsOnList(struct Header *h) { struct Header *curr; curr = st_Head; while(curr) { if(curr == h) return(1); curr = curr->Next; } return(0); } /* * Hex and ascii dump the memory */ static void OutputMemory(struct Header *h) { OutputFortification((unsigned char*)h + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, 0, h->Size); } /* * Output the header... */ static void OutputHeader(struct Header *h) { sprintf(st_Buffer, "%11p %8ld %s.%ld (%d)\r\n", (unsigned char*)h + sizeof(struct Header) + FORTIFY_BEFORE_SIZE, (unsigned long)h->Size, h->File, h->Line, h->Scope); st_Output(st_Buffer); } static void OutputLastVerifiedPoint() { sprintf(st_Buffer, "\r\nLast Verified point: %s.%ld\r\n", st_LastVerifiedFile, st_LastVerifiedLine); st_Output(st_Buffer); } void *Fortify_m_alloue (unsigned int taille, char *file, unsigned long line) { char *ptr; mem_alloue += (unsigned long) taille; free_use (); if ((tot_mem - (unsigned long) taille) < 10000L) libere_bid (); deb_io (); if ((ptr = Fortify_calloc (1L, (unsigned long) taille, file, line)) == NULL) { fin_io (); err_alloc (taille); } /* free_mem(); */ fin_io (); return (ptr); } void Fortify_m_libere (void *ptr, unsigned int taille, char *file, unsigned long line) { deb_io (); Fortify_free (ptr, file, line); mem_alloue -= (unsigned long) taille; fin_io (); free_use (); } #else /* defined FORTIFY */ void *m_alloue (unsigned int taille) { char *ptr; mem_alloue += (unsigned long) taille; free_use (); if ((tot_mem - (unsigned long) taille) < 10000L) libere_bid (); deb_io (); if ((ptr = calloc (1L, (unsigned long) taille)) == NULL) { fin_io (); err_alloc (taille); } /* free_mem(); */ fin_io (); return (ptr); } void m_libere (void *ptr, unsigned int taille) { deb_io (); free (ptr); mem_alloue -= (unsigned long) taille; fin_io (); free_use (); } #endif /* FORTIFY */ fbb-7.0.10/src/xfbbC.c0000644000175000017500000003506713613360505011245 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /********************************************** * * * xfbbC : Client for xfbbd BBS daemon version * * * **********************************************/ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "terminal.h" #define CONSOLE 0 #define MONITOR 1 /*#define ALLCHAN 2*/ #define BUFFSIZE 1024 #define uchar char static char *usage = "Usage: xfbbC [-c | -m channel] [-d] [-f] [-h hostname] [-p port] [-i mycall] [-w password]\n" "-c : console connection\n" "-d file : download remote configuration file\n" "-f : data filtering. Control characters are discarded\n" "-h address : hostname address of the xfbbd server\n" "-i mycall : callsign used for connection\n" "-m channel : displays a connected channel (0 = all channels)\n" "-p port : IP port number (default 3286)\n" "-r : don't use curses\n" "-l : display remote directory\n" "-s svc_nb : request service number\n" "-u file : upload configuration file\n" "-w password: password of the callsign as defined in passwd.sys\n" "\nEnvironment variables :\n" "\tXFBBC_HOST : hostname (default localhost)\n" "\tXFBBC_PORT : socket port (default 3286)\n" "\tXFBBC_CALL : my callsign\n" "\tXFBBC_PASS : password string of passwd.sys in xfbbd\n\n"; void makekey (char *cle, char *pass, char *buffer); static int open_connection (char *tcp_addr, int tcp_port, int mask) { int sock; struct sockaddr_in sock_addr; struct hostent *phe; if ((sock = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } if ((phe = gethostbyname (tcp_addr)) == NULL) { perror ("gethostbyname"); return (-1); } sock_addr.sin_family = AF_INET; sock_addr.sin_port = htons (tcp_port); memcpy ((char *) &sock_addr.sin_addr, phe->h_addr, phe->h_length); if (connect (sock, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) == -1) { perror ("connect"); close (sock); return (-1); } return (sock); } static int do_filter (char *ptr, int len) { char *scan = ptr; int lg = 0; while (len) { if ((*ptr == '\n') || isprint (*ptr)) scan[lg++] = *ptr; ++ptr; --len; } return (lg); } static int console_send_file(int sock, char *filename) { int fd; int nb; char *buffer; buffer = (char *) (calloc(BUFFSIZE , sizeof(char))); buffer[0] = ORB_REQUEST; buffer[1] = 3; fd = open(filename, O_RDONLY); if (fd == -1) { buffer[2] = 0; buffer[3] = 0; write(sock, buffer, 4); return errno; } for (;;) { nb = read(fd, buffer+4, BUFFSIZE-24); if (nb < 0) nb = 0; buffer[2] = nb % 256; buffer[3] = nb >> 8; write(sock, buffer, nb+4); printf("%d data sent\n", nb); if (nb == 0) break; } close(fd); return 0; } int main (int ac, char *av[]) { char host[80]; char pass[256]; char key[256]; char mycall[80]; char filename[256]; char arg[256]; char *buffer; char *ptr; int len; int s; int nb; int service; int transfer; int filelen = 0; int filetotal; int channel; int sock; int mask = 0; int debug = 0; int filter = 0; int use_curses = 1; int port; int mode; buffer = (char *) (calloc(BUFFSIZE , sizeof(char))); signal(SIGINT,SIG_IGN); /* disable ctrl-C */ signal(SIGQUIT,SIG_IGN); /* disable ctrl-\ */ signal(SIGTSTP,SIG_IGN); /* disable ctrl-Z */ fprintf (stderr, "\nClient application for xfbbd V%s (%s) ( help : xfbbC -? )\n\n", VERSION, __DATE__); if ((ptr = getenv ("XFBBC_HOST"))) strcpy (host, ptr); else strcpy (host, "localhost"); if ((ptr = getenv ("XFBBC_PORT"))) port = atoi (ptr); else port = 3286; if ((ptr = getenv ("XFBBC_PASS"))) strcpy (pass, ptr); else strcpy (pass, "password"); if ((ptr = getenv ("XFBBC_CALL"))) strcpy (mycall, ptr); else strcpy (mycall, "nocall"); channel = 0; mask = ORB_MONITOR; transfer = 0; service = 0; while ((s = getopt (ac, av, "cfd:h:i:l:m:p:rs:u:w:?")) != -1) { switch (s) { case 'h': strcpy (host, optarg); break; case 'd': strcpy (filename, optarg); transfer = SVC_RECV; mask = 0; break; case 'u': strcpy (filename, optarg); transfer = SVC_SEND; mask = 0; break; case 'l': strcpy (filename, optarg); transfer = SVC_DIR; mask = 0; break; case 'f': filter = 1;; break; case 'p': port = atoi (optarg); break; case 'w': strcpy (pass, optarg); break; case 'i': strcpy (mycall, optarg); break; case 'c': mask = ORB_CONSOLE; break; case 'm': channel = atoi (optarg); mask = ORB_CHANNEL; break; case 'r': use_curses = 0; mask = ORB_CONSOLE; break; case 's': service = atoi (optarg); break; case ':': fprintf (stderr, "xfbbC: option needs an argument\n"); return 1; case '?': fprintf (stderr, "%s", usage); return 1; } } if (debug && !transfer) { /* if -d option, ask all services */ mask |= (ORB_MSGS | ORB_STATUS | ORB_NBCNX | ORB_LISTCNX); } fprintf(stderr, "Connecting %s ... ", host); fflush(stdout); sock = open_connection (host, port, mask); if (sock == -1) { fprintf (stderr, "Cannot connect xfbbd\n"); return 0; } fprintf (stderr, " Ok\n"); sprintf (buffer, "%d %d %s\n", mask, channel, mycall); write (sock, buffer, strlen (buffer)); fprintf (stderr, "Authentication in progress ... "); fflush (stderr); nb = read (sock, buffer, 20); if (nb <= 0) { fprintf (stderr, "Connection closed. Terminating\n"); return (0); } buffer[nb] = '\0'; sscanf (buffer, "%s", key); fprintf (stderr, " Ok\n"); makekey (key, pass, buffer); strcat (buffer, "\n"); write (sock, buffer, strlen (buffer)); mode = 0; if (mask & ORB_CONSOLE) { mode = 1; fprintf (stderr, "Console connection ...\n\n"); } if (mask & ORB_CHANNEL) fprintf (stderr, "Monitoring channel %d ... Enter character to Quit\n\n", channel); if (mask & ORB_MONITOR) fprintf (stderr, "Monitoring all ports ... Enter character to Quit\n\n"); if (transfer) { len = strlen(filename); switch(transfer) { case SVC_DIR: fprintf (stderr, "Requesting directory %s ...\n\n", filename); buffer[0] = ORB_REQUEST; buffer[1] = SVC_DIR; buffer[2] = len; buffer[3] = 0; strcpy(buffer+4, filename); write(sock, buffer, len+4); break; case SVC_RECV: fprintf (stderr, "Requesting file %s ...\n\n", filename); buffer[0] = ORB_REQUEST; buffer[1] = SVC_RECV; buffer[2] = len; buffer[3] = 0; strcpy(buffer+4, filename); write(sock, buffer, len+4); break; case SVC_SEND: fprintf (stderr, "Sending file %s ...\n\n", filename); buffer[0] = ORB_REQUEST; buffer[1] = SVC_SEND; buffer[2] = len; buffer[3] = 0; strcpy(buffer+4, filename); write(sock, buffer, len+4); console_send_file(sock, filename); break; } filename[0] = '\0'; filelen = 0; } else if (service) { switch(service) { case SVC_FWD: strcpy(buffer+4, "LIST"); len = 4; fprintf (stderr, "Requesting Pending Forward ...\n\n"); buffer[0] = ORB_REQUEST; buffer[1] = SVC_FWD; buffer[2] = len; buffer[3] = 0; write(sock, buffer, len+4); break; case SVC_DISC: sprintf(buffer+4, "01 F6FBB-1 0"); len = strlen(buffer+4); fprintf (stderr, "Requesting Disconnection ...\n\n"); buffer[0] = ORB_REQUEST; buffer[1] = SVC_DISC; buffer[2] = len; buffer[3] = 0; write(sock, buffer, len+4); break; } } else { sprintf(buffer, " xfbbC V%s (%s) - Callsign : %s - Remote host : %s", VERSION, __DATE__, mycall, host); #ifdef HAVE_NCURSES if (use_curses) init_terminal(mode, buffer); else #endif fprintf (stderr, "%s\n", buffer); } for (;;) { fd_set sock_read; FD_ZERO (&sock_read); FD_SET (STDIN_FILENO, &sock_read); FD_SET (sock, &sock_read); /* Wait for I/O event */ if (select (sock + 1, &sock_read, NULL, NULL, NULL) == -1) { perror ("select"); break; } if (FD_ISSET (STDIN_FILENO, &sock_read)) { #ifdef HAVE_NCURSES if (use_curses) nb = read_terminal(buffer, BUFFSIZE); else { #endif nb = read (STDIN_FILENO, buffer, BUFFSIZE); if (nb == -1) { perror ("read"); break; } #ifdef HAVE_NCURSES } #endif nb = write (sock, buffer, nb); if (nb == -1) { perror ("write"); break; } if (*buffer == 0x1B) { #ifdef HAVE_NCURSES if (use_curses) end_terminal(); #endif close (sock); free (buffer); return (0); } } if (FD_ISSET (sock, &sock_read)) { uchar header[4]; unsigned int service; unsigned int command; unsigned int len; unsigned int total; char *ptr = '\0'; /* Read header first. Be sure the 4 bytes are read */ for (total = 0; total < 4;) { nb = read (sock, header + total, 4 - total); if (nb == -1) { perror ("read"); break; } if (nb == 0) { printf ("Connection closed. Terminating\n"); #ifdef HAVE_NCURSES if (use_curses) end_terminal(); #endif return (0); } total += nb; } service = (unsigned int) header[0]; command = (unsigned int) header[1]; len = ((unsigned int) header[3] << 8) + (unsigned int) header[2]; /* printf("\nservice=%d command=%d len=%d : ", service, command, len); fflush(stdout);*/ /* Read the data following the header. Be sure all bytes are read */ for (total = 0; total < len;) { nb = read (sock, buffer + total, len - total); if (nb == -1) { perror ("read"); break; } if (nb == 0) { printf ("Connection closed. Terminating\n"); #ifdef HAVE_NCURSES if (use_curses) end_terminal(); #endif return (0); } total += nb; } if (total == 0) { return 0; /* end of transfer */ } else { /* decodes and displays the services */ switch (service) { case ORB_CONSOLE: case ORB_MONITOR: case ORB_CHANNEL: if (total > 3) { /* skip color and header information */ total -= 3; ptr = buffer + 3; if (filter) total = do_filter (ptr, total); #ifdef HAVE_NCURSES if (use_curses) write_terminal(ptr, total); else #endif write (1, ptr, total); } break; case ORB_MSGS: { int nbPriv, nbHeld, nbTotal; buffer[total] = '\0'; sscanf (buffer, "%d %d %d", &nbPriv, &nbHeld, &nbTotal); if (debug) printf ("Messages : Priv %d Held %d Total %d\n", nbPriv, nbHeld, nbTotal); } break; case ORB_STATUS: { int MemUsed, MemAvail, Disk1, Disk2; buffer[total] = '\0'; sscanf (buffer, "%d %d %d %d", &MemUsed, &MemAvail, &Disk1, &Disk2); if (debug) printf ("Status : LMemUsed %d GMemUsed %dk Disk1 %dk Disk2 %dk\n", MemUsed, MemAvail, Disk1, Disk2); } break; case ORB_NBCNX: buffer[total] = '\0'; if (debug) printf ("Nb Conn : %s\n", buffer); break; case ORB_LISTCNX: buffer[total] = '\0'; if (debug) printf ("ConnLine :%s\n", buffer); break; case ORB_DATA: switch (command) { case SVC_LIST: /* int i; printf("Implemented services :\n"); for (i = 0 ; i < total ; i++) printf(" %d : %s\n", buffer[i] & 0xff, service_name(buffer[i])); */ break; case SVC_DIR: buffer[total] = '\0'; if (filename[0] == '\0') { filelen = filetotal = 0; strcpy(filename, buffer); sscanf(buffer+strlen(filename)+1, "%d", &filetotal); } else { filelen += total; write(STDOUT_FILENO, buffer, total); } fprintf(stderr, "receiving directory %s %d/%d bytes\n", filename, filelen, filetotal); break; case SVC_RECV: buffer[total] = '\0'; if (filename[0] == '\0') { filelen = filetotal = 0; strcpy(filename, buffer); sscanf(buffer+strlen(filename)+1, "%d", &filetotal); } else { filelen += total; write(STDOUT_FILENO, buffer, total); } fprintf(stderr, "receiving file %s %d/%d bytes\n", filename, filelen, filetotal); break; case SVC_FWD: buffer[total] = '\0'; if (filename[0] == '\0') { filelen = filetotal = 0; *arg = '\0'; sscanf(buffer, "%s %s", filename, arg); sscanf(buffer+strlen(buffer)+1, "%d", &filetotal); if (*arg) fprintf(stderr, "%s : %s\n", filename, arg); } else { filelen += total; write(STDOUT_FILENO, buffer, total); } if (filetotal) fprintf(stderr, "receiving fwd list %s %d/%d bytes\n", filename, filelen, filetotal); break; } break; } } } } close (sock); free (buffer); #ifdef HAVE_NCURSES if (use_curses) end_terminal(); #endif printf ("Abnormal termination\n"); return (1); } #define PROTOTYPES 1 #include "global.h" #include "md5.h" void MD5String (uchar *dest, uchar *source) { int i; MD5_CTX context; uchar digest[16]; unsigned int len = strlen (source); MD5Init (&context); MD5Update (&context, source, len); MD5Final (digest, &context); *dest = '\0'; for (i = 0; i < 16; i++) { char tmp[5]; sprintf (tmp, "%02X", digest[i]); strcat (dest, tmp); } } void makekey (char *cle, char *pass, char *buffer) { char *source; source = (char *) (calloc(BUFFSIZE , sizeof(char))); strcpy (source, cle); strcat (source, pass); MD5String (buffer, source); free (source); } fbb-7.0.10/src/mbl_edit.c0000644000175000017500000004605613613360505012000 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module MBL_EDIT.C */ static void ch_home (ind_noeud *, info *); static void ch_password (ind_noeud *, info *); static void ch_prenom (ind_noeud *, info *); static void ch_private (ind_noeud *, info *); static void ch_zip (ind_noeud *, info *); static void header_edit (void); static void modif_header (void); static void modif_user (info *); static void user_edit (void); static void option_edit (void); static char *lit_ind (char *); static int lit_prenom (void); static int lit_homebbs (void); static int lit_locator (void); static int lit_zip (void); #include "aff_stat.c" int mbl_edit (void) { int error = 0; if (pvoie->niv3 == 0) { switch (toupper (*indd)) { case ' ': ch_niv3 (20); pvoie->typlist = 0; header_edit (); break; case 'O': ch_niv3 (40); option_edit (); break; case 'U': ch_niv3 (0); user_edit (); break; case 'M': if (voiecur == CONSOLE) { ++indd; if ((teste_espace ()) && (*indd) && (*indd == '#' || isdigit (*indd))) { if ((pvoie->nmess = lit_chiffre (1)) != 0L) { if (ch_record (ptmes, pvoie->nmess, '\0')) { reply = 4; pvoie->enrcur = pvoie->nmess; #ifdef __WINDOWS__ if (win_edit () == 5) end_win_edit (); error = 0; #endif #ifdef __linux__ error = 1; #endif #ifdef __FBBDOS__ if (mini_edit () == 5) end_mini_edit (); error = 0; #endif break; } else { ptmes->numero = pvoie->nmess; texte (T_ERR + 10); } } else texte (T_ERR + 3); } else texte (T_ERR + 3); retour_mbl (); } else error = 1; break; default: /* varx[0][0] = 'E' ; strn_cpy(79, varx[0] + 1, indd) ; texte(T_ERR + 1) ; retour_mbl() ; */ error = 1; break; } } else { if (*indd) indd[strlen (indd) - 1] = '\0'; switch (pvoie->niv3 / 20) { case 0: user_edit (); break; case 1: header_edit (); break; case 2: option_edit (); break; } } return (error); } static void option_display(void) { char buf[80]; int i; i = sprintf(buf, "System Options : "); buf[i++] = (bip) ? 'B' : '.'; buf[i++] = (gate) ? 'G' : '.'; buf[i++] = (sed) ? 'M' : '.'; buf[i++] = (ok_tell) ? 'T' : '.'; buf[i++] = (aff_inexport) ? 'X' : '.'; buf[i++] = (aff_popsmtp) ? 'P' : '.'; buf[i] = '\0'; outln(buf, strlen(buf)); sprintf(buf, "(B)eep, (T)alk, (G)ateway, (M)sgEdit, e(X)port, (P)opSmtp : "); out(buf, strlen(buf)); } static void option_edit (void) { int ok; switch (pvoie->niv3) { case 40: option_display(); ch_niv3 (41); break; case 41: if (*indd) { ok = 1; if (islower(*indd)) *indd = toupper(*indd); switch (*indd) { case 'B' : bip = !bip; break; case 'G' : gate = !gate; break; case 'M' : sed = !sed; break; case 'T' : ok_tell = !ok_tell; break; case 'X' : aff_inexport = !aff_inexport; break; case 'P' : aff_popsmtp = !aff_popsmtp; break; default : texte (T_ERR + 0); ok = 0; break; } if (ok) maj_options(); option_display(); } else retour_mbl (); break; } } static void header_edit (void) { switch (pvoie->niv3) { case 20: if ((teste_espace ()) && (*indd) && (*indd == '#' || isdigit (*indd))) { if ((pvoie->nmess = lit_chiffre (1)) != 0L) { if (ch_record (ptmes, pvoie->nmess, '\0')) { entete_liste (); aff_status (ptmes); texte (T_MBL + 39); texte (T_MBL + 27); ch_niv3 (21); break; } else { ptmes->numero = pvoie->nmess; texte (T_ERR + 10); } } else texte (T_ERR + 3); } else texte (T_ERR + 3); retour_mbl (); break; case 21: if (*indd) { modif_header (); entete_liste (); aff_status (ptmes); texte (T_MBL + 39); texte (T_MBL + 27); } else retour_mbl (); break; } } static void modif_header (void) { char c; int i; char *sptr; unsigned num_indic; ind_noeud *noeud; while_space (); c = toupper (*indd); incindd (); switch (c) { case 'T': /* Desti */ if ((sptr = lit_ind (indd)) != NULL) { noeud = insnoeud (ptmes->desti, &num_indic); if (ptmes->status == 'N') --(noeud->nbnew); --(noeud->nbmess); strcpy (ptmes->desti, sptr); ptmes->status = 'N'; maj_rec (pvoie->nmess, ptmes); num_indic = insarbre (ptmes); chg_mess (num_indic, ptmes->numero); ins_iliste (ptmes); } else texte (T_ERR + 0); break; case 'V': /* Via */ if (*indd) { if (*indd == '.') *ptmes->bbsv = '\0'; else strn_cpy (39, ptmes->bbsv, indd); clear_fwd (ptmes->numero); for (i = 0; i < NBMASK; i++) { ptmes->forw[i] = ptmes->fbbs[i] = '\0'; } if (ptmes->type == 'B') ptmes->status = '$'; else { if (ptmes->status != 'N') { /* increment counter of new messages */ noeud = insnoeud (ptmes->desti, &num_indic); ++(noeud->nbnew); aff_msg_cons (); } ptmes->status = 'N'; } if (*ptmes->bbsv) { swapp_bbs (ptmes); if (cherche_route (ptmes)) { texte (T_MBL + 41); } if (test_forward (1)) ins_fwd (ptmes); cr (); } maj_rec (pvoie->nmess, ptmes); } break; case 'F': /* Exped */ if (*indd) { if ((sptr = lit_ind (indd)) != NULL) { strcpy (ptmes->exped, sptr); maj_rec (pvoie->nmess, ptmes); } else texte (T_ERR + 0); } break; case 'I': /* Titre */ if (*indd) { n_cpy (60, ptmes->titre, indd); maj_rec (pvoie->nmess, ptmes); } break; case 'Y': /* Type */ if (*indd) { *indd = toupper (*indd); if (*indd == 'A' || *indd == 'B' || *indd == 'P' || *indd == 'T') { ptmes->type = *indd; maj_rec (pvoie->nmess, ptmes); } else texte (T_ERR + 0); } break; case 'B': /* Bid */ if (*indd) { strn_cpy (12, ptmes->bid, indd); maj_rec (pvoie->nmess, ptmes); } break; case 'S': /* Status */ if (*indd) { *indd = toupper (*indd); noeud = insnoeud (ptmes->desti, &num_indic); if ((ptmes->status == 'N') && (*indd != 'N')) { --(noeud->nbnew); } else if ((ptmes->status != 'N') && (*indd == 'N')) { ++(noeud->nbnew); } if ((ptmes->status != 'A') && (ptmes->status != 'K') && ((*indd == 'A') || (*indd == 'K'))) { --(noeud->nbmess); chg_mess (0xffff, ptmes->numero); } else if (((ptmes->status == 'A') || (ptmes->status == 'K')) && (*indd != 'A') && (*indd != 'K')) { ++(noeud->nbmess); chg_mess (num_indic, ptmes->numero); } if (*indd == 'Y' || *indd == 'F' || *indd == 'N' || *indd == '$' || *indd == 'K' || *indd == 'A') { ptmes->status = *indd; /* if (ptmes->status == 'H') { for (i = 0 ; i < NBMASK ; i++) ptmes->fbbs[i] = '\0'; } */ maj_rec (pvoie->nmess, ptmes); aff_msg_cons (); } else texte (T_ERR + 0); } break; default: /* Erreur */ texte (T_ERR + 0); break; } } void ch_info (void) { FILE *fptr; unsigned r = pvoie->ncur->coord; if (r == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) r) * ((long) sizeof (info)), 0); fwrite ((char *) &(pvoie->finf), (int) sizeof (info), 1, fptr); ferme (fptr, 19); } static char *lit_ind (char *indic) { while ((*indic) && (!ISGRAPH (*indic))) ++indic; strupr (indic); if (strlen (indic) > 6) return (NULL); return (indic); } int tstqra (qra) char *qra; { if (strlen (qra) == 6) return (isalpha (qra[0]) && isalpha (qra[1]) && isdigit (qra[2]) && isdigit (qra[3]) && isalpha (qra[4]) && isalpha (qra[5])); else return (0); } static int lit_locator (void) { char s[80]; if (ISGRAPH (*indd)) { strupr (epure (s, 6)); if ((*s == '.') || tstqra (s)) { if (*s == '.') { s[0] = '?'; s[1] = '\0'; } strcpy (pvoie->finf.qra, s); return (2); } else { texte (T_NOM + 14); } } return (1); } static int lit_zip (void) { char s[80]; if (ISGRAPH (*indd)) { strupr (epure (s, 8)); if (*s == '.') *s = '\0'; strcpy (pvoie->finf.zip, s); user_wp (&pvoie->finf); /* pvoie->wp = 1; */ return (2); } return (1); } static int lit_qth (void) { char s[80]; if (ISGRAPH (*indd)) { epure (s, 30); if (*s == '.') *s = '\0'; strcpy (pvoie->finf.ville, s); user_wp (&pvoie->finf); /* pvoie->wp = 1; */ return (2); } return (1); } static int lit_homebbs (void) { char s[80]; char temp[80]; char *ptr; if (ISGRAPH (*indd)) { strupr (epure (s, 40)); if (*s == '.') *s = '\0'; /* Seul l'indicatif est enregistre */ ptr = strchr (s, '.'); if (ptr) *ptr = '\0'; /* Pas de SSID */ ptr = strchr (s, '-'); if (ptr) *ptr = '\0'; strcpy (temp, s); if (find (temp)) { /* Seul l'indicatif est enregistre */ strcpy (pvoie->finf.home, s); user_wp (&pvoie->finf); /* pvoie->wp = 1; */ return (2); } else texte (T_ERR + 7); } return (1); } static int lit_prenom (void) { info frec; if (ISGRAPH (*indd)) { ch_prenom (pvoie->ncur, &frec); strcpy (pvoie->finf.prenom, frec.prenom); return (2); } return (1); } int mbl_name (void) { int modif = 0; int error = 0; switch (pvoie->niv3) { case 0: if (toupper (*indd) == 'P') { int p = no_port (voiecur); if ((p_port[p].typort == TYP_MOD) || (p_port[p].typort == TYP_TCP)) { if (read_only ()) { modif = 1; break; } out ("Enter old password :", 20); maj_niv (N_MOD, 3, 0); } else error = 1; } else if (toupper (*indd) == 'L') { if (read_only ()) { modif = 1; break; } ++indd; if (teste_rep (sup_ln (indd))) { incindd (); modif = lit_locator (); } else { texte (T_NOM + 11); ch_niv3 (2); } } else if (toupper (*indd) == 'Q') { if (read_only ()) { modif = 1; break; } ++indd; if (teste_rep (sup_ln (indd))) { incindd (); modif = lit_qth (); } else { texte (T_NOM + 8); ch_niv3 (5); } } else if (toupper (*indd) == 'Z') { if (read_only ()) { modif = 1; break; } ++indd; if (teste_rep (sup_ln (indd))) { incindd (); modif = lit_zip (); } else { texte (T_MBL + 54); ch_niv3 (3); } } else if (toupper (*indd) == 'H') { if (read_only ()) { modif = 1; break; } ++indd; if (teste_rep (sup_ln (indd))) { incindd (); modif = lit_homebbs (); } else { texte (T_MBL + 53); ch_niv3 (4); } } else if (!ISGRAPH (*indd)) { if (read_only ()) { modif = 1; break; } if (teste_rep (sup_ln (indd))) { incindd (); modif = lit_prenom (); } else { texte (T_MBL + 9); ch_niv3 (1); } } else error = 1; break; case 1: modif = lit_prenom (); break; case 2: modif = lit_locator (); break; case 3: modif = lit_zip (); break; case 4: modif = lit_homebbs (); break; case 5: modif = lit_qth (); break; } if (modif) { if (modif == 2) { ch_info (); texte (T_MBL + 10); } retour_mbl (); } return (error); } static void ch_private (ind_noeud * noeud, info * frec) { FILE *fptr; fptr = ouvre_nomenc (); if (noeud->coord == 0xffff) dump_core (); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fread (frec, sizeof (info), 1, fptr); /* strupr (indd); */ if (!iscntrl (*indd)) { if (*indd == '.') *indd = '\0'; epure (frec->priv, 12); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fwrite (frec, sizeof (info), 1, fptr); } ferme (fptr, 36); } static void ch_home (ind_noeud * noeud, info * frec) { char *ptr; char temp[80]; FILE *fptr; if (noeud->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fread (frec, sizeof (info), 1, fptr); if (!iscntrl (*indd)) { strupr (indd); if (*indd == '.') *indd = '\0'; ptr = strchr (indd, '.'); if (ptr) *ptr = '\0'; ptr = strchr (indd, '-'); if (ptr) *ptr = '\0'; strn_cpy (40, temp, indd); if (find (temp)) { epure (frec->home, 40); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fwrite (frec, sizeof (info), 1, fptr); user_wp (frec); /* pvoie->wp = 1; */ } else texte (T_ERR + 7); } ferme (fptr, 36); } static void ch_zip (ind_noeud * noeud, info * frec) { FILE *fptr; char *scan; if (noeud->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fread (frec, sizeof (info), 1, fptr); strupr (indd); if (!iscntrl (*indd)) { if (*indd == '.') *indd = '\0'; epure (frec->zip, 8); scan = frec->zip; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fwrite (frec, sizeof (info), 1, fptr); user_wp (frec); /* pvoie->wp = 1; */ } ferme (fptr, 36); } static void ch_password (ind_noeud * noeud, info * frec) { FILE *fptr; if (noeud->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fread (frec, sizeof (info), 1, fptr); strupr (indd); if (!iscntrl (*indd)) { if (*indd == '.') *indd = '\0'; epure (frec->pass, 12); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fwrite (frec, sizeof (info), 1, fptr); } ferme (fptr, 36); } static void ch_prenom (ind_noeud * noeud, info * frec) { FILE *fptr; char *scan; if (noeud->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fread (frec, sizeof (info), 1, fptr); if (!iscntrl (*indd)) { if (*indd == '.') *indd = '\0'; epure (frec->prenom, 12); scan = frec->prenom; while (*scan) { if (*scan == ' ') *scan = '-'; ++scan; } fseek (fptr, ((long) noeud->coord * sizeof (info)), 0); fwrite (frec, sizeof (info), 1, fptr); user_wp (frec); /* pvoie->wp = 1; */ } ferme (fptr, 36); } static void user_edit (void) { int voie; char s[80]; char *ind, *ptr; indicat indic; unsigned num_indic; FILE *fptr; info frec; sup_ln (indd); switch (pvoie->niv3) { case 0: ++indd; if ((teste_espace ()) && (*indd) && find (indd)) { /* if (num_voie(indd) != -1) { texte(T_MBL + 24) ; retour_mbl() ; break ; } */ pvoie->emis = insnoeud (indd, &num_indic); if (pvoie->emis->coord == 0xffff) { var_cpy (0, indd); texte (T_MBL + 29); } else { fptr = ouvre_nomenc (); fseek (fptr, (long) pvoie->emis->coord * sizeof (frec), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 39); texte (T_MBL + 11); affiche_user (&frec, 1); var_cpy (0, indd); texte (T_MBL + 30); } ch_niv3 (1); break; } else texte (T_ERR + 7); retour_mbl (); break; case 1: if (toupper (*indd) == Oui) { if (pvoie->emis->coord == 0xffff) { pvoie->emis->coord = rinfo++; /* cprintf("Rinfo : %ld\r\n", rinfo) ; */ ind = s; ptr = pvoie->emis->indic; pvoie->emis->val = 1; /* *ind++ = *ptr++; if (pvoie->emis->lettre) *ind++ = pvoie->emis->lettre ; */ while ((*ind++ = *ptr++) != '\0'); indic.num = extind (s, indic.call); init_info (&frec, &indic); if (pvoie->emis->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, (long) pvoie->emis->coord * ((long) sizeof (info)), 0); fwrite ((char *) &frec, (int) sizeof (info), 1, fptr); ferme (fptr, 40); texte (T_MBL + 11); affiche_user (&frec, 1); texte (T_MBL + 28); ch_niv3 (2); break; } else { if (pvoie->emis->coord == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, (long) pvoie->emis->coord * ((long) sizeof (info)), 0); fread ((char *) &frec, sizeof (info), 1, fptr); *(frec.indic.call) = '\0'; fseek (fptr, (long) pvoie->emis->coord * ((long) sizeof (info)), 0); fwrite ((char *) &frec, (int) sizeof (info), 1, fptr); ferme (fptr, 41); pvoie->emis->coord = 0xffff; retour_mbl (); } } else { if (pvoie->emis->coord == 0xffff) retour_mbl (); else { texte (T_MBL + 28); ch_niv3 (2); } } break; case 2: if (*indd) { fptr = ouvre_nomenc (); fseek (fptr, (long) pvoie->emis->coord * sizeof (frec), 0); fread (&frec, sizeof (info), 1, fptr); ferme (fptr, 39); modif_user (&frec); texte (T_MBL + 11); affiche_user (&frec, 1); texte (T_MBL + 28); for (voie = 0; voie < NBVOIES; ++voie) { if (svoie[voie]->sta.connect && indcmp (svoie[voie]->sta.indicatif.call, frec.indic.call)) { svoie[voie]->finf = frec; } } } else retour_mbl (); break; } } static void modif_user (info * frec) { char c; while_space (); c = toupper (*indd); incindd (); switch (c) { case 'B': ch_bit (pvoie->emis, frec, F_BBS, '\0'); break; case 'E': ch_bit (pvoie->emis, frec, F_EXC, '\0'); break; case 'G': if (isdigit (*indd)) { ch_language (atoi (indd), pvoie->emis, frec); } break; case 'F': ch_bit (pvoie->emis, frec, F_PMS, '\0'); break; case 'H': ch_home (pvoie->emis, frec); break; case 'I': ch_bit (pvoie->emis, frec, F_NEW, '\0'); break; case 'L': ch_bit (pvoie->emis, frec, F_LOC, '\0'); break; case 'M': ch_bit (pvoie->emis, frec, F_MOD, '\0'); break; case 'N': ch_prenom (pvoie->emis, frec); break; case 'P': ch_bit (pvoie->emis, frec, F_PAG, '\0'); break; case 'R': ch_bit (pvoie->emis, frec, F_PRV, '\0'); break; case 'S': ch_bit (pvoie->emis, frec, F_SYS, '\0'); break; case 'U': ch_bit (pvoie->emis, frec, F_UNP, '\0'); break; case 'V': ch_private (pvoie->emis, frec); break; case 'W': ch_password (pvoie->emis, frec); break; case 'X': ch_bit (pvoie->emis, frec, F_EXP, '\0'); break; case 'Z': ch_zip (pvoie->emis, frec); break; default: /* Erreur */ texte (T_ERR + 0); break; } } void maj_rec (long nomess, bullist * pbul) { mess_noeud *mptr = findmess (nomess); if (mptr) { ouvre_dir (); /********* Test overflow ********** if ((long) mptr->noenr > maxrec) exit_prg(-1901); ********** Fin du test ***********/ write_dir (mptr->noenr, pbul); ferme_dir (); } } fbb-7.0.10/src/trait.c0000644000175000017500000005735213657545532011362 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * TRAIT.C * */ #include #include static int cross_connexion (void); static int dde_prenom (void); static void accueil (void); static void aff_new_message (void); static void arret_serveur (char *, int); static void inconnu (void); static void insere_info (int); static void majrelai (int); static void majstat (int); static void menu_serveur (int, int); static void mess_cross_connect (void); static void pont (void); /* * PROCEDURES GENERALES A TOUS LES NIVEAUX * AIDE EN LIGNE - ECHANGE DE MESSAGES */ #define AIDE -1 int defaut (void) { int i, sum_call; switch (toupper (*indd)) { case '?': case 'H': ++indd; if (ISPRINT (*indd)) { while (isspace (*indd)) ++indd; help (indd); } else prompt (AIDE, pvoie->niv1); break; case '#': texte (T_MBL + 8); prompt (pvoie->finf.flags, pvoie->niv1); break; case '!': q_mark (); prompt (pvoie->finf.flags, pvoie->niv1); break; case '>': if (pvoie->read_only) return (0); pont (); prompt (pvoie->finf.flags, pvoie->niv1); break; case '=': if (pvoie->read_only) return (0); pvoie->sniv1 = pvoie->niv1; pvoie->sniv2 = pvoie->niv2; pvoie->sniv3 = pvoie->niv3; maj_niv (0, 4, 0); if (!cross_connexion ()) { maj_niv (pvoie->sniv1, pvoie->sniv2, pvoie->sniv3); prompt (pvoie->finf.flags, pvoie->niv1); } break; case '%': mbl_stat (); retour_menu (pvoie->niv1); break; case '/': incindd (); if (isdigit (*indd)) { i = 0; sum_call = 0; while (isalnum (mycall[i])) sum_call += (int) mycall[i++]; if (atoi (indd) == sum_call) { pvoie->sniv1 = pvoie->niv1; pvoie->sniv2 = pvoie->niv2; pvoie->sniv3 = pvoie->niv3; maj_niv (0, 3, 2); while (isdigit (*indd)) ++indd; arret_serveur (d_disque ("ETAT.SYS"), FALSE); } else { texte (T_ERR + 0); prompt (pvoie->finf.flags, pvoie->niv1); } } else { if (droits (CMDRESET)) { pvoie->sniv1 = pvoie->niv1; pvoie->sniv2 = pvoie->niv2; pvoie->sniv3 = pvoie->niv3; maj_niv (0, 3, 0); arret_serveur (d_disque ("ETAT.SYS"), TRUE); } else { texte (T_ERR + 0); prompt (pvoie->finf.flags, pvoie->niv1); } } break; default: return (0); } return (1); } static int ok_break (int voie) { return ((svoie[voie]->niv3 == 0) && (svoie[voie]->niv1 != N_DOS) && (svoie[voie]->niv1 != N_FORW) && (svoie[voie]->niv1 != N_TELL) && (svoie[voie]->niv1 != N_CONF) && (svoie[voie]->niv1 != N_GATE) && (svoie[voie]->niv1 != N_YAPP) && (!FOR (svoie[voie]->mode))); } static int convers (int voie) { return ((svoie[voie]->niv1 == 0) && (svoie[voie]->niv2 == 4) && (svoie[voie]->niv3 == 1)); } int cross_connexion (void) { int voie_exp, voie_dest; char temp[20]; int i = 0; switch (pvoie->niv3) { case 0: ++indd; while (!ISGRAPH (*indd)) ++indd; while (isalnum (*indd)) { if (i < 10) temp[i++] = *indd; ++indd; } temp[i] = '\0'; while (*indd && (!ISGRAPH (*indd))) ++indd; if (find (temp)) { if ((voie_dest = num_voie (temp)) != -1) { if ((!FOR (svoie[voie_dest]->mode)) && (svoie[voie_dest]->cross_connect == -1) && (svoie[voie_dest]->kiss == -1)) { pvoie->cross_connect = voie_dest; svoie[voie_dest]->cross_connect = voiecur; if (ok_break (voie_dest)) { if (voie_dest != voiecur) { svoie[voie_dest]->sniv1 = svoie[voie_dest]->niv1; svoie[voie_dest]->sniv2 = svoie[voie_dest]->niv2; svoie[voie_dest]->sniv3 = svoie[voie_dest]->niv3; voie_exp = voiecur; selvoie (voie_dest); maj_niv (0, 4, 1); selvoie (voie_exp); } mess_cross_connect (); } else texte (T_TRT + 0); maj_niv (0, 4, 1); return (TRUE); } else texte (T_TRT + 1); } else { var_cpy (0, temp); texte (T_TRT + 2); } } else texte (T_ERR + 0); return (FALSE); case 1: voie_dest = pvoie->cross_connect; if (voie_dest >= 0) { voie_exp = voiecur; selvoie (voie_dest); if (!pvoie->sta.connect) { svoie[voie_exp]->cross_connect = pvoie->cross_connect = -1; } else { if (*indd) { if (*indd == CTRLZ) { svoie[voie_exp]->cross_connect = pvoie->cross_connect = -1; if ((pvoie->niv1 == svoie[voie_exp]->niv1) && (pvoie->niv2 == svoie[voie_exp]->niv2) && (pvoie->niv3 == svoie[voie_exp]->niv3)) { maj_niv (pvoie->sniv1, pvoie->sniv2, pvoie->sniv3); texte (T_TRT + 4); prompt (pvoie->finf.flags, pvoie->niv1); } /* break ; */ } else if (convers (voie_dest)) { outs (indd, strlen (indd)); } } } selvoie (voie_exp); } if ((voie_dest != voiecur) && (pvoie->cross_connect == -1)) { texte (T_TRT + 4); maj_niv (pvoie->sniv1, pvoie->sniv2, pvoie->sniv3); prompt (pvoie->finf.flags, pvoie->niv1); } break; } return (TRUE); } static void arret_serveur (char *fich_etat, int typ) { FILE *file_ptr; long caltemps; while ((*indd) && (!ISGRAPH (*indd))) indd++; switch (toupper (*indd)) { case 'A': /* Stop */ arret = TRUE; texte (T_TRT + 9); send_buf (voiecur); maintenance (); #ifdef __FBBDOS__ exit (4); #else fbb_quit (4); #endif break; case 'K': /* Maintenance */ texte (T_TRT + 9); house_keeping (); break; case 'L': /* Re-Run, wait till all users have disconnected */ texte (T_TRT + 9); save_fic = 1; #ifdef __FBBDOS__ affich_logo (W_DEFL); #endif time (&caltemps); stop_min = minute (caltemps); set_busy (); type_sortie = 2; break; case 'M': /* Immediate Re-run */ texte (T_TRT + 9); aff_etat ('E'); send_buf (voiecur); attend_caractere (1); maintenance (); exit (2); case 'R': /* Stop */ if ((file_ptr = fopen (fich_etat, "r+t")) == NULL) fbb_error (ERR_OPEN, fich_etat, 1); else { fseek (file_ptr, 64L, 0); fprintf (file_ptr, "Reset demande par %s-%c le %s\n", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, strdate (time (&caltemps))); ferme (file_ptr, 52); } texte (T_TRT + 10); maintenance (); /* reboot serveur */ #ifdef __linux__ exit (6); #endif #ifdef __WINDOWS__ ExitWindows (EW_REBOOTSYSTEM, 0); #endif #ifdef __FBBDOS__ reset (); #endif break; default: cmd_err (indd); break; } maj_niv (pvoie->sniv1, pvoie->sniv2, pvoie->sniv3); prompt (pvoie->finf.flags, pvoie->niv1); } static void pont (void) { int voie_exp, voie_dest; char temp[20]; int i = 0; ++indd; while (!ISGRAPH (*indd)) ++indd; while (isalnum (*indd)) { if (i < 10) temp[i++] = *indd; ++indd; } temp[i] = '\0'; while (*indd && (!ISGRAPH (*indd))) ++indd; if (find (temp)) { if (*indd) { if ((voie_dest = num_voie (temp)) != -1) { if (ok_break (voie_dest)) { voie_exp = voiecur; selvoie (voie_dest); /* Ajout */ var_cpy (0, svoie[voie_exp]->sta.indicatif.call); texte (T_TRT + 5); outs (indd, strlen (indd)); cr_cond (); texte (T_TRT + 6); selvoie (voie_exp); /* Ajout */ var_cpy (0, svoie[voie_dest]->sta.indicatif.call); texte (T_TRT + 7); } else { texte (T_TRT + 1); } } else { var_cpy (0, temp); texte (T_TRT + 2); } } else texte (T_ERR + 4); } else texte (T_ERR + 0); } static void mess_cross_connect (void) { int voie_dest, voie_exp; voie_dest = pvoie->cross_connect; var_cpy (0, svoie[voie_dest]->sta.indicatif.call); texte (T_TRT + 3); if (voie_dest != voiecur) { voie_exp = voiecur; selvoie (voie_dest); var_cpy (0, svoie[voie_exp]->sta.indicatif.call); texte (T_TRT + 3); selvoie (voie_exp); } } static void menu_serveur (int typ_aide, int pos) { if (typ_aide != AIDE) texte (pos); else { if (droits (MODLABEL)) texte (pos + 1); texte (pos + 2); } } static void aff_new_message (void) { if (pvoie->ncur->nbnew) { itoa (pvoie->ncur->nbnew, varx[0], 10); if (strcmp (pvoie->ncur->indic, "MODEM") != 0) texte (T_MES + 10); } } void prompt (int typ_aide, int niveau) { if ((pvoie->niv1 != N_TELL) && (pvoie->cross_connect != -1)) { mess_cross_connect (); pvoie->sniv1 = pvoie->niv1; pvoie->sniv2 = pvoie->niv2; pvoie->sniv3 = pvoie->niv3; maj_niv (0, 4, 1); return; } if (pvoie->ptemp) { m_libere ((char *) pvoie->ptemp, pvoie->psiz); pvoie->ptemp = NULL; pvoie->psiz = 0; } pvoie->sr_mem = 0; switch (niveau) { case N_MENU: menu_serveur (typ_aide, T_MEN); break; case N_QRA: menu_serveur (typ_aide, T_QRA); break; case N_STAT: menu_serveur (typ_aide, T_STA); break; case N_INFO: doc_path (); menu_serveur (typ_aide, T_INF); break; case N_NOMC: menu_serveur (typ_aide, T_NOM); break; case N_TRAJ: menu_serveur (typ_aide, T_TRJ); break; case N_DOS: prompt_dos (); break; case N_TELL: if (pvoie->niv3 == 1) texte (T_GAT + 1); else texte (T_GAT + 4); break; default: if (FOR (pvoie->mode)) texte (T_MBL + 43); else if (BBS (typ_aide)) texte (T_MBL + 0); else if (EXP (typ_aide) || P_BBS (voiecur)) { aff_new_message (); texte (T_MBL + 0); } else if (LOC (typ_aide) || SYS (typ_aide)) { aff_new_message (); texte (T_MBL + 2); } else if (P_GUEST (voiecur)) { aff_new_message (); texte (T_MBL + 1); } else { aff_new_message (); texte (T_MBL + 2); } break; } pvoie->maj_ok = 1; } char *epure (infptr, len) char *infptr; int len; { char *ptr = infptr; *infptr = '\0'; while ((*indd) && (len)) { if (*indd == ' ') { while (*indd == ' ') indd++; *infptr++ = ' '; --len; } else if (!iscntrl (*indd)) { *infptr++ = *indd++; --len; } else ++indd; } if (*(infptr - 1) == ' ') --infptr; *infptr = '\0'; return (ptr); } /* * ENTETE - ACCUEIL SUR LE SERVEUR */ static char s_langue (char *indic) { char chaine[300]; char ligne[81]; char *ptr, *ind; int ok, niv, val, cpt, nbc; FILE *fptr; if ((fptr = fopen (c_disque ("LANGUE.SYS"), "rt")) == NULL) return ('\0'); ok = cpt = nbc = val = niv = 0; while (fgets (ligne, 80, fptr)) { if (*ligne == '#') continue; switch (niv) { case 0: if (isdigit (*ligne)) { nbc = atoi (ligne); } ++niv; break; case 1: if (++cpt == nbc) ++niv; break; case 2: sscanf (ligne, "%s %d", chaine, &val); val--; ptr = chaine; ind = indic; while (*ptr == *ind) { ++ptr; ++ind; } if (*ptr == '*') ok = 1; else val = 0; break; } if (ok) break; } fclose (fptr); return ((char) val); } void init_info (info * frec, indicat * indicatif) { memset ((char *) frec, '\0', sizeof (info)); strcpy (frec->indic.call, indicatif->call); frec->indic.num = indicatif->num; strcpy (frec->qra, "?"); frec->flags = def_mask; frec->nbl = 20; frec->lang = s_langue (indicatif->call); frec->hcon = time (NULL); frec->lastmes = nomess - 20L; } static int wp_val (int lg, char *field_info, char *wp_value) { char *value; value = (*wp_value == '?') ? "\0" : wp_value; if (*value) n_cpy (lg, field_info, value); else if ((*field_info) && (*field_info != '?')) { return (1); } return (0); } int maj_with_wp (int voie) { Wps *rec; int ok = 0; if (EMS_WPG_OK ()) { if ((rec = wp_find (svoie[voie]->sta.indicatif.call, 1)) != NULL) { ok += wp_val (12, svoie[voie]->finf.prenom, rec->name); ok += wp_val (30, svoie[voie]->finf.ville, rec->first_qth); ok += wp_val (8, svoie[voie]->finf.zip, rec->first_zip); ok += wp_val (40, svoie[voie]->finf.home, rec->first_homebbs); } else { ok = 1; } if (ok) user_wp (&svoie[voie]->finf); return (1); } return (0); } int nouveau (int voie) { int new; FILE *fptr; /* vptr->wp = 0; */ if (svoie[voie]->ncur->coord == 0xffff) { new = 1; /* creer le message d'accueil */ init_info (&svoie[voie]->finf, &svoie[voie]->sta.indicatif); if (find (svoie[voie]->sta.indicatif.call)) { svoie[voie]->ncur->coord = rinfo++; insere_info (voie); } } else { new = 0; fptr = ouvre_nomenc (); fseek (fptr, svoie[voie]->ncur->coord * ((long) sizeof (info)), 0); fread ((char *) &(svoie[voie]->finf), (int) sizeof (info), 1, fptr); ferme (fptr, 18); } maj_with_wp (voie); return (new); } static void inconnu (void) { itoa (pvoie->ncur->nbnew, varx[0], 10); texte (T_MES + 9); } static int dde_prenom (void) { if (info_ok) { pvoie->sniv1 = pvoie->niv1; pvoie->sniv2 = pvoie->niv2; pvoie->sniv3 = pvoie->niv3; maj_niv (N_NOMC, 5, 0); saisie_infos (); return (0); } else { if (*pvoie->finf.prenom == '\0') texte (T_MES + 3); if (*pvoie->finf.ville == '\0') texte (T_MES + 4); if (*pvoie->finf.home == '\0') texte (T_MES + 5); if (*pvoie->finf.zip == '\0') texte (T_MES + 6); return (1); } } void finentete (void) { char s[80]; struct stat bufstat; memset(&bufstat, 0x00, sizeof(struct stat)); sprintf (s, "LANG\\%s.ENT", nomlang + nlang * LG_LANG); outfich (c_disque (s)); /* fprintf (stderr, "%s\n", c_disque(s));*/ sprintf (s, "LANG\\%s.NEW", nomlang + nlang * LG_LANG); if ((stat (c_disque (s), &bufstat) == 0) && (bufstat.st_ctime != pvoie->finf.newbanner)) { pvoie->finf.newbanner = bufstat.st_ctime; outfich (c_disque (s)); } /* fprintf (stderr, "%s\n", c_disque(s));*/ if ((pvoie->ncur->nbmess) && (strcmp (pvoie->ncur->indic, "MODEM") != 0)) { if (pvoie->ncur->nbnew) { if (NEW (pvoie->finf.flags)) { cr (); pvoie->typlist = 0; list_messages (1, pvoie->no_indic, 0); cr (); } } else { itoa (pvoie->ncur->nbmess, varx[0], 10); texte (T_MES + 11); } } if ((nb_hold) && (droits_2 (COSYSOP))) { var_cpy (0, itoa (nb_hold, s, 10)); texte (T_MBL + 57); } } static void insere_info (int voie) { FILE *fptr; unsigned r; if (svoie[voie]->ncur) { r = svoie[voie]->ncur->coord; if (r == 0xffff) dump_core (); fptr = ouvre_nomenc (); fseek (fptr, ((long) r) * ((long) sizeof (info)), 0); fwrite ((char *) &(svoie[voie]->finf), (int) sizeof (info), 1, fptr); inscoord (r, &(svoie[voie]->finf), svoie[voie]->ncur); ferme (fptr, 19); } } int accept_cnx (void) { static int test_connect = 2; int retour = 1; int ret; char s[256]; indd[80] = '\0'; if (test_connect) { char buffer[1024]; *buffer = '\0'; #ifdef __linux__ sprintf (s, "./c_filter %s-%d %d %u %d %d %d", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv3, pvoie->finf.flags, new_om, pvoie->ncur->coord, no_port (voiecur)); ret = filter (s, buffer, sizeof (buffer), sup_ln (indd), FILTDIR); #else sprintf (s, "c_filter %s-%d %d %u %d %d %d", pvoie->sta.indicatif.call, pvoie->sta.indicatif.num, pvoie->niv3, pvoie->finf.flags, new_om, pvoie->ncur->coord, no_port (voiecur)); ret = filter (s, buffer, sizeof (buffer), sup_ln (indd), NULL); #endif buffer[1023] = '\0'; if (*buffer) out (buffer, strlen (buffer)); switch (ret) { case -1: if (test_connect == 2) { /* premiere fois ... Pas de C_FILTER trouve */ test_connect = 0; } else { /* Le C_FILTER a retourne -1 ... On deconnecte ! */ pvoie->deconnect = 6; retour = 0; } break; case 0: /* OK... Plus d'appel */ retour = 1; break; case 1: /* Appel avec No incremente */ retour = 0; break; case 2: /* Deconnexion immediate */ pvoie->deconnect = 6; retour = 0; break; case 3: /* Mode read-only */ pvoie->read_only = 1; retour = 1; break; case 4: /* Mode read-only */ pvoie->msg_held = 1; retour = 1; break; default: if (ret >= 100) { /* No redefini par le filtre */ pvoie->niv3 = ret - 1; /* niv3 est incremente apres !! */ retour = 0; } else retour = 0; break; } } if (test_connect == 2) test_connect = 1; return (retour); } static int premices (void) { char *st; init_langue (voiecur); if ((voiecur != CONSOLE) && (!find (pvoie->sta.indicatif.call))) { fbb_log (voiecur, 'X', "I"); pvoie->log = 0; pvoie->deconnect = 3; } else if ((voiecur != CONSOLE) && (EXC (pvoie->finf.flags))) { fbb_log (voiecur, 'X', "E"); pvoie->log = 0; pvoie->deconnect = 3; } else if ((voiecur != CONSOLE) && (P_BBS (voiecur)) && (!LOC (pvoie->finf.flags)) && (!BBS (pvoie->finf.flags))) { fbb_log (voiecur, 'X', "G"); pvoie->log = 0; texte (T_MES + 8); pvoie->deconnect = 6; } else { st = idnt_fwd (); outs (st, strlen (st)); } return (pvoie->deconnect == 0); } static void accueil (void) { df ("accueil", 0); if (accept_cnx ()) { if (POP (no_port (voiecur))) { /* No text for pop connection */ } else if (BBS (pvoie->finf.flags)) { texte (T_MES + 0); } else if (EXP (pvoie->finf.flags) || (SYS (pvoie->finf.flags))) { texte (T_MES + 1); if (new_om) inconnu (); if (!dde_prenom ()) { ff (); return; } finentete (); } else if (P_GUEST (voiecur) && (!LOC (pvoie->finf.flags))) { texte (T_MES + 7); if (new_om) inconnu (); if (!dde_prenom ()) { ff (); return; } finentete (); } else { texte (T_MES + 2); if (new_om) inconnu (); if (!dde_prenom ()) { ff (); return; } finentete (); } if (pvoie->niv1 == N_CONF) { pvoie->conf = 1; } else { maj_niv (N_MBL, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } } else pvoie->niv3++; ff (); } int msg_find (char *s) { char *t = s; int n = 0; if (*t == '_') { ++t; while (*t) { if (*t == '.') break; if (!isdigit (*t)) return (0); ++n; ++t; } return (n); } else return (find (s)); } /* * DECONNEXION DE L'OM */ void sortie (void) { pvoie->deconnect = TRUE; if (pvoie->l_mess) { pvoie->finf.lastmes = pvoie->l_mess; pvoie->l_mess = 0L; } if (voiecur == CONSOLE) close_print (); } void majrelai (int voie) { int i; strcpy (svoie[voie]->finf.indic.call, svoie[voie]->sta.indicatif.call); svoie[voie]->finf.indic.num = svoie[voie]->sta.indicatif.num; for (i = 0; i < 8; i++) { if (*(svoie[voie]->sta.relais[i].call)) { strcpy (svoie[voie]->finf.relai[i].call, svoie[voie]->sta.relais[i].call); svoie[voie]->finf.relai[i].num = svoie[voie]->sta.relais[i].num; } else *(svoie[voie]->finf.relai[i].call) = '\0'; } ++(svoie[voie]->finf.nbcon); } void majstat (int voie) { FILE *fptr; statis bufstat; if ((voie) && (svoie[voie]->ncur) && (svoie[voie]->ncur->coord != 0xffff)) { strncpy (bufstat.indcnx, svoie[voie]->sta.indicatif.call, 6); bufstat.port = (uchar) no_port (voie) - 1; bufstat.voie = (uchar) (voie - 1); bufstat.datcnx = svoie[voie]->debut; bufstat.tpscnx = (int) (time (NULL) - svoie[voie]->debut); if ((fptr = ouvre_stats ()) != NULL) { fseek (fptr, 0L, 2); fwrite ((char *) &bufstat, sizeof (bufstat), 1, fptr); ferme (fptr, 20); } } } void majinfo (int voie, int sens) { /* * Si sens = 1 -> lecture * sens = 2 -> ecriture * sens = 3 -> maj_heure */ FILE *fptr; if ((fptr = fopen (d_disque ("TPSTAT.SYS"), "wb")) == NULL) { fbb_error (ERR_OPEN, d_disque ("TPSTAT.SYS"), 0); } fwrite ((char *) stemps, sizeof (long) * NBRUB, 1, fptr); ferme (fptr, 21); if ((svoie[voie]->ncur) && (svoie[voie]->ncur->coord != 0xffff)) { fptr = ouvre_nomenc (); if ((sens & 1) == 1) { fseek (fptr, svoie[voie]->ncur->coord * ((long) sizeof (svoie[voie]->finf)), 0); fread ((char *) &(svoie[voie]->finf), (int) sizeof (info), 1, fptr); } if ((sens & 2) == 2) { fseek (fptr, svoie[voie]->ncur->coord * ((long) sizeof (info)), 0); svoie[voie]->finf.hcon = svoie[voie]->debut; fwrite ((char *) &(svoie[voie]->finf), (int) sizeof (info), 1, fptr); } ferme (fptr, 22); } } void libere_zones_allouees (int voie) { if (svoie[voie]->ptemp) { m_libere ((char *) svoie[voie]->ptemp, svoie[voie]->psiz); svoie[voie]->ptemp = NULL; svoie[voie]->psiz = 0; } if (svoie[voie]->Xfwd) { m_libere (svoie[voie]->Xfwd, sizeof (XInfo)); svoie[voie]->Xfwd = NULL; } libere (voie); /* message en cours de creation */ libere_tread (voie); /* Liste de lecture de messages */ libere_edit (voie); /* Libere la liste de l'editeur */ /* libere_label(voie) ; Libere les labels de YAPP */ libere_route (voie); /* Libere les routes rx forward */ #ifndef __linux__ libere_ymodem (voie, 0);; /* Libere la liste de fichiers */ #endif clear_inbuf (voie); /* Vide le buffer d'entree */ clear_outbuf (voie); /* Vide le buffer de sortie */ } void majfich (int voie) { if (v_tell == voie) { t_tell = -1; v_tell = 0; } libere_zones_allouees (voie); if ((svoie[voie]->ncur) && (svoie[voie]->maj_ok)) { if (voie != CONSOLE) majstat (voie); majrelai (voie); majinfo (voie, 2); } } void retour_menu (int niveau) { if (pvoie->mbl) maj_niv (N_MBL, 0, 0); else if (niveau == N_MENU) maj_niv (niveau, 1, 0); else if (niveau != N_TELL) maj_niv (niveau, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } void q_mark (void) { texte (T_MES + 13); } void limite_commande (void) { if (nb_trait > 80) { indd[80] = '\0'; nb_trait = 80; } } /* * MENU PRINCIPAL - PREMIER NIVEAU */ #ifndef MINISERV void choix (void) { int c, modex, error = 0; char com[80]; limite_commande (); while (*indd && (!ISGRAPH (*indd))) indd++; strn_cpy (70, com, indd); switch (toupper (*indd)) { case 'Q': maj_niv (N_QRA, 0, 0); incindd (); qraloc (); break; case 'C': maj_niv (N_STAT, 0, 0); incindd (); statistiques (); break; case 'D': maj_niv (N_INFO, 0, 0); *pvoie->ch_temp = '\0'; incindd (); documentations (); break; case 'N': maj_niv (N_NOMC, 0, 0); incindd (); nomenclature (); break; case 'T': maj_niv (N_TRAJ, 0, 0); incindd (); trajec (); break; case 'F': if (indd == data) { if ((*(indd + 1) == '>') && (FOR (pvoie->mode))) { maj_niv (N_FORW, 1, 0); fwd (); break; } } pvoie->mbl = TRUE; /* pvoie->mode = pvoie->finf.flags ; */ /* ??????????????????? */ pvoie->mode = 0; texte (T_TRT + 13); maj_niv (N_MBL, 0, 0); prompt (pvoie->finf.flags, N_MBL); break; case 'B': maj_niv (N_MENU, 0, 0); sortie (); break; case '[': modex = TRUE; while ((c = *indd) != '\0') { ++indd; if (c == '\n') modex = FALSE; if ((modex) && (*indd == ']')) { pvoie->mode = F_FOR; } } prompt (pvoie->finf.flags, pvoie->niv1); break; case ';': break; case '\0': prompt (pvoie->finf.flags, pvoie->niv1); break; default: if (!defaut ()) error = 1; break; } if (error) { ch_niv1 (N_MENU); cmd_err (indd); } } #endif void menu_principal (void) { df ("menu_principal", 0); switch (pvoie->niv2) { case 0: if (premices ()) { ch_niv2 (2); accueil (); } break; #ifndef MINISERV case 1: choix (); break; #endif case 2: accueil (); break; case 3: arret_serveur (d_disque ("ETAT.SYS"), 1); break; case 4: cross_connexion (); break; default: fbb_error (ERR_NIVEAU, "PRIM-MENU", pvoie->niv2); break; } ff (); } fbb-7.0.10/src/mbl_lc.c0000644000175000017500000000636013613360505011443 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include /* * Module commande LC */ #define NB_THEMES 1000 static void list_themes (void); typedef struct theme { char nom[6]; int nb; struct theme *suiv; } Theme; int list_lc (void) { int error = 0; sup_ln (indd); /************** Tester l'espace ******************/ incindd (); if ((*indd == ';') || (*indd == '?')) list_themes (); else { if (*indd) { strn_cpy (6, pvoie->finf.filtre, indd); if (strcmp (pvoie->finf.filtre, "*") == 0) { *pvoie->finf.filtre = '\0'; } } outln ("=> $l", 5); } retour_mbl (); return (error); } static void list_themes (void) { char s[30]; char temp[30]; Theme *tptr = NULL; Theme *cptr; Theme *sptr; Theme *prec; int nb; int comp; unsigned offset; bloc_mess *bptr = tete_dir; bullist ligne; ouvre_dir (); offset = 0; while (bptr) { if (bptr->st_mess[offset].noenr) { read_dir (bptr->st_mess[offset].noenr, &ligne); if ((ligne.type == 'B') && (droit_ok (&ligne, 1))) { if (tptr == NULL) { tptr = (Theme *) m_alloue (sizeof (Theme)); tptr->suiv = NULL; strncpy (tptr->nom, ligne.desti, 6); tptr->nb = 1; } else { prec = NULL; sptr = tptr; for (;;) { if (sptr == NULL) { cptr = (Theme *) m_alloue (sizeof (Theme)); cptr->suiv = NULL; strncpy (cptr->nom, ligne.desti, 6); cptr->nb = 1; if (prec) prec->suiv = cptr; else tptr = cptr; break; } comp = strncmp (sptr->nom, ligne.desti, 6); if (comp == 0) { ++sptr->nb; break; } if (comp > 0) { cptr = (Theme *) m_alloue (sizeof (Theme)); strncpy (cptr->nom, ligne.desti, 6); cptr->nb = 1; if (prec) prec->suiv = cptr; else tptr = cptr; cptr->suiv = sptr; break; } prec = sptr; sptr = sptr->suiv; } } } } if (++offset == T_BLOC_MESS) { bptr = bptr->suiv; offset = 0; } } ferme_dir (); nb = 0; cptr = tptr; while (cptr) { strn_cpy (6, temp, cptr->nom); sprintf (s, "%-6s %d ", temp, cptr->nb); out (s, 13); if (++nb == 6) { cr (); nb = 0; } prec = cptr; cptr = cptr->suiv; m_libere (prec, sizeof (Theme)); } if (nb != 0) cr (); } fbb-7.0.10/src/variable.c0000644000175000017500000002671613613360505012007 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * VARIABLE.C * */ #include static char locbuf[600]; char *strdate (long temps) { static char cdate[19]; char jour[4]; struct tm *sdate; df ("strdate", 2); sdate = localtime (&temps); if (vlang == -1) *jour = '\0'; else { strncpy (jour, (langue[vlang]->plang[JOUR - 1]) + (sdate->tm_wday * 3), 3); jour[3] = '\0'; } sprintf (cdate, "%s %02d/%02d/%02d %02d:%02d", jour, sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100, sdate->tm_hour, sdate->tm_min); ff (); return (cdate); } char *strdt (long temps) { struct tm *sdate; static char cdate[15]; df ("strdt", 2); sdate = localtime (&temps); sprintf (cdate, "%02d/%02d/%02d %02d:%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100, sdate->tm_hour, sdate->tm_min); ff (); return (cdate); } static char *date_heure_fbb (long temps) { struct tm *sdate; static char cdate[15]; df ("data_heure_fbb", 2); sdate = localtime (&temps); sprintf (cdate, "%02d%02d/%02d%02d", sdate->tm_mon + 1, sdate->tm_mday, sdate->tm_hour, sdate->tm_min); ff (); return (cdate); } char *date_mbl (long temps) { struct tm *sdate; static char cdate[7]; df ("data_mbl", 2); sdate = localtime (&temps); sprintf (cdate, "%02d%02d%02d", sdate->tm_year % 100, sdate->tm_mon + 1, sdate->tm_mday); ff (); return (cdate); } char *heure_mbl (long temps) { struct tm *sdate; static char cdate[5]; df ("heure_mbl", 2); sdate = localtime (&temps); sprintf (cdate, "%02d%02d", sdate->tm_hour, sdate->tm_min); ff (); return (cdate); } static char *date_mbl_new (long temps) { char mois[4]; struct tm *sdate; static char cdate[7]; df ("date_mbl_new", 2); sdate = localtime (&temps); if (vlang == -1) *mois = '\0'; else { strncpy (mois, (langue[vlang]->plang[MOIS - 1]) + (sdate->tm_mon * 3), 3); mois[3] = '\0'; } sprintf (cdate, "%02d-%s", sdate->tm_mday, mois); ff (); return (cdate); } static char *annee_mbl (long temps) { struct tm *sdate; static char cdate[7]; df ("annee_mbl", 2); sdate = localtime (&temps); sprintf (cdate, "%02d", sdate->tm_year % 100); ff (); return (cdate); } char *datheure_mbl (long temps) { static char cdate[13]; df ("datheure_mbl", 2); sprintf (cdate, "%s %s", date_mbl_new (temps), strheure (temps)); ff (); return (cdate); } char *strheure (long temps) { struct tm *sdate; static char cdate[6]; df ("str_heure", 2); sdate = localtime (&temps); sprintf (cdate, "%02d:%02d", sdate->tm_hour, sdate->tm_min); ff (); return (cdate); } int jour (long temps) { struct tm *sdate; df ("jour", 2); sdate = localtime (&temps); ff (); return (sdate->tm_wday); } int nojour (long temps) { struct tm *sdate; df ("nojour", 2); sdate = localtime (&temps); ff (); return (sdate->tm_mday); } int heure (long temps) { struct tm *sdate; df ("heure", 2); sdate = localtime (&temps); ff (); return (sdate->tm_hour); } int gmt_heure (long temps) { struct tm *sdate; df ("heure", 2); sdate = gmtime (&temps); ff (); return (sdate->tm_hour); } int minute (long temps) { struct tm *sdate; df ("minute", 2); sdate = localtime (&temps); ff (); return (sdate->tm_min); } static int check_fwd (char *bbs, int *nbbul, int *nbpriv, int *nbkilo) { char maxfwd[NBBBS + 1]; char typfwd[NBBBS + 1]; char typdat[NBBBS + 1]; atfwd *mess; int nobbs; static unsigned task_ident = 0xffff; static atfwd smess; *nbbul = *nbpriv = *nbkilo = 0; nobbs = n_bbs (bbs); if (nobbs == 0) return (FALSE); if (task_ident != tid) { task_ident = tid; fwd_value (maxfwd, typfwd, typdat); if ((mess = attend_fwd (nobbs, maxfwd[nobbs], 0, typfwd[nobbs], typdat[nobbs])) != NULL) { smess = *mess; } else { memset (&smess, 0, sizeof (atfwd)); } } *nbpriv = smess.nbpriv; *nbbul = smess.nbbul; *nbkilo = smess.nbkb; return (TRUE); } char *variable (char var) { int nb; long t_cnx; char *ptr = locbuf; df ("variable", 1); *ptr = '\0'; switch (var) { case '$': *ptr++ = '$'; *ptr = '\0'; break; /* Variables red‚finies */ case '0': n_cpy (80, ptr, varx[0]); break; case '1': n_cpy (80, ptr, varx[1]); break; case '2': n_cpy (80, ptr, varx[2]); break; case '3': n_cpy (80, ptr, varx[3]); break; case '4': n_cpy (80, ptr, varx[4]); break; case '5': n_cpy (80, ptr, varx[5]); break; case '6': n_cpy (80, ptr, varx[6]); break; case '7': n_cpy (80, ptr, varx[7]); break; case '8': n_cpy (80, ptr, varx[8]); break; case '9': n_cpy (80, ptr, varx[9]); break; /* Variable pr‚d‚finies */ case 'A': sprintf (ptr, "%-6s", bbs_via (ptmes->bbsv)); break; case 'a': strcpy (ptr, annee_mbl (time (NULL))); break; case 'B': *ptr++ = '\a'; *ptr = '\0'; break; case 'b': strcpy (ptr, pvoie->finf.zip); break; case 'C': ltoa (nomess + 1, ptr, 10); break; case 'c': strcpy (ptr, my_city); break; case 'D': strcpy (ptr, date_mbl (time (NULL))); break; case 'd': strcpy (ptr, date_mbl_new (time (NULL))); break; case 'E': strcpy (ptr, version ()); break; case 'e': strcpy (ptr, pvoie->finf.ville); break; case 'F': itoa (p_port[no_port (voiecur)].min_fwd, ptr, 10); break; case 'f': strcpy (ptr, pvoie->appendf); break; case 'G': sprintf (ptr, "%-6s", ptmes->desti); break; case 'g': itoa (nbgate (), ptr, 10); break; case 'H': strcpy (ptr, strheure (time (NULL))); break; case 'h': strcpy (ptr, pvoie->finf.home); break; case 'I': if (*(pvoie->finf.prenom)) strcpy (ptr, pvoie->finf.prenom); else strcpy (ptr, "???"); break; case 'i': strcpy (ptr, date_heure_fbb (ptmes->date)); break; case 'J': strcpy (ptr, date_mbl (ptmes->date)); break; case 'j': strcpy (ptr, date_mbl_new (ptmes->date)); break; case 'K': strcpy (ptr, strheure (ptmes->date)); break; case 'k': strcpy (ptr, k_var ()); break; case 'L': ltoa (nomess, ptr, 10); break; case 'l': if (*pvoie->finf.filtre) strcpy (ptr, pvoie->finf.filtre); else { *ptr++ = '*'; *ptr = '\0'; } break; case 'M': sprintf (ptr, "%-6ld", ptmes->numero); break; case 'm': strcpy (ptr, p_port[no_port (voiecur)].freq); break; case 'N': ltoa (nbmess, ptr, 10); break; case 'n': sprintf (ptr, "%5ld", ptmes->taille); break; case 'O': strcpy (ptr, mycall); break; case 'o': itoa (myssid, ptr, 10); break; case 'P': sprintf (ptr, "%-6s", ptmes->exped); break; case 'p': if (PAG (pvoie->finf.flags)) ltoa (pvoie->finf.nbl, ptr, 10); else { ptr[0] = ptr[1] = '-'; ptr[2] = '\0'; } break; case 'Q': list_new (ptr); break; case 'q': ltoa (1000L * (long) pvoie->finf.on_base, ptr, 10); break; case 'R': strcpy (ptr, ptmes->bid); break; case 'r': *ptr++ = (*ptmes->bbsf) ? ' ' : 'L'; *ptr = '\0'; break; case 'S': strcpy (ptr, ptmes->titre); break; case 's': *ptr++ = ptmes->status; *ptr = '\0'; break; case 'T': strcpy (ptr, strheure (time (NULL))); break; case 't': *ptr++ = ptmes->type; *ptr = '\0'; break; case 'U': strcpy (ptr, pvoie->sta.indicatif.call); break; case 'u': *ptr++ = (pvoie->vdisk == 8) ? 'P' : pvoie->vdisk + 'A'; *ptr = '\0'; break; case 'V': strcpy (ptr, my_name); break; case 'v': strcpy (ptr, ptmes->bbsv); break; case 'W': *ptr++ = '\r'; *ptr = '\0'; break; case 'w': *ptr++ = '\033'; *ptr = '\0'; break; case 'X': strcpy (ptr, date_mbl (pvoie->finf.hcon)); break; case 'x': strcpy (ptr, date_mbl_new (pvoie->finf.hcon)); break; case 'Y': strcpy (ptr, strheure (pvoie->finf.hcon)); break; case 'y': strcpy (ptr, annee_mbl (ptmes->date)); break; case 'Z': ltoa (pvoie->finf.lastmes, ptr, 10); break; case 'z': strcpy (ptr, my_zip); break; case '*': nb = actif (1); itoa (nb, ptr, 10); break; case '=': itoa (virt_canal (voiecur), ptr, 10); break; case '!': itoa (no_port (voiecur), ptr, 10); break; case '^': itoa (nbport (), ptr, 10); break; case '?': strcpy (ptr, qra_locator); break; case '%': who (ptr); break; case ':': t_cnx = time (NULL) - pvoie->debut; if (t_cnx < 60) sprintf (ptr, "%2lds", t_cnx); else sprintf (ptr, "%ldmn %02lds", t_cnx / 60, t_cnx % 60); break; case '.': if (pvoie->tmach < 60) sprintf (ptr, "%2lds", pvoie->tmach); else sprintf (ptr, "%ldmn %02lds", pvoie->tmach / 60, pvoie->tmach % 60); break; default: sprintf (ptr, "$%c", var); break; } ff (); return (locbuf); } char *alt_variable (char var) { int nbbul, nbpriv, nbkilo; char *ptr = locbuf; Wps *wps; df ("alt_variable", 1); *ptr = '\0'; switch (var) { case '%': *ptr++ = '%'; *ptr = '\0'; break; /* Variable pr‚d‚finies */ case 'A': sprintf (ptr, "%s", bbs_via (ptmes->bbsv)); break; case 'C': sprintf (ptr, "%-3u", ptmes->nblu); break; case 'd': itoa (pvoie->finf.download, ptr, 10); break; case 'E': strcpy (ptr, os ()); break; case 'e': strcpy (ptr, date ()); break; case 'G': sprintf (ptr, "%s", ptmes->desti); break; case 'I': /* Get the name from WP */ wps = wp_find(ptmes->exped, 0); if ((wps) && (*wps->name) && (*wps->name != '?')) strcpy (ptr, wps->name); else strcpy (ptr, "???"); break; case 'i': strcpy (ptr, date_heure_fbb (ptmes->datesd)); break; case 'J': strcpy (ptr, date_mbl (ptmes->datesd)); break; case 'j': strcpy (ptr, date_mbl_new (ptmes->datesd)); break; case 'K': strcpy (ptr, strheure (ptmes->datesd)); break; case 'k': check_fwd (pvoie->sta.indicatif.call, &nbbul, &nbpriv, &nbkilo); itoa (nbkilo, ptr, 10); break; case 'l': check_fwd (pvoie->sta.indicatif.call, &nbbul, &nbpriv, &nbkilo); itoa (nbpriv + nbbul, ptr, 10); break; case 'M': sprintf (ptr, "%ld", ptmes->numero); break; case 'm': itoa (P_MODM (voiecur) ? max_mod : max_yapp, ptr, 10); break; case 'N': sprintf (ptr, "%ld", ptmes->numero % 0x10000L); break; case 'n': sprintf (ptr, "%ld", ptmes->taille); break; case 'O': strcpy (ptr, admin); break; case 'P': sprintf (ptr, "%s", ptmes->exped); break; case 'R': strcpy (ptr, mypath); break; case 'r': *ptr++ = (ptmes->bin) ? 'D' : ' '; *ptr = '\0'; break; case 'T': strcpy (ptr, cur_theme (voiecur)); break; case 't': itoa (nbull_theme (voiecur), ptr, 10); break; case 'X': itoa (pvoie->ncur->nbmess, ptr, 10); break; case 'x': itoa (pvoie->ncur->nbnew, ptr, 10); break; case 'y': strcpy (ptr, annee_mbl (ptmes->datesd)); break; default: sprintf (ptr, "%%%c", var); break; } ff (); return (locbuf); } fbb-7.0.10/src/mbl_user.c0000644000175000017500000002566313660542546012043 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include #include /* * Module emulation WA7MBL */ static void aff_aide (FILE *); static int user_dump (unsigned); static int heardcmp (const void *, const void *); /* Commande ? -> Help */ void help (char *cmd) { if (*cmd) out_help (cmd); else { char str[10]; strcpy (str, "?"); out_help (str); } retour_menu (pvoie->niv1); } int out_help (char *cmde) { char buffer[257]; char str_aide[255]; char *ptr; char *cmd; static char qm[2] = "?"; FILE *fptr; int niveau; int position; int aide = FALSE; char command[80]; n_cpy (78, command, cmde); cmd = command; pvoie->aut_nc = 1; if ((!SYS (pvoie->finf.flags)) && (!LOC (pvoie->finf.flags)) && (P_GUEST (voiecur))) { position = -1; cmd = qm; } else position = pvoie->niv1; sprintf (buffer, "LANG\\%s.HLP", nomlang + nlang * LG_LANG); if ((fptr = fopen (c_disque (buffer), "rt")) != NULL) { strupr (sup_ln (cmd)); if (ISGRAPH (*cmd)) { while (fgets (buffer, 256, fptr)) { if (*buffer == '#') continue; if ((buffer[0] == '@') && (buffer[1] == '@')) { sscanf (buffer, "%*s %d %s", &niveau, str_aide); if (niveau == position) { for (ptr = strtok (str_aide, "|"); ptr; ptr = strtok (NULL, "|")) { if (strncmp (ptr, cmd, 80) == 0) { aff_aide (fptr); aide = TRUE; break; } } if (aide) break; } } } } ferme (fptr, 35); } if ((*cmd) && (!aide)) { var_cpy (0, cmd); texte (T_ERR + 5); } return (aide); } static void aff_aide (FILE * fptr) { char buffer[257]; char *ptr; int nb; while (fgets (buffer, 256, fptr)) { if (*buffer == '#') continue; nb = 0; if ((*buffer == '@') && (*(buffer + 1) == '@')) break; ptr = buffer; while (*ptr) { if (*ptr == '\n') *ptr = '\r'; ++ptr; ++nb; } out (buffer, nb); } } /* Commande D -> DOS ou dump fichiers systeme */ int mbl_dump (void) { int erreur = 0; unsigned masque = 0; switch (pvoie->niv3) { case 0: if (!ISGRAPH (*indd)) { sup_ln (indd); if (*indd) { /* Download */ --indd; pvoie->temp1 = pvoie->niv1; maj_niv (N_DOS, 2, 0); send_file (1); } else { /* DOS */ if (miniserv & 2) { maj_niv (N_DOS, 0, 0); ptmes->date = time (NULL); pvoie->mbl = 0; texte (T_DOS + 8); dos (); } else return (1); } return (0); } if (droits (COSYSOP)) { *indd = toupper (*indd); switch (*indd) { case 'B': masque = F_BBS; break; case 'E': masque = F_EXC; break; case 'F': masque = F_PMS; break; case 'L': masque = F_LOC; break; case 'M': masque = F_MOD; break; case 'P': masque = F_PAG; break; case 'S': masque = F_SYS; break; case 'U': masque = 0xffff; break; case 'X': masque = F_EXP; break; default: erreur = 1; } if (!erreur) { pvoie->temp2 = 0; pvoie->temp3 = masque; pvoie->enrcur = 0L; incindd (); strn_cpy (9, pvoie->appendf, sup_ln (indd)); if (user_dump (masque)) ch_niv3 (1); else retour_mbl (); return (0); } } break; case 1: if (user_dump (pvoie->temp3) == 0) { pvoie->temp3 = 0; retour_mbl (); } return (0); /* varx[0][0] = 'D' ; strn_cpy(79, varx[0] + 1, indd) ; texte(T_ERR + 1) ; retour_mbl() ; */ } return (1); } char *strflags (info * frec) { #define NB_FLAG 11 int i; static char flag[NB_FLAG + 1]; for (i = 0; i < NB_FLAG; i++) flag[i] = '.'; flag[NB_FLAG] = '\0'; if (NEW (frec->flags)) flag[10] = 'I'; if (UNP (frec->flags)) flag[9] = 'U'; if (MOD (frec->flags)) flag[8] = 'M'; if (EXC (frec->flags)) flag[7] = 'E'; if (PMS (frec->flags)) flag[6] = 'F'; if (LOC (frec->flags)) flag[5] = 'L'; if (EXP (frec->flags)) flag[4] = 'X'; if (SYS (frec->flags)) flag[3] = 'S'; if (BBS (frec->flags)) flag[2] = 'B'; if (PAG (frec->flags)) flag[1] = 'P'; if (PRV (frec->flags)) flag[0] = 'R'; return (flag); } void affiche_user (info * frec, int mode) { char s[200]; char *flag = strflags (frec); sprintf (s, "%-6s-%-2d %s/%s %5ld %s %-12s %-12s %-12s", frec->indic.call, frec->indic.num, date_mbl (frec->hcon), heure_mbl (frec->hcon), frec->nbcon, flag, frec->prenom, frec->pass, frec->priv); outln (s, strlen (s)); if (mode) { var_cpy (0, frec->home); var_cpy (1, frec->zip); texte (T_MBL + 55); } } static int user_dump (unsigned masque) { FILE *fptr; info frec; int ind = FALSE; int retour = 0; int match; char w_masque[10]; pvoie->sr_mem = pvoie->seq = FALSE; strcpy (w_masque, pvoie->appendf); match = (int) w_masque[0]; if ((match) && (find (pvoie->appendf))) ind = TRUE; fptr = ouvre_nomenc (); fseek (fptr, pvoie->enrcur, 0); while (fread ((char *) &frec, sizeof (info), 1, fptr)) { if (find (frec.indic.call)) { if ((!ind && !match) || ((match) && (strmatch (frec.indic.call, w_masque)))) { if ((masque == 0xffff) || ((int) frec.flags & masque)) { if (pvoie->temp2 == 0) texte (T_MBL + 11); affiche_user (&frec, ind); pvoie->temp2 = 1; } } } if (pvoie->memoc >= MAXMEM) { pvoie->sr_mem = TRUE; retour = 1; break; } if (trait_time > MAXTACHE) { pvoie->seq = TRUE; retour = 1; break; } } pvoie->enrcur = ftell (fptr); ferme (fptr, 37); if ((retour == 0) && (pvoie->temp2 == 0)) texte (T_ERR + 19); return (retour); } /* Commande J -> Liste des dernieres connexions */ int mbl_jheard (void) { int port; if (isdigit (*indd)) { while (*indd && (isdigit (*indd))) { port = (port * 10) + (*indd - '0'); ++indd; } j_list (port, 0); retour_mbl (); return (0); } else { if (ISGRAPH (*(indd + 1))) return (1); // erreur *indd = toupper (*indd); if (((*indd >= 'A') && (*indd <= 'J')) || (*indd == 'K')) // expanded from H to J to accomodate a little more ports { j_list (0, *indd); retour_mbl (); return (0); } } return (1); // erreur } int page_connect (char port, FILE * fptr) { #define TBUF 20 long pos, nbc = MAXSTAT; int nblig, nbrec, lg; unsigned char valport; statis buffstat[TBUF]; char valcall[8]; pvoie->lignes = -1; nblig = nbl_page (voiecur); if (nblig > MAXLIGNES) nblig = MAXLIGNES; nblig--; if (nblig < 3) nblig = 3; nbrec = 0; while (--nbc) { if (pvoie->noenr_menu == 0L) return (FALSE); if (nbrec == 0) { pos = pvoie->noenr_menu - (long) (sizeof (statis) * TBUF); if (pos < 0L) pos = 0L; fseek (fptr, pos, 0); nbrec = fread ((char *) buffstat, sizeof (statis), TBUF, fptr); if (nbrec == 0) return (FALSE); } --nbrec; pvoie->noenr_menu -= (long) sizeof (statis); lg = (strlen (pvoie->ch_temp)); if (strmatch (buffstat[nbrec].indcnx, pvoie->ch_temp)) { /* test de la validite du port */ valport = buffstat[nbrec].port + 'A'; if ((!port) || (valport == port)) { n_cpy (6, valcall, buffstat[nbrec].indcnx); /* FlexNet Poll filtering - N1URO and WB2CMF */ if (strcmp(valcall, mycall)) { sprintf (varx[0], "%c", valport); sprintf (varx[1], "%02d", buffstat[nbrec].voie); sprintf (varx[2], "%4ld", pvoie->noenr_menu / (long) sizeof (statis)); sprintf (varx[3], "%-6s", valcall); sprintf (varx[4], "%2d", buffstat[nbrec].tpscnx / 60); sprintf (varx[5], "%02d", buffstat[nbrec].tpscnx % 60); ptmes->date = buffstat[nbrec].datcnx; texte (T_STA + 23); if (--nblig == 0) break; } } } } if (nbc == 0) return (0); return (1); } static int heardcmp (const void *a, const void *b) { long result; result = ((Heard *) a)->last - ((Heard *) b)->last; return ((result > 0L) ? 1 : ((result == 0L) ? 0 : -1)); } void j_list (int portnum, char portlet) { FILE *fptr; char buffer[259]; char date[80]; char indic[10]; int i, port; Heard *pheard; if (portnum) { port = portnum; if ((port < 1) || (port >= NBPORT) || (p_port[port].pvalid == 0)) { texte (T_ERR + 14); return; } pheard = p_port[port].heard; qsort (pheard, NBHEARD, sizeof (Heard), heardcmp); for (i = 0; i < NBHEARD; i++) { if (pheard->last) { pheard->indic.call[6] = '\0'; if (pheard->indic.num > 15) pheard->indic.num = 0; sprintf (indic, "%s-%d", pheard->indic.call, pheard->indic.num); strcpy (date, datheure_mbl (pheard->first)); sprintf (buffer, "%-9s %s %s", indic, date, datheure_mbl (pheard->last)); outln (buffer, strlen (buffer)); } ++pheard; } } else { incindd (); tester_masque (); if (portlet == 'K') port = '\0'; else port = portlet; if ((port) && ((port < 'A') || (port > 'J') || (p_port[port - 'A' + 1].pvalid == 0))) { texte (T_ERR + 14); return; } fptr = ouvre_stats (); fseek (fptr, 0L, 2); pvoie->noenr_menu = ftell (fptr); page_connect (port, fptr); ferme (fptr, 38); } } /* void j_list (char type) { FILE *fptr; char buffer[259]; char date[80]; char indic[10]; int i, port; Heard *pheard; if (isdigit (type)) { port = type - '0'; if ((port < 1) || (port >= NBPORT) || (p_port[port].pvalid == 0)) { texte (T_ERR + 14); return; } pheard = p_port[port].heard; qsort (pheard, NBHEARD, sizeof (Heard), heardcmp); for (i = 0; i < NBHEARD; i++) { if (pheard->last) { pheard->indic.call[6] = '\0'; if (pheard->indic.num > 15) pheard->indic.num = 0; sprintf (indic, "%s-%d", pheard->indic.call, pheard->indic.num); strcpy (date, datheure_mbl (pheard->first)); sprintf (buffer, "%-9s %s %s", indic, date, datheure_mbl (pheard->last)); outln (buffer, strlen (buffer)); } ++pheard; } } else { incindd (); tester_masque (); if (type == 'K') port = '\0'; else port = type; if ((port) && ((port < 'A') || (port > 'H') || (p_port[port - 'A' + 1].pvalid == 0))) { texte (T_ERR + 14); return; } fptr = ouvre_stats (); fseek (fptr, 0L, 2); pvoie->noenr_menu = ftell (fptr); page_connect (port, fptr); ferme (fptr, 38); } } */ fbb-7.0.10/src/fwdutil.c0000644000175000017500000003547013615603431011675 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE FWDUTIL.C */ #include static long hold_nb = 0L; static void append_message (void); static int data_sysop (void); static int hold_wp (void); /* * RECEPTION D'UN MESSAGE */ void libere (int voie) { obuf *msgtemp; while ((msgtemp = svoie[voie]->msgtete) != NULL) { svoie[voie]->memoc -= msgtemp->nb_car; svoie[voie]->msgtete = msgtemp->suiv; m_libere ((char *) msgtemp, sizeof (obuf)); msgtemp = NULL; } svoie[voie]->entmes.numero = 0L; } void supp_mess (long nmess) { char temp[128]; if (nmess) unlink (mess_name ((pvoie->binary) ? MBINDIR : MESSDIR, nmess, temp)); } int write_mess_temp (unsigned mode, int voie) { int fd; obuf *msgtemp; char temp[128]; temp_name (voie, temp); fd = open (temp, O_WRONLY | O_APPEND | O_CREAT | mode, S_IREAD | S_IWRITE); if (fd != -1) { while ((msgtemp = pvoie->msgtete) != NULL) { if (write (fd, msgtemp->buffer, msgtemp->nb_car) != msgtemp->nb_car) { write_error (temp); } pvoie->memoc -= msgtemp->nb_car; pvoie->msgtete = msgtemp->suiv; m_libere ((char *) msgtemp, sizeof (*msgtemp)); } close (fd); return (1); } else { fbb_error (ERR_OPEN, temp, 0); return (0); } } #if 0 int write_mess (unsigned mode, long nmess) { int fd; obuf *msgtemp; if (nmess == 0L) nmess = next_num (); fd = open (nom_mess ((mode == O_BINARY) ? MBIN : MESS, nmess), O_WRONLY | O_APPEND | O_CREAT | mode, S_IREAD | S_IWRITE); if (fd != -1) { while (msgtemp = pvoie->msgtete) { if (write (fd, msgtemp->buffer, msgtemp->nb_car) != msgtemp->nb_car) { write_error (); } pvoie->memoc -= msgtemp->nb_car; pvoie->msgtete = msgtemp->suiv; m_libere ((char *) msgtemp, sizeof (*msgtemp)); } close (fd); return (1); } else { write_error (); return (0); } } #endif static void append_message (void) { int nb; FILE *fd, *fich_ptr; char buffer[250]; if ((fich_ptr = fopen (pvoie->appendf, "rb")) == NULL) { texte (T_ERR + 11); } else { next_num (); if ((fd = fopen (mess_name (MESSDIR, ptmes->numero, buffer), "ab")) != NULL) { while (1) { fflush (fich_ptr); nb = read (fileno (fich_ptr), buffer, 250); ptmes->taille += nb; if (fwrite (buffer, nb, 1, fd) < 1) write_error (mess_name (MESSDIR, ptmes->numero, buffer)); if (nb < 250) break; } ferme (fd, 45); } ferme (fich_ptr, 44); if (voiecur == CONSOLE) texte (T_MBL + 20); } } void ins_fwd (bullist * fwd_rec) { int pos; lfwd *ptr_fwd; char *ptr = NULL; ptr_fwd = tete_fwd; pos = 0; if (fwd_rec->numero == 0L) return; if (ptr_fwd == NULL) { cprintf ("ptr_fwd = NULL !!!\n"); *ptr = 0; } while (1) { if (pos == NBFWD) { if (ptr_fwd->suite == NULL) ptr_fwd = cree_bloc_fwd (ptr_fwd); else ptr_fwd = ptr_fwd->suite; pos = 0; } if (ptr_fwd->fwd[pos].type == '\0') { fwd_cpy (&ptr_fwd->fwd[pos], fwd_rec); break; } ++pos; } } static void test_ping_pong (bullist * lbul) { int i; if ((lbul->type != 'P') || (*lbul->bbsv == '\0')) return; if (pvoie->warning & W_ROU) return; for (i = 0; i < NBMASK; i++) if (lbul->fbbs[i]) return; /* Ya une bbs, pas de warning et pas de route -> ping-pong ! */ dde_warning (W_PPG); } static int data_sysop (void) { if ((std_header & 32) && (strcmp (ptmes->desti, "SYSOP") == 0) && (ptmes->type == 'P') && (ptmes->bin)) { return (1); } else return (0); } static int hold_wp (void) { if ((std_header & 256) && (strcmp (ptmes->desti, "WP") == 0)) return (0); return (1); } int is_held (char *ascfile) { long temps; char holdname[130]; int i; int nobbs; char status = '\0'; char s[256]; long numess = ptmes->numero; if (test_message) { int ret = -1; /* Ecrire les infos ptmes dans le record 0 de DIRMES.SYS */ ptmes->numero = nomess; ouvre_dir (); write_dir (0, ptmes); ferme_dir (); ptmes->numero = numess; #ifdef __linux__ sprintf (s, "./m_filter %s %c %s %s %d", ascfile, ptmes->type, ptmes->exped, ptmes->desti, 0); ret = filter (s, NULL, 0, NULL, FILTDIR); #else sprintf (s, "m_filter %s %c %s %s %d", ascfile, ptmes->type, ptmes->exped, ptmes->desti, 0); ret = filter (s, NULL, 0, NULL, NULL); #endif switch (ret) { case -1: if (test_message == 2) { /* M-FILTER is not found ... Will not be called again */ test_message = 0; break; } case 1: /* Kill */ for (i = 0; i < NBMASK; i++) ptmes->fbbs[i] = ptmes->forw[i] = '\0'; status = 'K'; break; case 2: /* Archive */ for (i = 0; i < NBMASK; i++) ptmes->fbbs[i] = ptmes->forw[i] = '\0'; status = 'A'; break; case 3: /* Hold */ for (i = 0; i < NBMASK; i++) ptmes->fbbs[i] = ptmes->forw[i] = '\0'; if ((FOR (pvoie->mode)) && ((nobbs = n_bbs (pvoie->sta.indicatif.call)) != 0)) set_bit_fwd (ptmes->forw, nobbs); status = 'H'; break; default: break; } if (status) { ptmes->status = status; } } if (test_message == 2) test_message = 1; if ((hold_wp ()) && ((pvoie->msg_held) || (status == 'H') || (hold (ptmes)))) { /* Le message est HOLD. Il n'est pas gere, mais mis dans le repertoire HOLD */ ptmes->status = 'H'; ++nb_hold; if (*ptmes->bid) { w_bid (); } if ((FOR (pvoie->mode)) && ((nobbs = n_bbs (pvoie->sta.indicatif.call)) != 0)) set_bit_fwd (ptmes->forw, nobbs); /* Cree un index du nom de fichier */ temps = time (NULL); if (hold_nb >= temps) ++hold_nb; else hold_nb = temps; for (;;) { hold_name (hold_nb, holdname); if (access (holdname, 0) != 0) { hold_temp (voiecur, ascfile, holdname, TRUE); break; } ++hold_nb; } if (!FOR (pvoie->mode)) { texte (T_MBL + 59); } aff_msg_cons (); /* Affiche cons + held */ return (1); } return (0); } void put_mess_fwd (char clog) { int i; char s[256]; long numess = ptmes->numero; if (*(pvoie->appendf)) append_message (); if ((strncmp (ptmes->titre, "ACK", 3) != 0) && (strcmp (ptmes->exped, "WP") != 0) && (find (ptmes->exped)) && (!is_serv (ptmes->exped)) && (pvoie->niv2 != 99)) { exped_wp (ptmes->exped, pvoie->mess_home); } if ((ptmes->status != 'K') && (ptmes->status != 'A')) { if (ptmes->type == 'B') valide_themes (0, 1, ptmes); if (test_forward (1)) ins_fwd (ptmes); test_ping_pong (ptmes); if (!(FOR (pvoie->mode))) texte (T_MBL + 48); } if (clog) { sprintf (s, "%c %ld%c F:%s T:%s@%s [%ld] S:%s", clog, ptmes->numero, ptmes->type, ptmes->exped, ptmes->desti, ptmes->bbsv, ptmes->taille, ptmes->titre); fbb_log (voiecur, 'M', s); } libere (voiecur); flush_wp_cache (); pvoie->mess_recu = 1; pvoie->header = 0; ptmes->numero = numess; /* Supprime le message si datas en "SP SYSOP" */ if (data_sysop ()) { for (i = 0; i < NBMASK; i++) ptmes->fbbs[i] = ptmes->forw[i] = '\0'; ptmes->status = 'K'; clear_fwd (numess); } valmess (ptmes); ++nbmess; ins_iliste (ptmes); #ifdef __linux__ add_pfh (ptmes); #endif aff_msg_cons (); } void tst_ack (bullist * pbul) { int nb; int numlang = vlang; char temp; bullist psauve; char titre[90]; char texte[80]; char suite[80]; int mode = pvoie->binary; psauve = *pbul; if (pvoie->m_ack != 2) return; pvoie->m_ack = 0; set_binary (voiecur, 0); vlang = 0; if (*psauve.bbsv) { sprintf (suite, " - routed to %s", psauve.bbsv); } else *suite = '\0'; sprintf (titre, "ACK:%s", psauve.titre); sprintf (texte, "Msg %s@%s - %sz%s\032", psauve.desti, mycall, datheure_mbl (time (NULL) + _timezone), suite); vlang = numlang; ini_champs (voiecur); *ptmes->bbsf = '\0'; temp = *(pvoie->sta.indicatif.call); *(pvoie->sta.indicatif.call) = '@'; strn_cpy (6, ptmes->desti, psauve.exped); strn_cpy (6, ptmes->exped, mycall); n_cpy (60, ptmes->titre, titre); if (routage (psauve.numero)) { swapp_bbs (ptmes); ptmes->type = 'A'; ptmes->status = 'N'; reacheminement (); nb = strlen (texte); /* texte[nb] = '\032' ; */ get_mess_fwd ('\0', texte, nb, 2); } *(pvoie->sta.indicatif.call) = temp; *pbul = psauve; set_binary (voiecur, mode); } void tst_sysop (char *desti, long numero) { char buffer[80]; char sauv_ind[7]; bullist ptsauv = *ptmes; int mode = pvoie->binary; Msysop *sptr = mess_sysop; if (data_sysop ()) return; if ((sptr) && (strcmp (desti, "SYSOP") == 0)) { if (!find (ptmes->bbsv)) { set_binary (voiecur, 0); strn_cpy (6, sauv_ind, pvoie->sta.indicatif.call); strn_cpy (6, pvoie->sta.indicatif.call, "SYSOP"); while (sptr) { sprintf (buffer, "P %s", sptr->call); copy_mess (numero, buffer, '\032'); sptr = sptr->next; } strn_cpy (6, pvoie->sta.indicatif.call, sauv_ind); } } *ptmes = ptsauv; set_binary (voiecur, mode); } int get_mess_fwd (char clog, char *ptr, int nbcar, int type) { int ncars, debut = 1; int held = 0; long numess = 0L; obuf *msgtemp; char fin[2]; char *ptcur; char temp[128]; if ((msgtemp = pvoie->msgtete) != NULL) { while (msgtemp->suiv) msgtemp = msgtemp->suiv; } else { msgtemp = (obuf *) m_alloue (sizeof (obuf)); pvoie->msgtete = msgtemp; msgtemp->nb_car = msgtemp->no_car = 0; msgtemp->suiv = NULL; } ncars = msgtemp->nb_car; ptcur = msgtemp->buffer + ncars; while (nbcar--) { if (debut) { if ((pvoie->entete) && (*ptr == 'R') && (*(ptr + 1) == ':')) { analyse_header (voiecur, ptr); } else { pvoie->entete = 0; } if ((*ptr == '/') && (toupper (*(ptr + 1)) == 'A') && (toupper (*(ptr + 2)) == 'C')) { if (pvoie->m_ack == 1) { pvoie->m_ack = 2; } } check_bin (ptmes, ptr); if ((*ptr == '/') && (toupper (*(ptr + 1)) == 'A') && (toupper (*(ptr + 2)) == 'B')) { /* Message aborted */ texte (T_MBL + 21); type = 4; *ptr = '\32'; } if ((*ptr == '\32') || ((*ptr == '/') && (toupper (*(ptr + 1)) == 'E') && (toupper (*(ptr + 2)) == 'X'))) { int test; msgtemp->nb_car = ncars; if (type != 4) { /* Le BID existe ? -> message rejete ! */ if (((*ptmes->bid == '\0') || (*ptmes->bid == ' ')) && (((pvoie->mess_num != -1) && (*pvoie->mess_home)) || (*pvoie->mess_bid))) { make_bid (); if (deja_recu (ptmes, 1, &test) == 1) { type = 4; if (!(FOR (pvoie->mode))) texte (T_MBL + 45); } } if (pvoie->header) strn_cpy (6, ptmes->bbsf, pvoie->sta.indicatif.call); else *(ptmes->bbsf) = '\0'; ptmes->datesd = pvoie->messdate; ptmes->date = ptmes->datech = time (NULL); /* Mettre localtime ? */ if (type < 3) { /* Flush des buffers */ /* pdebug("(%d) create message file %s", voiecur, temp_name (voiecur, temp)); */ write_mess_temp (O_TEXT, voiecur); /* tester is hold ? */ if (is_held (temp_name (voiecur, temp))) held = 1; else { numess = ptmes->numero = next_num (); rename_temp (voiecur, mess_name (MESSDIR, numess, temp)); } } } switch (type) { case 0: if (!held) { put_mess_fwd (clog); tst_sysop (ptmes->desti, numess); tst_serveur (ptmes); tst_ack (ptmes); tst_warning (ptmes); } retour_menu ((pvoie->mbl) ? N_MBL : N_MENU); /* deconnexion si fin de message */ if (save_fic) pvoie->deconnect = 6; break; case 1: if (!held) { put_mess_fwd (clog); tst_sysop (ptmes->desti, numess); tst_serveur (ptmes); tst_ack (ptmes); tst_warning (ptmes); } maj_niv (pvoie->niv1, pvoie->niv2, 0); texte (T_MBL + 42); /* deconnexion si fin de message */ if (save_fic) pvoie->deconnect = 6; break; case 2: if (!held) { put_mess_fwd (clog); tst_sysop (ptmes->desti, numess); tst_serveur (ptmes); tst_ack (ptmes); tst_warning (ptmes); } /* deconnexion si fin de message */ if (save_fic) pvoie->deconnect = 6; break; case 3: del_temp (voiecur); libere (voiecur); break; case 4: del_temp (voiecur); libere (voiecur); if (voiecur != INEXPORT) retour_menu ((pvoie->mbl) ? N_MBL : N_MENU); break; } return (1); } } else { if (*ptr == '\32') { fin[0] = '\r'; fin[1] = '\32'; ptr = fin; nbcar = 1; debut = 1; } } if (*ptr == '\n') ++ptr; else { if (*ptr == '\r') { *ptr = '\n'; if ((nbcar > 0) && (*(ptr + 1) == '\n')) { --nbcar; ++ptr; } debut = 1; } else debut = 0; ++pvoie->memoc; ++(ptmes->taille); *ptcur++ = *ptr++; if (++ncars == 250) { msgtemp->nb_car = ncars; msgtemp->suiv = (obuf *) m_alloue (sizeof (obuf)); msgtemp = msgtemp->suiv; msgtemp->nb_car = msgtemp->no_car = ncars = 0; msgtemp->suiv = NULL; ptcur = msgtemp->buffer; } } } msgtemp->nb_car = ncars; if (pvoie->memoc > MAXMEM) { if (type != 3) write_mess_temp (O_TEXT, voiecur); else libere (voiecur); } return (0); } int mbl_hold (void) { long no; long temps; char holdname[130]; char filename[130]; if ((toupper (*indd) == 'O') && (droits (COSYSOP))) { ++indd; if (!teste_espace ()) { texte (T_ERR + 2); retour_mbl (); return (0); } if (((no = lit_chiffre (1)) != 0L) && (ch_record (NULL, no, ' ') != NULL) && (ptmes->status != 'A')) { mess_name (MESSDIR, no, filename); /* Cree un index du nom de fichier */ temps = time (NULL); if (hold_nb >= temps) ++hold_nb; else hold_nb = temps; for (;;) { hold_name (hold_nb, holdname); if (access (holdname, 0) != 0) { hold_temp (voiecur, filename, holdname, FALSE); break; } ++hold_nb; } ++nb_hold; texte (T_MBL + 59); /* Passe le message en status ARCHIVE caché ... */ ch_record (NULL, no, 'Z'); /* Supprime le message de la liste des fwd */ clear_fwd (no); aff_msg_cons (); /* Affiche cons + held */ } else texte (T_ERR + 10); retour_mbl (); return (0); } return (1); } fbb-7.0.10/src/fbb_orb.c0000644000175000017500000007057513613360505011617 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * Serveur de communication socket pour connection console * */ #include #include #include #include #include #include #include #include #include #define WAITINFO 0 #define WAITPASS 1 #define CONNECTED 2 #define DISCONNECT 3 extern void process (void); void orb_services (void); static void set_opt(char *command, char *value); /* extern void usleep(unsigned long); */ static int orb_fd = -1; typedef struct _OrbClient { int fd; int state; int monitor; int channel; int options; int infos; long mask; time_t cle; char callsign[12]; struct _OrbClient *next; } OrbClient; static OrbClient *client_head = NULL; static OrbClient *orb_add_client (void) { OrbClient *sptr; sptr = calloc (1, sizeof (OrbClient)); if (sptr == NULL) return (NULL); sptr->next = client_head; client_head = sptr; return (sptr); } static void orb_del_client (OrbClient * cptr) { OrbClient *sptr; OrbClient *prev; prev = NULL; sptr = client_head; while (sptr) { if (sptr == cptr) { if (prev) prev->next = sptr->next; else client_head = sptr->next; free (sptr); break; } prev = sptr; sptr = sptr->next; } } static int orb_new_connection (int fd) { unsigned addr_len; struct sockaddr_in sock_addr; memset(&sock_addr, 0x00, sizeof(struct sockaddr_in)); OrbClient *sptr; sptr = orb_add_client (); addr_len = sizeof (sock_addr); sptr->fd = accept (fd, (struct sockaddr *) &sock_addr, &addr_len); sptr->state = WAITINFO; return (sptr->fd); } static int send_data(int sock, char *datafile, char *datarequest, int len, int command) { int fd; int nb; char buffer[1024]; memset(buffer, 0x00, sizeof(buffer)); buffer[0] = ORB_DATA; buffer[1] = command; buffer[2] = len % 256; buffer[3] = len >> 8; memcpy(buffer+4, datarequest, len); write(sock, buffer, len+4); fd = open(datafile, O_RDONLY); if (fd == -1) { buffer[2] = 0; buffer[3] = 0; write(sock, buffer, 4); return errno; } for (;;) { nb = read(fd, buffer+4, 1000); if (nb < 0) nb = 0; buffer[2] = nb % 256; buffer[3] = nb >> 8; write(sock, buffer, nb+4); printf("%d data sent\n", nb); if (nb == 0) break; } close(fd); unlink(datafile); return 0; } static long flength(char *filename) { struct stat bstat; memset(&bstat, 0x00, sizeof(struct stat)); if (stat(filename, &bstat) == -1) return 0L; return bstat.st_size; } static int send_data_buf(OrbClient * sptr, int service, char *command, char *data, int datalen) { char buffer[1024]; int length; memset(buffer, 0x00, sizeof(buffer)); length = strlen(command); strcpy(buffer+4, command); if ((length + datalen + 4) > 1024) return -1; if (datalen) { memcpy(buffer+4+length, data, datalen); length += datalen; } buffer[0] = ORB_DATA; buffer[1] = service; buffer[2] = length & 0xff; buffer[3] = length >> 8; write(sptr->fd, buffer, 4+length); return length; } static void orb_process_data (OrbClient * sptr) { int i, j; int nb; int lg; static char buffer[1024]; static char datafile[256]; static char datarequest[1024]; static int nbrcv = 0; static int rcv_fd; static int rcv_state = 0; char call[256]; char pass[256]; char *ptr; memset(buffer, 0x00, sizeof(buffer)); memset(datafile, 0x00, sizeof(datafile)); memset(datarequest, 0x00, sizeof(datarequest)); memset(call, 0x00, sizeof(call)); memset(pass, 0x00, sizeof(pass)); lg = 0; nb = read (sptr->fd, buffer + nbrcv, sizeof (buffer) - nbrcv); if (nb == -1) return; if (nb == 0) { editor = 0; /* Client is disconnected */ if (sptr->mask & ORB_CONSOLE) { /* Disconnect from console */ deconnexion (CONSOLE, 0); } else { close (sptr->fd); orb_del_client (sptr); } nbrcv = 0; return; } nbrcv += nb; again: if ((nbrcv >= 3) && (buffer[0] == ORB_REQUEST)) { unsigned int len; int mask; int old_mask = sptr->mask; int ack; char cmd[300]; memset(cmd, 0x00, sizeof(cmd)); /*commande */ switch (buffer[1]) { case 0: /* Changement de masque */ mask = buffer[2] & 0xff; ack = 0; if ((mask & ORB_CONSOLE) != (sptr->mask & ORB_CONSOLE)) { if (mask & ORB_CONSOLE) { FILE *fptr; if ((fptr = fopen (d_disque ("etat.sys"), "r+t")) != NULL) { fprintf (fptr, "%-6s-%X\n", cons_call.call, cons_call.num); ferme (fptr, 74); } /* Console connection */ if (v_tell && connect_tell ()) { music (0); ack = 1; } else if (!connect_console ()) { ack = 2; } else { ack = 1; } } else { /* Console deconnection */ deconnexion (CONSOLE, 0); ack = 0; nbrcv = 0; return; } buffer[0] = ORB_XFBBX; buffer[1] = 0; buffer[2] = 1; buffer[3] = 0; buffer[4] = ack; write (sptr->fd, buffer, 5); } if (ack != 2) /* Don't update mask if connection refused */ { sptr->mask = mask; if ((mask & ORB_MSGS) != (old_mask & ORB_MSGS)) { reset_msgs (); aff_msg_cons (); } if ((mask & ORB_STATUS) != (old_mask & ORB_STATUS)) { FbbMem (1); test_pactor(1); } if ((mask & ORB_NBCNX) != (old_mask & ORB_NBCNX)) fbb_list (1); if ((mask & ORB_LISTCNX) != (old_mask & ORB_LISTCNX)) fbb_list (1); } lg = 3; break; case SVC_DIR: /* Dir request */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { int nb; buffer[nbrcv] = '\0'; sprintf(datafile, "%sclientdata.txt", back2slash(DATADIR)); nb = 1+sprintf(datarequest, "%s%s", back2slash(CONFDIR), buffer+4); sprintf(cmd, "ls -oA %s | awk '{ print substr($1,1,1),$4,$8,$5\"-\"$6\"-\"$7 }' > %s 2>&1", datarequest, datafile); printf("system %s\n", cmd); system(cmd); nb += 1+sprintf(datarequest + nb, "%ld", flength(datafile)); send_data(sptr->fd, datafile, datarequest, nb, SVC_DIR); } lg = len+4; break; case SVC_RECV: /* File request */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { buffer[nbrcv] = '\0'; sprintf(datafile, "%sclientdata.txt", back2slash(DATADIR)); nb = 1+sprintf(datarequest, "%s%s", back2slash(CONFDIR), buffer+4); sprintf(cmd, "cp %s %s", datarequest, datafile); printf("system %s\n", cmd); system(cmd); nb += 1+sprintf(datarequest + nb, "%ld", flength(datafile)); send_data(sptr->fd, datafile, datarequest, nb, SVC_RECV); } lg = len+4; break; case SVC_SEND: /* File receive */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len <= 1000) { switch (rcv_state) { case 0 : buffer[nbrcv] = '\0'; sprintf(datafile, "%sclientdata.txt", back2slash(DATADIR)); sprintf(datarequest, "%s%s", back2slash(CONFDIR), buffer+4); printf("receiving file %s\n", datafile); rcv_fd = open(datafile, O_CREAT|O_TRUNC|O_WRONLY, 0666); rcv_state = 1; break; case 1: if (len == 0) { char header[4]; /* End of file */ if (rcv_fd > 0) { close(rcv_fd); sprintf(cmd, "mv %s %s", datafile, datarequest); printf("system %s\n", cmd); system(cmd); test_fichiers = 1; } header[0] = ORB_DATA; header[1] = SVC_SEND; header[2] = 0; header[3] = 0; write(sptr->fd, header, 4); rcv_state = 0; break; } if (rcv_fd > 0) { nb = write(rcv_fd, buffer+4, len); printf("%d data received\n", len); if (nb <= 0) { close(rcv_fd); rcv_fd = -1; } } break; } } lg = len+4; break; case SVC_FWD: /* Pending forward request */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { char command[80]; char arg[80]; memset(command, 0x00, sizeof(command)); memset(arg, 0x00, sizeof(arg)); buffer[nbrcv] = '\0'; sscanf(buffer+4, "%s %s", command, arg); if (strcasecmp(command, "LIST") == 0) { sprintf(datafile, "%sclientdata.txt", back2slash(DATADIR)); strcpy(datarequest, "pending_forward.txt"); nb = 1+sprintf(datarequest, "%s%s", back2slash(CONFDIR), buffer+4); RequestPendingForward(datafile); nb += 1+sprintf(datarequest + nb, "%ld", flength(datafile)); send_data(sptr->fd, datafile, datarequest, nb, SVC_FWD); } else if (strcasecmp(command, "START") == 0) { sprintf(datarequest, "START %s", StartForward(atoi(arg))); send_data_buf(sptr, SVC_FWD, datarequest, NULL, 0); } else if (strcasecmp(command, "STOP") == 0) { sprintf(datarequest, "STOP %s", StopForward(atoi(arg))); send_data_buf(sptr, SVC_FWD, datarequest, NULL, 0); } } lg = len+4; break; case SVC_DISC: /* Disconnect request */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { char callsign[80]; int nChan; int bImm; int nb; memset(callsign, 0x00, sizeof(callsign)); buffer[nbrcv] = '\0'; nb = sscanf(buffer+4, "%d %s %d", &nChan, callsign, &bImm); if (nb == 3) disconnect_channel(nChan, bImm); } lg = len+4; break; case SVC_USER: /* users management */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { int length; char command[80]; char arg[80]; char *ptr; memset(command, 0x00, sizeof(command)); memset(arg, 0x00, sizeof(arg)); buffer[nbrcv] = '\0'; sscanf(buffer+4, "%s %s", command, arg); if (strcasecmp(command, "LIST") == 0) { sprintf(datafile, "%sclientdata.txt", back2slash(DATADIR)); strcpy(datarequest, "service.txt"); nb = 1+sprintf(datarequest, "%s%s", back2slash(CONFDIR), buffer+4); RequestUsersList(datafile); nb += 1+sprintf(datarequest + nb, "%ld", flength(datafile)); send_data(sptr->fd, datafile, datarequest, nb, SVC_USER); } else if (strcasecmp(command, "GET") == 0) { ptr = GetUserInfo(arg, &length); sprintf(datarequest, "USER %s %d\n", arg, length); send_data_buf(sptr, SVC_USER, datarequest, ptr, length); } else if (strcasecmp(command, "PUT") == 0) { int datalen = len; ptr = buffer+4; while (*ptr && (*ptr != '\n')) { ++ptr; --datalen; } if (*ptr == '\n') { ++ptr; PutUserInfo(arg, ptr, datalen); ptr = GetUserInfo(arg, &length); sprintf(datarequest, "USER %s %d\n", arg, length); send_data_buf(sptr, SVC_USER, datarequest, ptr, length); } } else if (strcasecmp(command, "NEW") == 0) { NewUserInfo(arg); ptr = GetUserInfo(arg, &length); sprintf(datarequest, "USER %s %d\n", arg, length); send_data_buf(sptr, SVC_USER, datarequest, ptr, length); } else if (strcasecmp(command, "DEL") == 0) { DelUserInfo(arg); } } lg = len+4; break; case SVC_MSG: /* messages management */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { int length; char command[80]; char arg[80]; char *ptr; memset(command, 0x00, sizeof(command)); memset(arg, 0x00, sizeof(arg)); buffer[nbrcv] = '\0'; sscanf(buffer+4, "%s %s", command, arg); if (strcasecmp(command, "LIST") == 0) { sprintf(datafile, "%sclientdata.txt", back2slash(DATADIR)); strcpy(datarequest, "service.txt"); nb = 1+sprintf(datarequest, "%s%s", back2slash(CONFDIR), buffer+4); RequestMsgsList(datafile); nb += 1+sprintf(datarequest + nb, "%ld", flength(datafile)); send_data(sptr->fd, datafile, datarequest, nb, SVC_MSG); } else if (strcasecmp(command, "GET") == 0) { ptr = GetMsgInfo(arg, &length); sprintf(datarequest, "MSG %s %d\n", arg, length); send_data_buf(sptr, SVC_MSG, datarequest, ptr, length); } else if (strcasecmp(command, "PUT") == 0) { int datalen = len; ptr = buffer+4; while (*ptr && (*ptr != '\n')) { ++ptr; --datalen; } if (*ptr == '\n') { ++ptr; PutMsgInfo(arg, ptr, datalen); ptr = GetMsgInfo(arg, &length); sprintf(datarequest, "MSG %s %d\n", arg, length); send_data_buf(sptr, SVC_MSG, datarequest, ptr, length); } } } lg = len+4; break; case SVC_MREQ: /* message request */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { char command[80]; char arg[80]; memset(command, 0x00, sizeof(command)); memset(arg, 0x00, sizeof(arg)); buffer[nbrcv] = '\0'; sscanf(buffer+4, "%s %s", command, arg); if (strcasecmp(command, "MSG") == 0) { sprintf(datafile, "%smessage.txt", back2slash(DATADIR)); mess_name(MESSDIR, atol(arg), datarequest); nb = 1+strlen(datarequest); sprintf(cmd, "cp %s %s", datarequest, datafile); printf("system %s\n", cmd); system(cmd); nb += 1+sprintf(datarequest + nb, "%ld", flength(datafile)); send_data(sptr->fd, datafile, datarequest, nb, SVC_MREQ); } } lg = len+4; break; case SVC_OPT: /* options management */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { char command[80]; char arg[80]; char val[80]; memset(command, 0x00, sizeof(command)); memset(arg, 0x00, sizeof(arg)); memset(val, 0x00, sizeof(val)); sptr->options = 1; buffer[nbrcv] = '\0'; *arg = *val = '\0'; sscanf(buffer+4, "%s %s %s", command, arg, val); if (strcasecmp(command, "GET") == 0) { orb_options(); } else if (strcasecmp(command, "SET") == 0) { set_opt(arg, val); } } lg = len+4; break; case SVC_PACTOR: /* pactor management */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { char command[80]; int val = 1; int port = 0; memset(command, 0x00, sizeof(command)); buffer[nbrcv] = '\0'; sscanf(buffer+4, "%s %d %d", command, &port, &val); if (strcasecmp(command, "SCAN") == 0) { CmdScan(port, val); } else if (strcasecmp(command, "CHO") == 0) { CmdCHO(port, 1); } else if (strcasecmp(command, "BRK") == 0) { CmdCHO(port, 0); } } lg = len+4; break; case SVC_INFO: /* channel information */ if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; if (sptr->state != CONNECTED) return; if (len < 256) { char command[80]; int val = -1; memset(command, 0x00, sizeof(command)); buffer[nbrcv] = '\0'; sscanf(buffer+4, "%s %d", command, &val); sptr->infos = (val != -1); set_info_channel(val); } lg = len+4; break; default: if (nbrcv < 4) return; len = ((unsigned int) buffer[3] << 8) + (unsigned int) buffer[2]; if (nbrcv < len+4) return; lg = len+4; break; } } else { char *endptr; /* Check if the whole line is received */ buffer[nbrcv] = '\0'; endptr = strrchr (buffer, '\n'); if (endptr == NULL) return; editor = 0; lg = 1 + endptr - buffer; switch (sptr->state) { case WAITINFO: /* Mask of services */ sscanf (buffer, "%ld %d %s", &sptr->mask, &sptr->channel, call); call[11] = '\0'; strcpy (sptr->callsign, call); sptr->cle = time (NULL); sprintf (call, "%010ld", sptr->cle); write (sptr->fd, call, strlen (call)); sptr->state = WAITPASS; break; case WAITPASS: /* Callsign sans SSID */ strcpy (call, sptr->callsign); if ((ptr = strchr (call, '-'))) *ptr = '\0'; /* Password */ sscanf (buffer, "%s", pass); if (comp_passwd (call, pass, sptr->cle)) { orb_services(); cons_call.num = extind (strupr (sptr->callsign), cons_call.call); reset_msgs (); FbbMem (1); aff_msg_cons (); fbb_list (1); test_pactor(1); if (sptr->mask & ORB_CONSOLE) { FILE *fptr; if ((fptr = fopen (d_disque ("etat.sys"), "r+t")) != NULL) { fprintf (fptr, "%-6s-%X\n", cons_call.call, cons_call.num); ferme (fptr, 74); } /* Console connection */ if (v_tell && connect_tell ()) { music (0); } else if (!connect_console ()) { char *txt = "Console already connected !\n\n"; int len = strlen (txt) + 3; strcpy (buffer + 7, txt); /* Header */ buffer[0] = ORB_CONSOLE; buffer[1] = 0; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; buffer[4] = CONSOLE; buffer[5] = W_CNST; buffer[6] = 0; write (sptr->fd, buffer, len + 4); close (sptr->fd); orb_del_client (sptr); break; /* F6BVP */ } } sptr->state = CONNECTED; rcv_state = 0; } else { char *txt = "Callsign/Password error !\n\n"; int len = strlen (txt) + 3; strcpy (buffer + 7, txt); /* Header */ buffer[0] = ORB_CONSOLE; buffer[1] = 0; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; buffer[4] = CONSOLE; buffer[5] = W_CNST; buffer[6] = 0; write (sptr->fd, buffer, len + 4); close (sptr->fd); orb_del_client (sptr); } break; case CONNECTED: if (sptr->mask & ORB_CONSOLE) { for (i = 0, j = 0; i < nbrcv; i++) { if (buffer[i] == '\r') continue; if (buffer[i] == '\n') buffer[j++] = '\r'; else buffer[j++] = buffer[i]; } console_inbuf (buffer, j); } break; } } if (lg < nbrcv) { nbrcv -= lg; memmove(buffer, buffer+lg, nbrcv); goto again; } nbrcv = 0; } static void orb_process (void) { int nb; int maxfd; fd_set tcp_read; fd_set tcp_write; fd_set tcp_excep; struct timeval to; OrbClient *sptr; if (orb_fd == -1) return; to.tv_sec = to.tv_usec = 0; FD_ZERO (&tcp_read); FD_ZERO (&tcp_write); FD_ZERO (&tcp_excep); maxfd = orb_fd; FD_SET (orb_fd, &tcp_read); sptr = client_head; while (sptr) { FD_SET (sptr->fd, &tcp_read); if (sptr->fd > maxfd) maxfd = sptr->fd; sptr = sptr->next; } nb = select (maxfd + 1, &tcp_read, NULL, NULL, &to); if (nb == -1) { perror ("orb_select"); return; } if (nb == 0) { /* nothing to do */ return; } /* To avoid network locks */ alarm(60); if (FD_ISSET (orb_fd, &tcp_read)) { /* New client connection */ orb_new_connection (orb_fd); } sptr = client_head; while (sptr) { /* On sauvegarde le next car le pointeur de client peut etre * libere pendant le traitement en cas de deconnexion */ OrbClient *ptemp = sptr->next; if (FD_ISSET (sptr->fd, &tcp_read)) { orb_process_data (sptr); is_idle = 0; } sptr = ptemp; } alarm(0); return; } int fbb_orb (char *service, int port) { int val; int len; struct sockaddr_in sock_addr; memset(&sock_addr, 0x00, sizeof(struct sockaddr_in)); if ((orb_fd = socket (AF_INET, SOCK_STREAM, 0)) < 0) { perror ("socket_r"); return (0); } val = 1; len = sizeof (val); if (setsockopt (orb_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &val, len) == -1) { perror ("opn_tcp : setsockopt SO_REUSEADDR"); } sock_addr.sin_family = AF_INET; sock_addr.sin_addr.s_addr = 0; sock_addr.sin_port = htons (port); if (bind (orb_fd, (struct sockaddr *) &sock_addr, sizeof (sock_addr)) != 0) { perror ("opn_tcp : bind"); close (orb_fd); return (0); } if (listen (orb_fd, SOMAXCONN) == -1) { perror ("listen"); close (orb_fd); return (0); } fprintf (stderr, "xfbbC/X server running ...\n"); fprintf (stderr, "xfbbd ready and running ...\n"); fflush (stderr); for (;;) { orb_process (); process (); if (is_idle) { usleep (1); } else { is_idle = 1; } } return 1; } static void orb_send_data (char *buffer, int lg, int mask) { OrbClient *sptr = client_head; while (sptr) { if (sptr->mask & mask) { switch (mask) { case ORB_MONITOR: case ORB_CONSOLE: case ORB_CHANNEL: if (((mask == ORB_MONITOR) && (buffer[4] == 0xff)) || ((mask == ORB_CONSOLE) && (buffer[4] == 0))) { write (sptr->fd, buffer, lg); } /* if ((mask == ORB_CHANNEL) && (buffer[4] > 0) && (buffer[4] < 0xff)) */ if (mask == ORB_CHANNEL) { if ((sptr->channel == 0) || (sptr->channel == buffer[4])) write (sptr->fd, buffer, lg); } break; case ORB_XFBBX: if (sptr->mask & ORB_CONSOLE) write (sptr->fd, buffer, lg); break; default: write (sptr->fd, buffer, lg); break; } } sptr = sptr->next; } } void orb_write (int channel, char *data, int len, int color, int header) { int i, j; char *buffer; buffer = calloc ((len + 8), sizeof (char)); if (buffer == NULL) return; for (i = 0, j = 7; i < len; i++) { if (data[i] == '\n') continue; if (data[i] == '\r') buffer[j++] = '\n'; else buffer[j++] = data[i]; } if (channel == CONSOLE) { /* Editor request ? */ if (editor_request) { int len = 1; char buf[80]; memset(buf, 0, sizeof(buf)); editor_request = 0; editor = 1; buf[0] = ORB_XFBBX; buf[1] = 0; buf[3] = 0; switch (reply) { case 1 : /* SR */ len += sprintf(buf+5, "%ld", svoie[CONSOLE]->enrcur); buf[4] = 4; break; case 3 : /* Sx */ buf[4] = 3; break; default: buf[4] = 0; break; } buf[2] = len; orb_send_data (buf, 4+len, ORB_XFBBX); } /* Header */ buffer[0] = ORB_CONSOLE; buffer[1] = 0; buffer[2] = (j - 4) & 0xff; buffer[3] = (j - 4) >> 8; /* Envoie les data de console au client */ buffer[4] = CONSOLE; buffer[5] = color; buffer[6] = header; orb_send_data (buffer, j, ORB_CONSOLE); } else if (channel == MMONITOR) { /* Header */ buffer[0] = ORB_MONITOR; buffer[1] = 0; buffer[2] = (j - 4) & 0xff; buffer[3] = (j - 4) >> 8; /* Envoie les data de monitoring au client */ buffer[4] = 0xff; buffer[5] = color; buffer[6] = header; orb_send_data (buffer, j, ORB_MONITOR); } else { /* Header */ buffer[0] = ORB_CHANNEL; buffer[1] = 0; buffer[2] = (j - 4) & 0xff; buffer[3] = (j - 4) >> 8; /* Envoie les data de monitoring au client */ buffer[4] = channel - 1; buffer[5] = color; buffer[6] = header; orb_send_data (buffer, j, ORB_CHANNEL); } free (buffer); } void orb_disc (void) { OrbClient *sptr = client_head; /* Deconnecte un client */ while (sptr) { if (sptr->mask & ORB_CONSOLE) { if (sptr->mask & ORB_XFBBX) { char buffer[5]; /* Envoie la commande de deconnection */ buffer[0] = ORB_XFBBX; buffer[1] = 0; buffer[2] = 1; buffer[3] = 0; buffer[4] = 0; write (sptr->fd, buffer, 5); sptr->mask &= ~ORB_CONSOLE; } else { close (sptr->fd); orb_del_client (sptr); } break; } sptr = sptr->next; } } void orb_services (void) { char buffer[260]; int i; memset(buffer, 0, sizeof(buffer)); /* Header */ buffer[0] = ORB_DATA; buffer[1] = SVC_LIST; buffer[2] = SVC_MAX-1; /* Max 255 services */ buffer[3] = 0; /* One service per byte */ for (i = 1 ; i < SVC_MAX ; i++) buffer[4 + i - 1] = i; orb_send_data (buffer, 4 + SVC_MAX - 1, 0xffff); } void orb_con_list (int channel, char *ligne) { char buffer[256]; int len = strlen (ligne); memset(buffer, 0, sizeof(buffer)); /* Header */ buffer[0] = ORB_LISTCNX; buffer[1] = 0; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; /* Envoie la ligne de connection du canal */ strcpy (buffer + 4, ligne); orb_send_data (buffer, len + 4, ORB_LISTCNX); } void orb_pactor_status(int port, int p_status) { char buffer[80]; int len; sprintf (buffer + 4, "%d %d", port, p_status); len = strlen (buffer + 4); /* Header */ buffer[0] = ORB_DATA; buffer[1] = SVC_PACTOR; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; /* Send pactor status */ orb_send_data (buffer, len + 4, ORB_STATUS); } void orb_con_nb (int nb) { char buffer[80]; int len; memset(buffer, 0, sizeof(buffer)); sprintf (buffer + 4, "%d", nb); len = strlen (buffer + 4); /* Header */ buffer[0] = ORB_NBCNX; buffer[1] = 0; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; /* Envoie le nombre de connections */ orb_send_data (buffer, len + 4, ORB_NBCNX); } void orb_nb_msg (int priv, int hold, int nbmess) { char buffer[80]; int len; memset(buffer, 0, sizeof(buffer)); sprintf (buffer + 4, "%d %d %d", priv, hold, nbmess); len = strlen (buffer + 4); /* Header */ buffer[0] = ORB_MSGS; buffer[1] = 0; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; /* Envoie le nombre de messages */ orb_send_data (buffer, len + 4, ORB_MSGS); } void orb_status (long lmem, long gmem, long disk1, long disk2) { char buffer[80]; int len; memset(buffer, 0, sizeof(buffer)); sprintf (buffer + 4, "%ld %ld %ld %ld", lmem, gmem, disk1, disk2); len = strlen (buffer + 4); /* Header */ buffer[0] = ORB_STATUS; buffer[1] = 0; buffer[2] = (len) & 0xff; buffer[3] = (len) >> 8; /* Envoie les infos de status */ orb_send_data (buffer, len + 4, ORB_STATUS); } static void set_opt(char *command, char *value) { int val = atoi(value); int ok = 1; switch(*command) { case 'B' : bip = val; break; case 'G' : gate = val; break; case 'M' : sed = val; break; case 'T' : ok_tell = val; break; case 'X' : aff_inexport = val; break; case 'P' : aff_popsmtp = val; break; default : ok = 0; break; } if (ok) maj_options(); } void orb_options(void) { OrbClient *sptr = client_head; char *command = "OPT\n"; char buffer[256]; int nb = 0; memset(buffer, 0, sizeof(buffer)); nb += sprintf(buffer+nb, "B %d Connection bip\n", (bip) ? 1 : 0); nb += sprintf(buffer+nb, "G %d Gateway\n", (gate) ? 1 : 0); nb += sprintf(buffer+nb, "M %d Message Editor\n", (sed) ? 1 : 0); nb += sprintf(buffer+nb, "T %d Talk\n", (ok_tell) ? 1 : 0); nb += sprintf(buffer+nb, "X %d Im/export display\n", (aff_inexport) ? 1 : 0); nb += sprintf(buffer+nb, "P %d POP/SMTP display\n", (aff_popsmtp) ? 1 : 0); while (sptr) { /* Send information only to the right clients */ if (sptr->options) send_data_buf(sptr, SVC_OPT, command, buffer, nb); sptr = sptr->next; } } void orb_info(int val, char *str) { static char buffer[512]; static int nb = 0; memset(buffer, 0, sizeof(buffer)); if (str) { nb += sprintf(buffer+nb, "%d %s\n", val, str); } else if (nb > 0) { OrbClient *sptr = client_head; char *command = "INFO\n"; while (sptr) { /* Send information only to the right clients */ if (sptr->infos) send_data_buf(sptr, SVC_INFO, command, buffer, nb); sptr = sptr->next; } nb = 0; } } fbb-7.0.10/src/trajovl.c0000644000175000017500000002547013613360505011677 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * MODULE TRAJECTOGRAPHIE (OVELAY) */ #include static void affiche_param (satel *); static void ecrit_sat (satel *); static void supprime_sat (void); static void vis_param (satel *); /* * CARACTERISTIQUES SATELLITE */ void carac_satel (void) { int i; FILE *fptr; satel bufsat; char satstr[80]; if ((i = selection_sat ()) == -1) return; fptr = ouvre_sat (); pvoie->enrcur = (long) sizeof (bufsat) * (long) i; fflush (fptr); if (pvoie->enrcur < filelength (fileno (fptr))) { fseek (fptr, pvoie->enrcur, 0); fread ((char *) &bufsat, sizeof (bufsat), 1, fptr); sprintf (satstr, "SAT\\%ld.SAT", bufsat.cat); if (!outfichs (d_disque (satstr))) { texte (T_TRJ + 12); } } ferme (fptr, 25); maj_niv (6, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } /* * SAISIE PARAMETRES SATELLITE */ void modif_satel (void) { char c; int i; satel bufsat; FILE *fptr; switch (pvoie->niv3) { case 0: if ((i = selection_sat ()) == -1) break; if (i < 0) { texte (T_ERR + 0); menu_sat (); } else { fptr = ouvre_sat (); pvoie->enrcur = (long) sizeof (bufsat) * (long) i; fflush (fptr); if (pvoie->enrcur < filelength (fileno (fptr))) { fseek (fptr, pvoie->enrcur, 0); fread ((char *) &bufsat, sizeof (bufsat), 1, fptr); vis_param (&bufsat); ptmes->date = bufsat.maj; pvoie->temp1 = 0; texte (T_TRJ + 13); var_cpy (0, bufsat.dd); texte (T_MBL + 30); } else { fflush (fptr); pvoie->enrcur = filelength (fileno (fptr)); pvoie->temp1 = 1; texte (T_QST + 4); } maj_niv (6, 9, 2); ferme (fptr, 25); } break; case 2: c = toupper (*indd); if (pvoie->temp1) { /* Creation */ if (c == Oui) { texte (T_TRJ + 14); maj_niv (6, 9, 3); } else if (c == Non) { maj_niv (6, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QST + 4); } } else { /* Suppression */ if (c == Non) { texte (T_TRJ + 14); maj_niv (6, 9, 3); } else if (c == Oui) { /* Supprime le record */ supprime_sat (); maj_niv (6, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); } else { texte (T_ERR + 0); texte (T_QST + 1); } } break; case 3: lit_sat (&bufsat); i = 0; bufsat.maj = time (NULL); if (ISPRINT (*indd)) { while (ISGRAPH (*indd)) bufsat.dd[i++] = toupper (*indd++); bufsat.dd[i] = '\0'; } ecrit_sat (&bufsat); texte (T_TRJ + 15); maj_niv (6, 9, 4); break; case 4: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.k0 = atol (indd); ecrit_sat (&bufsat); texte (T_TRJ + 16); maj_niv (6, 9, 5); break; case 5: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.y3 = atoi (indd); ecrit_sat (&bufsat); texte (T_TRJ + 17); maj_niv (6, 9, 6); break; case 6: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.d3 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 18); maj_niv (6, 9, 7); break; case 7: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.m0 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 19); maj_niv (6, 9, 8); break; case 8: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.w0 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 20); maj_niv (6, 9, 9); break; case 9: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.o0 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 21); maj_niv (6, 9, 10); break; case 10: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.i0 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 22); maj_niv (6, 9, 11); break; case 11: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.e0 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 23); maj_niv (6, 9, 12); break; case 12: lit_sat (&bufsat); if (ISGRAPH (*indd)) { bufsat.n0 = atof (indd); bufsat.a0 = 0.0; } ecrit_sat (&bufsat); texte (T_TRJ + 24); maj_niv (6, 9, 13); break; case 13: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.q3 = atof (indd); ecrit_sat (&bufsat); texte (T_TRJ + 25); maj_niv (6, 9, 14); break; case 14: lit_sat (&bufsat); if (ISGRAPH (*indd)) bufsat.pas = atoi (indd); ecrit_sat (&bufsat); texte (T_TRJ + 26); maj_niv (6, 9, 15); break; case 15: lit_sat (&bufsat); if (ISGRAPH (*indd)) { bufsat.f1 = atof (indd); bufsat.v1 = 0.0; } ecrit_sat (&bufsat); texte (T_QST + 2); maj_niv (6, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); break; default: fbb_error (ERR_NIVEAU, "MODIF-SAT", pvoie->niv3); break; } } static void supprime_sat (void) { FILE *fptr; FILE *tptr; satel bufsat; char temp[128]; long pos = 0L; if ((tptr = fopen (temp_name (voiecur, temp), "wb")) == NULL) return; if ((fptr = fopen (d_disque ("SAT\\SATEL.DAT"), "rb")) != NULL) { while (fread ((char *) &bufsat, sizeof (satel), 1, fptr)) { if (pos != pvoie->enrcur) fwrite ((char *) &bufsat, sizeof (satel), 1, tptr); pos += (long) sizeof (satel); } ferme (fptr, 27); } ferme (tptr, 28); rename_temp (voiecur, d_disque ("SAT\\SATEL.DAT")); /* Le fichier est mis en place */ } static void ecrit_sat (satel * bufsat) { FILE *fptr; fptr = ouvre_sat (); fseek (fptr, pvoie->enrcur, 0); fwrite ((char *) bufsat, sizeof (*bufsat), 1, fptr); ferme (fptr, 27); } void param_satel (void) { int i; satel bufsat; FILE *fptr; switch (pvoie->niv3) { case 0: if ((i = selection_sat ()) == -1) break; else { fptr = ouvre_sat (); pvoie->enrcur = (long) sizeof (bufsat) * (long) i; fflush (fptr); if ((i < 0) || (pvoie->enrcur >= filelength (fileno (fptr)))) { ferme (fptr, 28); texte (T_ERR + 0); menu_sat (); } else { fseek (fptr, pvoie->enrcur, 0); fread ((char *) &bufsat, sizeof (bufsat), 1, fptr); ferme (fptr, 29); if (*(bufsat.dd)) { affiche_param (&bufsat); retour_menu (N_TRAJ); } else { texte (T_ERR + 3); menu_sat (); } } } break; default: fbb_error (ERR_NIVEAU, "PARAM-SAT", pvoie->niv3); break; } } static void affiche_param (satel * bufsat) { lit_sat (bufsat); vis_param (bufsat); } static void vis_param (satel * bufsat) { var_cpy (0, bufsat->dd); sprintf (varx[1], "%ld", bufsat->cat); texte (T_TRJ + 27); sprintf (varx[0], "%5ld", bufsat->k0); texte (T_TRJ + 28); sprintf (varx[0], "%5d", bufsat->y3); texte (T_TRJ + 29); sprintf (varx[0], "%14.8f", bufsat->d3); texte (T_TRJ + 30); sprintf (varx[0], "%14.8f", bufsat->m0); texte (T_TRJ + 31); sprintf (varx[0], "%14.8f", bufsat->w0); texte (T_TRJ + 32); sprintf (varx[0], "%14.8f", bufsat->o0); texte (T_TRJ + 33); sprintf (varx[0], "%14.8f", bufsat->i0); texte (T_TRJ + 34); sprintf (varx[0], "%14.8f", bufsat->e0); texte (T_TRJ + 35); sprintf (varx[0], "%14.8f", bufsat->n0); texte (T_TRJ + 36); sprintf (varx[0], "%14.8f", bufsat->q3); texte (T_TRJ + 37); sprintf (varx[0], "%5d", bufsat->pas); texte (T_TRJ + 38); } void lit_sat (satel * bufsat) { FILE *fptr; fptr = ouvre_sat (); fseek (fptr, pvoie->enrcur, 0); fread ((char *) bufsat, sizeof (*bufsat), 1, fptr); ferme (fptr, 26); } int test_date (char *ptr) { char *sptr = ptr; int j, m, a; struct tm *sdate; long temps = time (NULL); sdate = gmtime (&temps); if (!ISGRAPH (*ptr)) { sprintf (ptr, "%02d/%02d/%02d", sdate->tm_mday, sdate->tm_mon + 1, sdate->tm_year % 100); outln (ptr, strlen (ptr)); } if (!isdigit (*ptr)) return (FALSE); while (isdigit (*ptr)) ++ptr; if ((!*ptr) || (isalnum (*ptr))) return (FALSE); *ptr++ = ' '; if (!isdigit (*ptr)) return (FALSE); while (isdigit (*ptr)) ++ptr; if ((!*ptr) || (isalnum (*ptr))) return (FALSE); *ptr++ = ' '; if (!isdigit (*ptr)) return (FALSE); while (isdigit (*ptr)) ++ptr; if (!ISGRAPH (*ptr)) { sscanf (sptr, "%d %d %d", &j, &m, &a); if ((j < 1) || (j > 31)) return (FALSE); if ((m < 1) || (m > 12)) return (FALSE); if ((a > 99) && (a < 1980 || a > 2030)) return (FALSE); return (TRUE); } return (FALSE); } int test_heure (char *ptr) { char *sptr = ptr; int h, m; struct tm *sdate; long temps = time (NULL); sdate = gmtime (&temps); if (!ISGRAPH (*ptr)) { sprintf (ptr, "%02d:%02d", sdate->tm_hour, sdate->tm_min); outln (ptr, strlen (ptr)); } if (!isdigit (*ptr)) return (FALSE); while (isdigit (*ptr)) ++ptr; if ((!*ptr) || (isalnum (*ptr))) return (FALSE); *ptr++ = ' '; if (!isdigit (*ptr)) return (FALSE); while (isdigit (*ptr)) ++ptr; if (!ISGRAPH (*ptr)) { sscanf (sptr, "%d %d", &h, &m); if ((h < 0) || (h > 23)) return (FALSE); if ((m < 0) || (m > 59)) return (FALSE); return (TRUE); } return (FALSE); } void menu_sat (void) { int i = 0; satel bufsat; FILE *fptr; char satstr[80]; FILE *fptr2; cr (); fptr = ouvre_sat (); while (fread ((char *) &bufsat, sizeof (bufsat), 1, fptr)) { sprintf (varx[0], "%3d", i++); sprintf (varx[1], "%-17s", bufsat.dd); sprintf (satstr, "sat\\%ld.sat", bufsat.cat); if ((fptr2 = fbb_fopen( d_disque (satstr),"r+b")) != NULL) { strcat (varx[0]," *"); } else strcat (varx[0]," "); texte (T_TRJ + 39); if ((i % 3) == 0) cr_cond (); } ferme (fptr, 30); if (i % 3) cr_cond (); texte (T_TRJ + 40); texte (T_QST + 5); } int selection_sat (void) { int i; switch (toupper (*indd)) { case '\0': texte (T_QST + 5); return (-1); case 'L': case 'W': menu_sat (); return (-1); case 'F': maj_niv (pvoie->niv1, 0, 0); prompt (pvoie->finf.flags, pvoie->niv1); return (-1); default: if (isdigit (*indd)) { i = atoi (indd); return (i); } texte (T_ERR + 0); texte (T_QST + 5); return (-1); } } void trajec (void) { switch (pvoie->niv2) { case 0: menu_trajec (); break; case 1: trajecto (); break; case 2: param_satel (); break; case 3: carac_satel (); break; case 9: modif_satel (); break; default: fbb_error (ERR_NIVEAU, "TRAJEC", pvoie->niv2); break; } } fbb-7.0.10/src/arbre.c0000644000175000017500000001664013613360505011310 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /* * ARBRE.C * */ #include static void aff_ind (char *, char *); void end_arbre (void) { bloc_indic *bptr; iliste *temp; iliste *c_iliste = t_iliste.suiv; /* Libere l'arbre des indicatifs */ while (racine) { bptr = racine; racine = racine->suiv; m_libere (bptr, sizeof (bloc_indic)); } /* Libere la liste des indicatifs balise */ while (c_iliste) { temp = c_iliste; c_iliste = c_iliste->suiv; m_libere (temp, sizeof (iliste)); } t_iliste.suiv = NULL; } ind_noeud *insnoeud (char *indic_om, unsigned *no_indic) { int i; int trouve = 0; char om[10]; char *ptr_om = om; int offset = 0; unsigned num_ind = 0; bloc_indic *bptr = racine; static ind_noeud *pnoeud; i = 0; while ((*ptr_om++ = *indic_om++) != '\0') { if (i++ == 9) { *ptr_om = '\0'; break; } } while (bptr) { pnoeud = &(bptr->st_ind[offset]); if (*(pnoeud->indic) == '\0') break; if (strncmp (om, pnoeud->indic, 6) == 0) { trouve = 1; break; } if (++offset == T_BLOC_INFO) { if (!bptr->suiv) bptr->suiv = new_bloc_info (); bptr = bptr->suiv; offset = 0; } ++num_ind; } if (!trouve) { n_cpy (6, pnoeud->indic, om); pnoeud->coord = 0xffff; pnoeud->nbmess = (short) 0; pnoeud->nbnew = (short) 0; pnoeud->val = 1; } *no_indic = num_ind; return (pnoeud); } /* * Pointe sur le dernier bloc */ bloc_mess *last_dir () { bloc_mess *temp = tete_dir; while (temp->suiv) temp = temp->suiv; /* aller au dernier bloc */ return (temp); } /* * Pointe sur le bloc precedent */ bloc_mess *prec_dir (bloc_mess * bptr) { bloc_mess *temp = tete_dir; while (temp->suiv) { if (temp->suiv == bptr) return (temp); temp = temp->suiv; } return (NULL); } /* * Insere un message dans la liste de directory */ int insmess (unsigned r, unsigned num_ind, long numero) { int i; bloc_mess *temp = tete_dir; while (temp->suiv) temp = temp->suiv; /* aller au dernier bloc */ for (i = 0; ((i < T_BLOC_MESS) && (temp->st_mess[i].nmess)); i++) ; if (i == T_BLOC_MESS) { temp->suiv = new_bloc_mess (); temp = temp->suiv; i = 0; } temp->st_mess[i].nmess = numero; temp->st_mess[i].noenr = r; temp->st_mess[i].no_indic = num_ind; return (1); } /* * Cherche un message deja insere dans la liste de directory */ mess_noeud *findmess (long numero) { int i; bloc_mess *temp = tete_dir; if (numero == 0L) return (NULL); while (temp->suiv) { if (temp->suiv->st_mess[0].nmess > numero) break; temp = temp->suiv; } for (i = 0; i < T_BLOC_MESS; i++) { if (temp->st_mess[i].nmess == numero) return (&temp->st_mess[i]); } return (NULL); } /* * Valide un message deja insere dans la liste de directory */ void valmess (bullist * bptr) { mess_noeud *mptr; if ((mptr = findmess (bptr->numero)) != NULL) { ouvre_dir (); write_dir (mptr->noenr, bptr); ferme_dir (); insarbre (bptr); } } /* * Change le numero du destinataire d'un message dans la liste de directory */ void chg_mess (unsigned num_ind, long numero) { mess_noeud *mptr; if ((mptr = findmess (numero)) != NULL) mptr->no_indic = num_ind; } unsigned insarbre (bullist * pbuf) { char temp[2]; unsigned no_indic; ind_noeud *noeud; if ((pbuf->status == 'A') || (pbuf->status == 'K')) return (0xffff); if (isdigit (pbuf->type)) { temp[0] = pbuf->type; temp[1] = '\0'; noeud = insnoeud (temp, &no_indic); } else { noeud = insnoeud (pbuf->desti, &no_indic); } if (pbuf->status != 'H') { ++(noeud->nbmess); if (pbuf->status == 'N') ++(noeud->nbnew); } return (no_indic); } void inscoord (unsigned r, info * pbuf, ind_noeud * pnoeud) { char om[80]; char *indic_om = pbuf->indic.call; char *ptr_om = om; if ((isdigit (*indic_om)) && (strlen (indic_om) == 1)) { strcpy (om, indic_om); } else { while ((*ptr_om++ = *indic_om++) != '\0'); } n_cpy (6, pnoeud->indic, om); pnoeud->coord = r; pnoeud->val = (uchar) (EXC (pbuf->flags) == 0); pnoeud->nbmess = (short) 0; pnoeud->nbnew = (short) 0; } void connexion (int voie) { svoie[voie]->ncur = insnoeud (svoie[voie]->sta.indicatif.call, &(svoie[voie]->no_indic)); aff_nbsta (); } ind_noeud *cher_noeud (char *indic_om) { int trouve = 0; int offset = 0; bloc_indic *bptr = racine; ind_noeud *pnoeud = NULL; while (bptr) { pnoeud = &(bptr->st_ind[offset]); if (*(pnoeud->indic) == '\0') break; if (strncmp (indic_om, pnoeud->indic, 6) == 0) { trouve = 1; break; } if (++offset == T_BLOC_INFO) { bptr = bptr->suiv; offset = 0; } } if (!trouve) pnoeud = NULL; return (pnoeud); } unsigned chercoord (char *indic_om) { ind_noeud *noeud = cher_noeud (indic_om); if (noeud) return (noeud->coord); else return (0xffff); } /* * Liste des destinataires prives -> balise */ void ins_iliste (bullist * buf) { int cmp; iliste *temp, *prec; iliste *c_iliste = &t_iliste; if ((*buf->bbsv) && (!hiecmp (mypath, buf->bbsv))) return; if (buf->status == 'H') return; if ((buf->type == 'P') && (buf->status != 'N')) return; if (strcmp (buf->desti, "WP") == 0) return; if ((buf->type != 'P') && ( (balbul == 0) || (buf->status == 'X') || (buf->status == 'K') || (buf->status == 'A') )) return; prec = c_iliste; while ((c_iliste = c_iliste->suiv) != NULL) { cmp = strcmp (c_iliste->indic, buf->desti); if (cmp == 0) return; if (cmp > 0) break; prec = c_iliste; } temp = (iliste *) m_alloue (sizeof (iliste)); prec->suiv = temp; temp->suiv = c_iliste; strcpy (temp->indic, buf->desti); } void list_new (char *chaine) { iliste *prec; int flag_l, nombre = max_indic; ind_noeud *noeud; unsigned num_indic; *chaine = '\0'; flag_l = FALSE; while (nombre) { if (t_iliste.suiv == NULL) break; prec = p_iliste; if (p_iliste == &t_iliste) flag_l = TRUE; p_iliste = p_iliste->suiv; if (p_iliste == NULL) { p_iliste = &t_iliste; if (flag_l) break; continue; } noeud = insnoeud (p_iliste->indic, &num_indic); if (noeud->nbnew == 0) { prec->suiv = p_iliste->suiv; m_libere (p_iliste, sizeof (iliste)); p_iliste = prec; continue; } aff_ind (noeud->indic, chaine); nombre--; } if (*chaine == '\0') strcpy (chaine, " None"); } static void aff_ind (char *indptr, char *indch) { strcat (indch, " "); strcat (indch, indptr); } bloc_indic *new_bloc_info (void) { int i; bloc_indic *bptr = (bloc_indic *) m_alloue (sizeof (bloc_indic)); bptr->suiv = NULL; for (i = 0; i < T_BLOC_INFO; i++) *(bptr->st_ind[i].indic) = '\0'; return (bptr); } fbb-7.0.10/src/drv_aea.c0000644000175000017500000002617313613360505011620 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ #include static void pk_check (int port); static int pk_inbuf (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ptr); static int pk_read (int port, char *buffer); static int pk_send (int port, int canal, int type, char *chaine, int len); static int pk_send_ok (int port, int canal, int type, char *buffer, int len); static int pk_send_ui (int port, char *buffer, int len, Beacon * beacon); static int pk_stat (int port, int canal, stat_ch * ptr); static void pk_get_ui (int port, char *buffer, ui_header * ui); int sta_aea (int port, int canal, int cmd, void *ptr) { switch (cmd) { case TNCSTAT: return (pk_stat (port, canal, (stat_ch *) ptr)); case SNDCMD: case ECHOCMD: return (pk_send (port, canal, 1, (char *) ptr, strlen (ptr))); case PORTCMD: return (pk_send (port, 0xf, 1, ptr, strlen (ptr))); } return (0); } int rcv_aea (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ptr) { int val; val = pk_inbuf (port, canal, cmd, buffer, len, ptr); return (val); } int snd_aea (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ret = 0; switch (cmd) { case COMMAND: ret = pk_send (port, canal, 1, buffer, len); break; case DATA: ret = pk_send (port, canal, 2, buffer, len); break; case UNPROTO: ret = pk_send_ui (port, buffer, len, ptr); break; } return (ret); } static int pk_stat (int port, int canal, stat_ch * ptr) { static long last_call = 0L; char buf[80]; long temps; /* Demande les stats courantes */ if (ptr) { temps = time (NULL); if (temps == last_call) return 1; last_call = temps; } /* Refait une demande de stats sur le canal */ if (canal != 0xf) canal = canal - 1; sprintf (buf, "\001%cCO\027", 0x40 + canal); tncstr (port, buf, 0); return 1; } static int pk_send (int port, int canal, int type, char *buffer, int len) { if (p_port[port].polling == 0) { /* Rien en cours, On envoie directement... */ p_port[port].polling = 1; return (pk_send_ok (port, canal, type, buffer, len)); } else { /* Bufferise la requete */ PortData *cmd = p_port[port].cmd; if (cmd) { /* Rajoute la commande en fin de queue */ while (cmd->next) cmd = cmd->next; cmd->next = (PortData *) m_alloue (sizeof (PortData)); cmd = cmd->next; } else cmd = p_port[port].cmd = (PortData *) m_alloue (sizeof (PortData)); cmd->next = NULL; cmd->canal = canal; cmd->cmd = type; cmd->len = len > 256 ? 256 : len; memcpy (cmd->buf, buffer, cmd->len); } return 1; } static void pk_check (int port) { if (p_port[port].cmd) { PortData *cmd = p_port[port].cmd; p_port[port].cur_can = cmd->canal; pk_send_ok (port, cmd->canal, cmd->cmd, cmd->buf, cmd->len); p_port[port].cmd = cmd->next; m_libere (cmd, sizeof (PortData)); p_port[port].last_cmde = '\0'; } else p_port[port].polling = 0; } static int pk_send_ok (int port, int canal, int type, char *buffer, int len) { /* Le premier canal est 1 dans FBB, 0 sur PK232 */ if (canal != 0xf) --canal; switch (type) { case 0: /* Unproto */ send_tnc (port, 0x1); send_tnc (port, 0x29); break; case 1: /* Commande */ send_tnc (port, 0x1); send_tnc (port, 0x40 + canal); break; case 2: /* Data */ send_tnc (port, 0x1); send_tnc (port, 0x20 + canal); break; default: return (0); } while (len) { if ((*buffer == '\027') || (*buffer == '\020') || (*buffer == '\001')) send_tnc (port, '\020'); send_tnc (port, *buffer++); --len; } send_tnc (port, '\027'); sleep_ (1); if (type == 2) pk_stat (port, (canal == 0xf) ? canal : canal + 1, NULL); sleep_ (1); return (1); } static int pk_inbuf (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { int commande, nbcar, can, nback = 0; char *ptr; static char buf[600]; int valid = 0; int offset = 1; if ((nbcar = pk_read (*port, buf)) < 2) return (0); *buffer = '\0'; commande = *buf & 0xf0; can = *buf & 0x0f; switch (commande) { case 0x30: if ((can == 0xf) || (can == 0xd)) { ptr = buf; if (buf[1] == 'p') { *port = (int) (*(buf + 2) - '0'); offset += 3; } while (nbcar) { if ((*ptr == ':') || ((*ptr == '\r') && (isdigit (*(ptr - 1))))) { *ptr++ = '\0'; --nbcar; break; } ++ptr; --nbcar; } pk_get_ui (*port, buf + offset, ui); if (nbcar > 0) { sprintf (ui->txt, " (%d)", nbcar); memcpy (buffer, ptr, nbcar); } else nbcar = 0; valid = 1; *cmd = UNPROTO; *canal = can; *len = nbcar; } else { /* First channel of TNC must be 1 */ can = can + 1; memcpy (buffer, buf + 1, nbcar - 1); valid = 1; *cmd = DATA; *canal = can; *len = nbcar - 1; } break; case 0x40: if (can == 0xf) { memcpy (buffer, buf + 1, 3); switch (buffer[2]) { case 0: strcpy (buffer + 3, "OK\r"); break; case 1: strcpy (buffer + 3, "bad\r"); break; case 2: strcpy (buffer + 3, "too many\r"); break; case 3: strcpy (buffer + 3, "not enough\r"); break; case 4: strcpy (buffer + 3, "too long\r"); break; case 5: strcpy (buffer + 3, "range\r"); break; case 6: strcpy (buffer + 3, "callsign\r"); break; case 7: strcpy (buffer + 3, "unknown command\r"); break; case 8: strcpy (buffer + 3, "need VIA\r"); break; case 9: strcpy (buffer + 3, "not while connected\r"); break; case 10: strcpy (buffer + 3, "need MYCALL\r"); break; case 11: strcpy (buffer + 3, "need MYSELCAL\r"); break; case 12: strcpy (buffer + 3, "already connected\r"); break; case 13: strcpy (buffer + 3, "not while disconnected\r"); break; case 14: strcpy (buffer + 3, "different connectees\r"); break; case 15: strcpy (buffer + 3, "too many packets outstanding\r"); break; case 16: strcpy (buffer + 3, "clock not set\r"); break; case 17: strcpy (buffer + 3, "need ALL/NONE/YES/NO\r"); break; case 21: strcpy (buffer + 3, "not in this mode\r"); break; default: memcpy (buffer + 3, buf + 3, nbcar - 3); buffer[nbcar] = '\r'; buffer[nbcar + 1] = '\0'; break; } buffer[2] = ':'; commande = 0; valid = 1; *cmd = ECHOCMD; *canal = 0; *len = strlen (buffer); } else { int voie = no_voie (*port, can + 1); buf[nbcar] = '\0'; if ((buf[1] == 'C') && (buf[2] == 'O')) { stat_ch sta; memset (&sta, 0, sizeof (sta)); sta.ack = nback = buf[5] - '0'; sta.ret = buf[6] - '0'; sta.stat = buf[3] - '0'; if (sta.stat == 0) { sta.ack = sta.ret = 0; } memcpy (buffer, &sta, sizeof (sta)); valid = 1; *cmd = STATS; *canal = can + 1; *len = 0; } if ((nback > 14) && (svoie[voie]->ch_mon >= 0)) svoie[voie]->ch_mon = -1; } break; case 0x50: if (can == 0xf) { } else { char stemp[80]; char *ptr = buf + 1; buf[nbcar] = '\0'; /* First channel of TNC must be 1 */ can = can + 1; switch (*ptr) { case 'C': if (ptr[1] == 'O') { valid = 1; sscanf (ptr, "%*s %*s %s", stemp); sprintf (buffer, "(%d) CONNECTED to %s", can, stemp); } break; case 'D': valid = 1; sprintf (buffer, "(%d) DISCONNECTED fm PK", can); break; case 'R': valid = 1; sprintf (buffer, "(%d) LINK FAILURE with PK", can); break; default: valid = 0; break; } *cmd = COMMAND; *canal = can; *len = strlen (buffer); } break; default: break; } pk_check (*port); ff (); return (valid); } static int pk_read (int port, char *buffer) { int c; int nb = 0; if ((!car_tnc (port)) || ((c = rcv_tnc (port)) != 1)) return (0); for (;;) { c = rec_tnc (port); if (c == -1) continue; if (c == '\027') break; if (c == '\020') c = rcv_tnc (port); *buffer++ = c; ++nb; } return (nb); } static int pk_send_ui (int port, char *buffer, int len, Beacon * beacon) { char buf[600]; char s[80]; int i; int via = 1; sprintf (buf, "UN%s-%d", mot (beacon->desti.call), beacon->desti.num); for (i = 0; i < 8; i++) { if (*beacon->digi[i].call) { if (via) { strcat (buf, " VIA "); via = 0; } else { strcat (buf, ","); } sprintf (s, "%s-%d", mot (beacon->digi[i].call), beacon->digi[i].num); strcat (buf, s); } } pk_send (port, 0xf, 1, buf, strlen (buf)); pk_send (port, 0xf, 0, buffer, len); return (1); } static char *ccopy (char *dst, char *src) { int nb = 11; while ((isalnum (*src)) || (*src == '-') || (*src == '*')) { *dst++ = *src++; if (--nb == 0) break; } *dst = '\0'; return (src); } static void pk_get_ui (int port, char *buffer, ui_header * ui) { char *ptr; char *sptr; memset (ui, 0, sizeof (ui_header)); ui->port = port; ui->pid = 0xf0; ui->ui = 1; strcpy (ui->ctl, "??"); ptr = buffer; ptr = ccopy (ui->from, ptr); sptr = strchr (ui->from, '*'); if (sptr) *sptr = '\0'; if (*ptr++ != '>') return; ptr = ccopy (ui->to, ptr); while (*ptr == '>') { ++ptr; strcat (ui->via, ui->to); strcat (ui->via, " "); ptr = ccopy (ui->to, ptr); } if (*ptr == ' ') ++ptr; sptr = ptr; while ((*sptr) && (*sptr != ')') && (*sptr != '>') && (*ptr != ']')) ++sptr; *sptr = '\0'; /* controle */ *ui->ctl = '\0'; ui->pid = 0; if ((*ptr == '(') || (*ptr == '<') || (*ptr == '[')) { int pos = 0; int reponse = 0; ++ptr; sptr = ptr; if (*sptr == 'F') { pos = 4; } else if (*sptr == 'U') { pos = 2; if (sptr[1] == 'A') reponse = 1; else ui->pid = 0xf0; } else if (*sptr == 'C') { strcpy (ptr, "SABM"); pos = 4; } else if (*sptr == 'D') { strcpy (ptr, "DISC"); pos = 4; } else if (*sptr == 'I') { sptr[1] = sptr[2]; sptr[2] = sptr[4]; pos = 3; ui->pid = 0xf0; } else { if (sptr[1] == 'R') { if (sptr[3] == 'P') { sptr[2] = sptr[5]; pos = 3; reponse = 0; } else if (sptr[3] == 'F') { sptr[2] = sptr[5]; pos = 3; reponse = 1; } else { sptr[2] = sptr[3]; pos = 3; } } } if (reponse) sptr[pos] = '-'; else sptr[pos] = '+'; sptr[pos + 1] = '\0'; n_cpy (4, ui->ctl, ptr); } ui->ui = (strncmp (ui->ctl, "UI", 2) == 0); } fbb-7.0.10/src/drv_sock.c0000644000175000017500000010671213615603431012027 00000000000000/************************************************************************ Copyright (C) 1986-2000 by F6FBB - Jean-Paul ROUBELAT jpr@f6fbb.org 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 . Parts of code have been taken from many other softwares. Thanks for the help. ************************************************************************/ /****************************************************** * * * FBB Driver for AF_AX25 domain sockets * * * * F6FBB - 1996 * * * ******************************************************/ #include #include #include #include #include #include #include #include #include #include #include #include union sockaddr_ham { struct full_sockaddr_ax25 axaddr; struct sockaddr_rose rsaddr; }; #define AX25_CALLSID 11 /* Big enough for ROSE addresses */ #define READ_EVENT 1 #define WRITE_EVENT 2 #define EXCEPT_EVENT 4 #define DISCONNECT 0 #define CPROGRESS 1 #define CONNECTED 2 #define NO_EVENT 0 #define DISC_EVENT 1 #define CONN_EVENT 2 #define RETR_EVENT 3 #define BUSY_EVENT 4 #define SOCK_MAXCAN (MAXVOIES) /* was 50 -- this was causing bad problems. This table was being accessed beyond the array */ #define CAN_AX25 0 #define CAN_NETROM 1 #define CAN_ROSE 2 #ifndef SOL_AX25 #define SOL_AX25 257 #endif #undef open #undef read #undef write #undef close typedef struct { int ncan; int sock; int port; int state; int paclen; int maxframe; int type; /* CAN_AX25, CAN_NETROM or CAN_ROSE */ int event; int queue; char source[AX25_CALLSID]; } scan_t; scan_t scan[SOCK_MAXCAN] = {{0}}; /* I think this is necessary (Though not 100% sure. */ static int last_can = 1; static int msocket = -1; static int is_rsaddr (char *); static int stop_cnx (int port); static int sock_rcv_ui (int *, char *, int *, ui_header *); static int sock_snd_ui (int, char *, int, Beacon *); static int sock_snd_dt (int, char *, int); static int sock_cmd (int, int, char *); static int sock_connect (char *, int); static int sock_connexion (int, int, union sockaddr_ham *, int *, char *); static int sock_stat (int, stat_ch *); static int sock_paclen (int); static int s_free (scan_t *); static int s_status (scan_t *); static int name_to_port (char *); static char *ax25_ntoaddr (char *, const ax25_address *); static char *rose_ntoaddr (char *, const rose_address *); static char *rose_ntodnic (char *, const rose_address *); static void clear_can (int canal); /* * ax25 -> ascii conversion */ static char *_ax25_ntoa(const ax25_address *a) { static char buf[11]; char c, *s; int n; for (n = 0, s = buf; n < 6; n++) { c = (a->ax25_call[n] >> 1) & 0x7F; if (c != ' ') *s++ = c; } *s++ = '-'; n = (a->ax25_call[6] >> 1) & 0x0F; if (n > 9) { *s++ = '1'; n -= 10; } *s++ = n + '0'; *s++ = '\0'; return buf; } /* * Generic functions of the driver */ /* Check or change status of a port/channel */ int sta_sck (int port, int canal, int cmd, void *ptr) { switch (cmd) { case TNCSTAT: return (sock_stat (canal, (stat_ch *) ptr)); case PACLEN: *((int *) ptr) = sock_paclen (canal); return (1); case SNDCMD: return (sock_cmd (port, canal, (char *) ptr)); case SETBUSY: return stop_cnx (port); } return (0); } /* Sends data */ int snd_sck (int port, int canal, int cmd, char *buffer, int len, Beacon * ptr) { int ret = 0; switch (cmd) { case COMMAND: break; case DATA: if (len != 0) ret = sock_snd_dt (canal, buffer, len); //else //fprintf (stderr, "FBB snd_sck() DATA len == 0 !\n"); break; case UNPROTO: ret = sock_snd_ui (port, buffer, len, ptr); break; } return (ret); } /* receives data */ int rcv_sck (int *port, int *canal, int *cmd, char *buffer, int *len, ui_header * ui) { static int can = 0; /* int valid;*/ int res; *cmd = INVCMD; /* valid = 0;*/ /* Test monitoring */ if (sock_rcv_ui (port, buffer, len, ui)) { *canal = 0; *cmd = UNPROTO; return (1); } usleep(50000); /* wait 50 msec to allow interrupt and avoid CPU overload */ /* Test connection */ scan[0].sock = p_port[*port].fd; res = s_status (&scan[0]); if (res & READ_EVENT) { int new; int i; unsigned addr_len; union sockaddr_ham addr; memset(&addr, 0x00, sizeof(struct full_sockaddr_ax25)); /* addr_len = sizeof (union sockaddr_ham);*/ addr_len = sizeof (struct full_sockaddr_ax25); new = accept (p_port[*port].fd, (struct sockaddr *) &addr, &addr_len); if (new == -1) { perror ("rcv_sck() accept"); return (FALSE); } /* Affect the new socket to an empty channel */ for (i = 1; i < last_can; i++) { if (scan[i].state == DISCONNECT) { break; } } if (i == last_can) { /* Impossible to affect the channel -> disconnection */ printf ("no channel available\n"); close (new); } else { int ret; *canal = i; ret = sock_connexion (new, i, &addr, port, buffer); if (ret) { *len = strlen (buffer); *cmd = COMMAND; *canal = i; return (TRUE); } return (FALSE); } } /* Next channel for the polling */ ++can; if (can == last_can) can = 1; if ((scan[can].sock <= 0) && (scan[can].state != DISCONNECT)) { switch (scan[can].type) { case CAN_AX25: sprintf (buffer, "(%d) DISCONNECTED fm AX25", can); /* fprintf (stderr, "(%d) DISCONNECTED fm AX25\n", can);*/ break; case CAN_NETROM: sprintf (buffer, "(%d) DISCONNECTED fm NETROM", can); /* fprintf (stderr, "(%d) DISCONNECTED fm NETROM\n", can);*/ break; case CAN_ROSE: sprintf (buffer, "(%d) DISCONNECTED fm ROSE", can); /* fprintf (stderr, "(%d) DISCONNECTED fm ROSE\n", can);*/ break; } clear_can (can); /* scan[can].state = DISCONNECT; */ *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } /* Canal de communication */ res = s_status (&scan[can]); if (res & EXCEPT_EVENT) { if (scan[can].event == CONN_EVENT) { /* Appel sortant connecte */ unsigned addr_len; union sockaddr_ham addr; int ret; memset(&addr, 0x00, sizeof(struct full_sockaddr_ax25)); /* addr_len = sizeof (union sockaddr_ham);*/ addr_len = sizeof (struct full_sockaddr_ax25); if (getpeername (scan[can].sock, (struct sockaddr *) &addr, &addr_len) == 0) { ret = sock_connexion (scan[can].sock, can, &addr, port, buffer); if (ret) { *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } } else /* perror ("getpeername");*/ return (FALSE); } else { switch (scan[can].type) { case CAN_AX25: sprintf (buffer, "(%d) DISCONNECTED fm AX25", can); /* fprintf (stderr, "(%d) DISCONNECTED fm AX25\n", can);*/ break; case CAN_NETROM: sprintf (buffer, "(%d) DISCONNECTED fm NETROM", can); /* fprintf (stderr, "(%d) DISCONNECTED fm NETROM\n", can);*/ break; case CAN_ROSE: sprintf (buffer, "(%d) DISCONNECTED fm ROSE", can); /* fprintf (stderr, "(%d) DISCONNECTED fm ROSE\n", can);*/ break; } /* printf ("Event -> deconnection %s\n", buffer);*/ close (scan[can].sock); clear_can (can); *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } } if (res & READ_EVENT) { int nb; if (scan[can].sock <= 0) { /* printf ("read on invalid socket\n");*/ return (FALSE); } nb = read (scan[can].sock, buffer, 256); if ((nb == 0) || ((nb == -1) && (errno == ENOTCONN))) { /* Deconnection */ switch (scan[can].type) { case CAN_AX25: sprintf (buffer, "(%d) DISCONNECTED fm AX25", can); /* fprintf (stderr, "(%d) DISCONNECTED fm AX25\n", can);*/ break; case CAN_NETROM: sprintf (buffer, "(%d) DISCONNECTED fm NETROM", can); /* fprintf (stderr, "(%d) DISCONNECTED fm NETROM\n", can);*/ break; case CAN_ROSE: sprintf (buffer, "(%d) DISCONNECTED fm ROSE", can); /* fprintf (stderr, "(%d) DISCONNECTED fm ROSE\n", can);*/ break; } close (scan[can].sock); clear_can (can); *len = strlen (buffer); *cmd = COMMAND; *canal = can; return (TRUE); } else if (nb == -1) { printf ("errno = %d\n", errno); perror ("read"); } else { *len = nb; *cmd = DATA; *canal = can; return (TRUE); } } if (res & WRITE_EVENT) { /* Can write to the socket... Unused */ } return (FALSE); } /* Open port */ int opn_sck (int port, int nb) { static int nb_init = 0; int old_can; int i; int ioc; int backoff; int ok = TRUE; char s[80]; char *p_name; sprintf (s, "Init PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); InitText (s); old_can = last_can; last_can += nb; if (last_can > SOCK_MAXCAN) last_can = SOCK_MAXCAN; for (i = old_can; i < last_can; i++) { clear_can (i); } if (nb_init == 0) { nb_init = 1; fbb_ax25_config_load_ports (); fbb_nr_config_load_ports (); fbb_rs_config_load_ports (); /* Socket reception monitoring */ if (msocket <= 0) { int proto = (all_packets) ? ETH_P_ALL : ETH_P_AX25; if ((msocket = socket (AF_PACKET, SOCK_PACKET, htons (proto))) == -1) { perror ("socket_monitoring"); } else { /* Socket non bloquant */ ioc = 1; ioctl (msocket, FIONBIO, &ioc); } } } /* Receive connections socket */ if (p_port[port].fd == 0) { char call[20]; int addrlen = 0; union sockaddr_ham addr; memset(&addr, 0x00, sizeof(struct full_sockaddr_ax25)); sprintf (s, "Open PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); /* fprintf (stderr, "Open PORT %d COM%d-%d\n", port, p_port[port].ccom, p_port[port].ccanal); */ InitText (s); sleep (1); if (ax25_config_get_addr (p_port[port].name) != NULL) { p_port[port].type = CAN_AX25; } else if (nr_config_get_addr (p_port[port].name) != NULL) { p_port[port].type = CAN_NETROM; } else if (is_rsaddr (p_port[port].name) || (rs_config_get_addr (p_port[port].name) != NULL)) { p_port[port].type = CAN_ROSE; } else { /* fprintf (stderr, "invalid port name %s\n", p_port[port].name);*/ return (0); } switch (p_port[port].type) { case CAN_AX25: printf ("CAN_AX25\n"); if ((p_port[port].fd = socket (AF_AX25, SOCK_SEQPACKET, 0)) < 0) { perror ("socket_r"); clear_can (port); return (0); } /* Socket non bloquant */ ioc = 1; ioctl (p_port[port].fd, FIONBIO, &ioc); backoff = 0; if (setsockopt (p_port[port].fd, SOL_AX25, AX25_BACKOFF, &backoff, sizeof (backoff)) == -1) { perror ("setsockopt : AX25_BACKOFF"); close (p_port[port].fd); clear_can (port); return (0); } addr.axaddr.fsa_ax25.sax25_family = AF_AX25; addr.axaddr.fsa_ax25.sax25_ndigis = 1; sprintf (call, "%s-%d", mycall, myssid); fprintf (stderr, "CAN_AX25 mycall %s myssid %d\n", mycall, myssid); ax25_aton_entry (call, addr.axaddr.fsa_ax25.sax25_call.ax25_call); p_name = ax25_config_get_addr (p_port[port].name); ax25_aton_entry (p_name, addr.axaddr.fsa_digipeater[0].ax25_call); addrlen = sizeof (struct full_sockaddr_ax25); break; case CAN_NETROM: printf ("CAN_NETROM\n"); if ((p_port[port].fd = socket (AF_NETROM, SOCK_SEQPACKET, 0)) < 0) { perror ("socket_r"); clear_can (port); return (0); } /* Socket non bloquant */ ioc = 1; ioctl (p_port[port].fd, FIONBIO, &ioc); addr.axaddr.fsa_ax25.sax25_family = AF_NETROM; addr.axaddr.fsa_ax25.sax25_ndigis = 0; p_name = nr_config_get_addr (p_port[port].name); fprintf (stderr, "CAN_NETROM mycall %s myssid %d\n", mycall, myssid); ax25_aton_entry (p_name, addr.axaddr.fsa_ax25.sax25_call.ax25_call); addrlen = sizeof (struct full_sockaddr_ax25); break; case CAN_ROSE: printf ("CAN_ROSE\n"); if ((p_port[port].fd = socket (AF_ROSE, SOCK_SEQPACKET, 0)) < 0) { perror ("socket_r"); clear_can (port); return (0); } /* Socket non bloquant */ ioc = 1; ioctl (p_port[port].fd, FIONBIO, &ioc); addr.rsaddr.srose_family = AF_ROSE; addr.rsaddr.srose_ndigis = 0; sprintf (call, "%s-%d", mycall, myssid); fprintf (stderr, "CAN_ROSE mycall %s myssid %d\n", mycall, myssid); ax25_aton_entry (call, addr.rsaddr.srose_call.ax25_call); if (is_rsaddr (p_port[port].name)) p_name = p_port[port].name; else p_name = rs_config_get_addr (p_port[port].name); rose_aton (p_name, addr.rsaddr.srose_addr.rose_addr); addrlen = sizeof (struct sockaddr_rose); break; } if (bind (p_port[port].fd, (struct sockaddr *) &addr, addrlen) == -1) { perror ("bind"); close (p_port[port].fd); clear_can (port); return (0); } if (listen (p_port[port].fd, SOMAXCONN) == -1) { perror ("listen"); close (p_port[port].fd); clear_can (port); return (0); } memset (&scan[0], 0, sizeof (scan_t)); } sprintf (s, "Prog PORT %d COM%d-%d", port, p_port[port].ccom, p_port[port].ccanal); /* fprintf (stderr, "Prog PORT %d COM%d-%d\n", port, p_port[port].ccom, p_port[port].ccanal); */ InitText (s); return (ok); } /* Close port */ int cls_sck (int port) { int i; for (i = 0; i < last_can; i++) { if (scan[i].sock > 0) { /* printf ("cls_sck : disconnect stream %d\n", i); fprintf (stderr, "cls_sck : disconnect stream %d\n", i); */ close (scan[i].sock); } clear_can (i); scan[i].state = DISCONNECT; } if (msocket > 0) close (msocket); msocket = -1; if ((p_port[port].typort == TYP_SCK) && (p_port[port].fd)) { close (p_port[port].fd); clear_can (port); } return (1); } /* * Static functions * */ static int get_call (char *trame, char *buffer) { int c, i, ssid; for (i = 0; i < 6; i++) { c = (*trame++) >> 1; if (isalnum (c)) *buffer++ = c; } ssid = *trame; if ((c = ((ssid >> 1) & 0xf)) != 0) { *buffer++ = '-'; if (c >= 10) { c -= 10; *buffer++ = '1'; } *buffer++ = c + '0'; } *buffer = '\0'; return (ssid); } static int stop_cnx (int port) { if (p_port[port].fd) /* Prevent closing of 0 */ { close(p_port[port].fd); p_port[port].fd = 0; } return 1; } static int sock_rcv_ui (int *port, char *buffer, int *plen, ui_header * phead) { struct sockaddr sa; struct ifreq ifr; unsigned asize; /* struct ifreq ifr; */ char buf[1500]; char temp[11]; char *via; int lg, ssid, ssid_d, v2; char ctrl; char *ptr; char *pctl; int b_port; int family; /* int prevp;*/ char name[80]; memset(&sa, 0x00, sizeof(struct sockaddr)); memset(&ifr, 0x00, sizeof(struct ifreq)); memset(buf, 0, sizeof(buf)); memset(temp, 0, sizeof(temp)); memset(name, 0, sizeof(name)); do { b_port = *port; asize = sizeof (sa); lg = recvfrom (msocket, buf, 1500, 0, &sa, &asize); if ((lg <= 0) || ((buf[0] & 0xf) != 0)) { return (0); } strcpy (ifr.ifr_name, sa.sa_data); if (ioctl (msocket, SIOCGIFHWADDR, &ifr) < 0) { perror ("GIFADDR"); return (0); } family = ifr.ifr_hwaddr.sa_family; } while ((family != AF_AX25) && (family != AF_NETROM) && (family != AF_ROSE)); if ((ptr = ax25_config_get_name (sa.sa_data)) != NULL) { strcpy(name, ptr); b_port = name_to_port (ptr); } ptr = buf + 1; --lg; if (lg < 15) return (FALSE); memset (phead, 0, sizeof (ui_header)); via = phead->via; if (lg > 300) lg = 300; ssid_d = get_call (ptr, phead->to); ptr += 7; ssid = get_call (ptr, phead->from); ptr += 7; v2 = ((ssid_d & 0x80) != (ssid & 0x80)); lg -= 14; *via = '\0'; if ((ssid & 1) == 0) { do { lg -= 7; if (lg < 1) { ff (); return (0); } ssid = get_call (ptr, temp); ptr += 7; if (*temp) { strcat (via, temp); if (ssid & 0x80) { if ((ssid & 1) || (((ssid & 1) == 0) && ((ptr[6] & 0x80) == 0))) strcat (via, "*"); } strcat (via, " "); } } while ((ssid & 1) == 0); } ctrl = *ptr++; lg--; pctl = phead->ctl; if ((ctrl & 0x1) == 0) { /* I frame */ *pctl++ = 'I'; *pctl++ = (ctrl >> 5) + '0'; *pctl++ = ((ctrl >> 1) & 0x7) + '0'; } else if ((ctrl & 0x3) == 1) { /* S frame */ switch (ctrl & 0xf) { case 0x1: *pctl++ = 'R'; *pctl++ = 'R'; break; case 0x5: *pctl++ = 'R'; *pctl++ = 'N'; *pctl++ = 'R'; break; case 0x9: *pctl++ = 'R'; *pctl++ = 'E'; *pctl++ = 'J'; break; } *pctl++ = (ctrl >> 5) + '0'; } else { /* U frame */ switch (ctrl & 0xec) { case 0x2c: *pctl++ = 'S'; *pctl++ = 'A'; *pctl++ = 'B'; *pctl++ = 'M'; break; case 0x40: *pctl++ = 'D'; *pctl++ = 'I'; *pctl++ = 'S'; *pctl++ = 'C'; break; case 0x0c: *pctl++ = 'D'; *pctl++ = 'M'; break; case 0x60: *pctl++ = 'U'; *pctl++ = 'A'; break; case 0x84: *pctl++ = 'F'; *pctl++ = 'R'; *pctl++ = 'M'; *pctl++ = 'R'; break; case 0x00: *pctl++ = 'U'; *pctl++ = 'I'; phead->ui = 1; break; } } if (v2) { if (ctrl & 0x10) { if (ssid_d & 0x80) *pctl++ = '+'; else *pctl++ = '-'; } else { if (ssid_d & 0x80) *pctl++ = '^'; else *pctl++ = 'v'; } } else if (ctrl & 0x10) *pctl++ = '!'; *pctl = '\0'; if (((ctrl & 1) == 0) || ((ctrl & 0xef) == 0x3)) { lg--; if (lg < 0) { return (0); } phead->pid = *ptr++ & 0xff; } else phead->pid = 0; /* prevp = b_port;*/ if (b_port == 0) { int bp; switch (phead->pid) { case 0xcf: /* Look for the port listening to this packet */ for (bp = 1; bp < NBPORT; bp++) { if ((p_port[bp].pvalid) && (p_port[bp].type == CAN_NETROM)) b_port = bp; } break; case 0x01: /* Look for the port listening to this packet */ for (bp = 1; bp < NBPORT; bp++) { if ((p_port[bp].pvalid) && (p_port[bp].type == CAN_ROSE)) b_port = bp; } break; } if (b_port == 0) return (0); } /* Par securite ? */ if (lg < 0) return (0); if (lg > 256) lg = 256; *plen = lg; if (lg) sprintf (phead->txt, " (%d)", lg); phead->port = *port = b_port; memcpy (buffer, ptr, lg); buffer[lg] = '\0'; return (1); } static int sock_snd_ui (int port, char *chaine, int len, Beacon * beacon) { char *calls[10]; char callsign[9]; char *ptr; int dlen; int slen; struct full_sockaddr_ax25 dest; struct full_sockaddr_ax25 src; int i; int nb; int s; memset(&src, 0x00, sizeof(struct full_sockaddr_ax25)); memset(&dest, 0x00, sizeof(struct full_sockaddr_ax25)); nb = 0; calls[nb] = malloc (AX25_CALLSID); sprintf (calls[nb++], "%s-%d", beacon->desti.call, beacon->desti.num); for (i = 0; i < beacon->nb_digi; i++) { calls[nb] = malloc (AX25_CALLSID); sprintf (calls[nb++], "%s-%d", beacon->digi[i].call, beacon->digi[i].num); } calls[nb] = NULL; if ((dlen = ax25_aton_arglist ((const char **)calls, &dest)) == -1) { fprintf (stderr, "beacon: unable to convert callsign '%s'\n", calls[0]); return 0; } for (i = 0; calls[i]; i++) free (calls[i]); sprintf (callsign, "%s-%d", mycall, myssid); slen = ax25_aton (callsign, &src); ptr = ax25_config_get_addr (p_port[port].name); if (ptr == NULL) return (0); ax25_aton_entry (ptr, src.fsa_digipeater[0].ax25_call); src.fsa_ax25.sax25_ndigis = 1; if ((s = socket (AF_AX25, SOCK_DGRAM, 0)) == -1) { perror ("beacon: socket"); return 0; } if (bind (s, (struct sockaddr *) &src, slen) == -1) { perror ("beacon: bind"); return 0; } if (sendto (s, chaine, len, 0, (struct sockaddr *) &dest, dlen) == -1) { perror ("beacon: sendto"); return 0; } close (s); return (1); } static int sock_snd_dt (int canal, char *buffer, int len) { int nb; if (scan[canal].sock <= 0) return (FALSE); nb = write (scan[canal].sock, buffer, len); if (nb == -1) { /* fprintf (stderr, "sock_snd_dt() Error %d on socket %d\n", errno, scan[canal].sock);*/ /* perror ("sock_snd_dt() : write on socket");*/ return (FALSE); } else if (nb < len) { /* fprintf (stderr, "Cannot write %d bytes on socket %d\n", len - nb, scan[canal].sock);*/ perror ("Cannot write ?? bytes on socket\n"); return (FALSE); } return (TRUE); } static int sock_cmd (int port, int canal, char *cmd) { /* Dave van der Locht 27-01-2020 Why clearing scan[canal].source? The second call to this function, after the I command, forces the gateway to use the BBS's own callsign as FROM address. */ //strcpy (scan[canal].source, "\0") ; switch (*cmd++) { case 'I': /* source callsign */ while (isspace (*cmd)) ++cmd; strn_cpy (AX25_CALLSID, scan[canal].source, cmd); break; case 'D': /* Deconnection */ if (scan[canal].sock > 0) { close (scan[canal].sock); /* clear_can (canal); */ scan[canal].sock = -1; } break; case 'C': /* Connection */ while (isspace (*cmd)) ++cmd; scan[canal].paclen = p_port[port].pk_t; scan[canal].maxframe = p_port[port].frame; scan[canal].port = port; scan[canal].type = p_port[port].type; sock_connect (cmd, canal); break; default: return (0); } return (1); } static int nr_ax25_aton (char *address, struct full_sockaddr_ax25 *addr) { char buffer[100], *call, *alias; FILE *fp; int addrlen; memset(buffer, 0, sizeof(buffer)); call = address; while (*call) { if (isspace (*call)) { *call = '\0'; break; } *call = toupper (*call); ++call; } if ((fp = fopen ("/proc/net/nr_nodes", "r")) == NULL) { fprintf (stderr, "call: NET/ROM not included in the kernel\n"); return -1; } while (fgets (buffer, 100, fp) != NULL) { call = strtok (buffer, " \t\n\r"); alias = strtok (NULL, " \t\n\r"); if (strcmp (address, call) == 0 || strcmp (address, alias) == 0) { addrlen = ax25_aton (call, addr); addr->fsa_ax25.sax25_family = AF_NETROM; fclose (fp); return (addrlen == -1) ? -1 : sizeof (struct sockaddr_ax25); } } fclose (fp); /* fprintf (stderr, "call: NET/ROM callsign or alias not found\n");*/ return -1; } static int rs_ax25_aton (char *address, struct sockaddr_rose *addr) { char *command, *call, *rsaddr, *digi; command = strdup (address); if (command) { char roseaddr[12]; call = strtok (command, " ,\t\n\r"); addr->srose_family = AF_ROSE; addr->srose_ndigis = 0; if (ax25_aton_entry (call, addr->srose_call.ax25_call) == -1) { free (command); return -1; } rsaddr = strtok (NULL, " \t\r\n"); if (rsaddr == NULL) { free (command); return -1; } /* DNIC / Address */ if (strlen (rsaddr) == 10) strcpy (roseaddr, rsaddr); else if (strlen (rsaddr) == 4) { strcpy (roseaddr, rsaddr); rsaddr = strtok (NULL, " \t\r\n"); if ((rsaddr == NULL) || (strlen (rsaddr) != 6)) { free (command); return -1; } strcpy (roseaddr + 4, rsaddr); } if (rose_aton (roseaddr, addr->srose_addr.rose_addr) == -1) { free (command); return -1; } /* Digis */ while ((digi = strtok (NULL, " \t\r\n")) != NULL) { #if 0 if (ax25_aton_entry (digi, addr->srose_digis[addr->srose_ndigis].ax25_call) == -1) { free (command); return -1; } if (++addr->srose_ndigis == 6) break; #else if (ax25_aton_entry (digi, addr->srose_digi.ax25_call) == -1) { free (command); return -1; } if (++addr->srose_ndigis == 1) break; #endif } free (command); } return sizeof (struct sockaddr_rose); } static int sock_connect (char *commande, int can) { int fd; int addrlen; int t1 = 50; /* int retry = 3; */ /* int one = debug; */ int ioc; union sockaddr_ham addr; char *p_name; char mycallsign[AX25_CALLSID]; int backoff = 0; memset(&addr, 0x00, sizeof(struct full_sockaddr_ax25)); memset(mycallsign, 0, sizeof(mycallsign)); if (strcmp(scan[can].source,"") != 0 ) { strcpy (mycallsign, scan[can].source); /* fprintf (stderr, "sock_connect() scan[can].source '%s'\n", scan[can].source);*/ } else { sprintf (mycallsign, "%s-%d", mycall, myssid); /* fprintf (stderr, "sock_connect() mycall '%s' myssid '%d'\n", mycall, myssid);*/ } /* fprintf (stderr, "sock_connect() mycallsign '%s'\n", mycallsign);*/ switch (scan[can].type) { case CAN_AX25: if ((fd = socket (AF_AX25, SOCK_SEQPACKET, 0)) < 0) { perror ("socket_ax"); clear_can (can); return (0); } addr.axaddr.fsa_ax25.sax25_family = AF_AX25; addr.axaddr.fsa_ax25.sax25_ndigis = 1; p_name = ax25_config_get_addr (p_port[scan[can].port].name); ax25_aton_entry (mycallsign, addr.axaddr.fsa_ax25.sax25_call.ax25_call); ax25_aton_entry (p_name, addr.axaddr.fsa_digipeater[0].ax25_call); addrlen = sizeof (struct full_sockaddr_ax25); if (setsockopt (fd, SOL_AX25, AX25_WINDOW, &scan[can].maxframe, sizeof (scan[can].maxframe)) == -1) { perror ("AX25_WINDOW"); close (fd); clear_can (can); return (0); } if (setsockopt (fd, SOL_AX25, AX25_PACLEN, &scan[can].paclen, sizeof (scan[can].paclen)) == -1) { perror ("AX25_PACLEN"); close (fd); clear_can (can); return (0); } t1 = 5; if (setsockopt (fd, SOL_AX25, AX25_T1, &t1, sizeof (t1)) == -1) { perror ("AX25_T1"); close (fd); clear_can (can); return (0); } /* if (setsockopt (fd, SOL_AX25, AX25_N2, &retry, sizeof (retry)) == -1) { perror ("AX25_N2"); close (fd); clear_can (can); return (0); } */ if (backoff != -1) { if (setsockopt (fd, SOL_AX25, AX25_BACKOFF, &backoff, sizeof (backoff)) == -1) { perror ("AX25_BACKOFF"); close (fd); clear_can (can); return (0); } } /* if (ax25mode != -1) { if (setsockopt (fd, SOL_AX25, AX25_EXTSEQ, &ax25mode, sizeof (ax25mode)) == -1) { perror ("AX25_EXTSEQ"); close (fd); clear_can (can); return (0); } } */ break; case CAN_NETROM: if ((fd = socket (AF_NETROM, SOCK_SEQPACKET, 0)) < 0) { perror ("socket_nr"); clear_can (can); return (0); } addr.axaddr.fsa_ax25.sax25_family = AF_NETROM; addr.axaddr.fsa_ax25.sax25_ndigis = 1; p_name = nr_config_get_addr (p_port[scan[can].port].name); ax25_aton_entry (p_name, addr.axaddr.fsa_ax25.sax25_call.ax25_call); ax25_aton_entry (mycallsign, addr.axaddr.fsa_digipeater[0].ax25_call); addrlen = sizeof (struct full_sockaddr_ax25); /* if (setsockopt (fd, SOL_NETROM, NETROM_PACLEN, &scan[can].paclen, sizeof (scan[can].paclen)) == -1) { perror ("NETROM_PACLEN"); close (fd); clear_can (can); return (0); } */ break; case CAN_ROSE: if ((fd = socket (AF_ROSE, SOCK_SEQPACKET, 0)) < 0) { perror ("socket_rs"); clear_can (can); return (0); } addr.rsaddr.srose_family = AF_ROSE; addr.rsaddr.srose_ndigis = 0; if (is_rsaddr (p_port[scan[can].port].name)) p_name = p_port[scan[can].port].name; else p_name = rs_config_get_addr (p_port[scan[can].port].name); rose_aton (p_name, addr.rsaddr.srose_addr.rose_addr); ax25_aton_entry (mycallsign, addr.rsaddr.srose_call.ax25_call); addrlen = sizeof (struct sockaddr_rose); break; default: return FALSE; } /* if (debug && setsockopt (fd, SOL_SOCKET, SO_DEBUG, &one, sizeof (one)) == -1) { perror ("SO_DEBUG"); close (fd); clear_can (can); return (0); } */ scan[can].state = CPROGRESS; if (bind (fd, (struct sockaddr *) &addr, addrlen) == -1) { perror ("sock_connect : bind"); close (fd); /* clear_can (can); */ scan[can].sock = -1; return (TRUE); } switch (scan[can].type) { case CAN_AX25: if ((addrlen = ax25_aton (commande, &addr.axaddr)) == -1) { close (fd); /* clear_can (can); */ scan[can].sock = -1; return (0); } break; case CAN_NETROM: if ((addrlen = nr_ax25_aton (commande, &addr.axaddr)) == -1) { close (fd); /* clear_can (can); */ scan[can].sock = -1; return (TRUE); } break; case CAN_ROSE: if ((addrlen = rs_ax25_aton (commande, &addr.rsaddr)) == -1) { close (fd); /* clear_can (can); */ scan[can].sock = -1; return (TRUE); } break; } ioc = 1; ioctl (fd, FIONBIO, &ioc); if (connect (fd, (struct sockaddr *) &addr, addrlen) == -1) { if (errno != EINPROGRESS) { perror ("connect"); close (fd); /* clear_can (can); */ fd = -1; } } scan[can].sock = fd; return (TRUE); } static int sock_stat (int canal, stat_ch * ptr) { unsigned lg; int val; int tries = 0; /* * valid when ROSE is patched for * ax25_info_new structure */ struct ax25_info_struct ax25info; memset(&ax25info, 0x00, sizeof(struct ax25_info_struct)); /* struct ax25_info_struct_new ax25info; */ if (scan[canal].sock <= 0) { ptr->ack = 0; ptr->ret = 0; return (0); } ptr->mem = 100; val = s_free (&scan[canal]); if (scan[canal].state == DISCONNECT) { ptr->ack = 0; ptr->ret = 0; } else if (scan[canal].state != CONNECTED) ptr->ack = 0; else { ptr->ack = (scan[canal].queue - val) / scan[canal].paclen; if ((scan[canal].queue - val) && (ptr->ack == 0)) ptr->ack = 1; } if (scan[canal].type == CAN_AX25) { /* * valid when ROSE will be patched for * ax25_info_new structure * * if (ioctl (scan[canal].sock, SIOCAX25GETINFONEW, &ax25info) == 0) * */ if (ioctl (scan[canal].sock, SIOCAX25GETINFO, &ax25info) == 0) { ptr->ret = ax25info.n2count; /* fprintf(stderr, "n2=%d n2t=%d send=%d recv=%d\n", ax25info.n2, ax25info.n2count, ax25info.snd_q, ax25info.rcv_q); */ } else { lg = sizeof (int); #ifdef AX25_N2COUNT if (getsockopt (scan[canal].sock, SOL_AX25, AX25_N2COUNT, &tries, &lg) <= 0) { #endif if (getsockopt (scan[canal].sock, SOL_AX25, AX25_N2, &tries, &lg) <= 0) { /* perror("getsockopt : AX25_N2"); */ } #ifdef AX25_N2COUNT } #endif ptr->ret = tries; } } else { ptr->ret = 0; /* XXX */ } return (1); } static int s_status (scan_t * can) { int nb; int res = 0; fd_set sock_read; fd_set sock_write; fd_set sock_excep; struct timeval to; if (can->sock <= 0) return (0); to.tv_sec = to.tv_usec = 0; can->event = 0; FD_ZERO (&sock_read); FD_ZERO (&sock_write); FD_ZERO (&sock_excep); FD_SET (can->sock, &sock_read); FD_SET (can->sock, &sock_write); FD_SET (can->sock, &sock_excep); nb = select (can->sock + 1, &sock_read, &sock_write, &sock_excep, &to); if (nb == -1) { perror ("select"); return (res); } else if (nb == 0) { return (res); } else { if (FD_ISSET (can->sock, &sock_read)) { res |= READ_EVENT; } if (FD_ISSET (can->sock, &sock_write)) { if (can->state == CPROGRESS) { /*F6BVP nb = write (can->sock, &res, 0); printf ("nb = %d\n", nb); if (nb != -1) { */ can->state = CONNECTED; can->event = CONN_EVENT; /* } */ res |= EXCEPT_EVENT; } else res |= WRITE_EVENT; } if (FD_ISSET (can->sock, &sock_excep)) { printf ("Exception sur %d\n", can->sock); can->event = NO_EVENT; res |= EXCEPT_EVENT; } } return (res); } static int sock_paclen (int canal) { if (scan[canal].sock <= 0) return (0); return (scan[canal].paclen); } static int s_free (scan_t * can) { int queue_free; if (ioctl (can->sock, TIOCOUTQ, &queue_free) == -1) { perror ("ioctl : TIOCOUTQ"); return (0); } return (queue_free); } static char *ax25_ntoaddr (char *peer, const ax25_address * axa) { strcpy(peer, _ax25_ntoa(axa)); return peer; } static char *rose_ntoaddr (char *peer, const rose_address * rsa) { strcpy(peer, rose_ntoa(rsa)+4); return peer; } static char *rose_ntodnic (char *peer, const rose_address * rsa) { strncpy(peer, rose_ntoa(rsa), 4); peer[4] = '\0'; return peer; } static int name_to_port (char *port) { int i; for (i = 1; i < NBPORT; i++) { if (strcmp (port, p_port[i].name) == 0) return (i); } /* printf("Port <%s> not found in port.sys\n", port); */ return (0); } static int sock_connexion (int new, int can, union sockaddr_ham *addr, int *port, char *buffer) { int p; int val; unsigned plen; int backoff; char *pn = NULL; char User[80]; char Node[80]; char Dnic[80]; union sockaddr_ham addrham; memset(&addrham, 0x00, sizeof(struct full_sockaddr_ax25)); scan[can].state = CONNECTED; scan[can].sock = new; if (scan[can].port == 0) { plen = sizeof (addrham); if (getsockname (scan[can].sock, (struct sockaddr *) &addrham, &plen) == 0) { switch (addrham.axaddr.fsa_ax25.sax25_family) { case AF_AX25: scan[can].type = CAN_AX25; pn = ax25_config_get_port (&addrham.axaddr.fsa_digipeater[0]); break; case AF_NETROM: scan[can].type = CAN_NETROM; pn = nr_config_get_port (&addrham.axaddr.fsa_ax25.sax25_call); break; case AF_ROSE: scan[can].type = CAN_ROSE; pn = rs_config_get_port (&addrham.rsaddr.srose_addr); break; } scan[can].port = (pn) ? name_to_port (pn) : *port; /* fprintf (stderr, "Connection received on port %s = %d\n", pn, scan[can].port);*/ if (scan[can].port == 0) { close (new); clear_can (can); return (0); } } else scan[can].port = *port; } scan[can].queue = s_free (&scan[can]); *port = p = scan[can].port; val = p_port[p].pk_t; if (val == 0) val = 128; scan[can].paclen = val; switch (scan[can].type) { case CAN_AX25: if (setsockopt (new, SOL_AX25, AX25_PACLEN, &val, sizeof (val)) == -1) { perror ("setsockopt : AX25_PACLEN"); close (new); clear_can (can); return (0); } backoff = 0; if (setsockopt (new, SOL_AX25, AX25_BACKOFF, &backoff, sizeof (backoff)) == -1) { perror ("setsockopt : AX25_BACKOFF"); close (new); clear_can (can); return (0); } /* Look for informations on the connection */ ax25_ntoaddr (User, &addr->axaddr.fsa_ax25.sax25_call); sprintf (buffer, "(%d) CONNECTED to %d:%s", can, p, User); /* fprintf (stderr, "(%d) CONNECTED to %d:%s\n", can, p, User);*/ if (addr->axaddr.fsa_ax25.sax25_ndigis) { int i; char c_digi[AX25_CALLSID + 1]; strcat (buffer, " via"); for (i = 0; i < addr->axaddr.fsa_ax25.sax25_ndigis; i++) { c_digi[0] = ' '; ax25_ntoaddr (c_digi + 1, &addr->axaddr.fsa_digipeater[i]); strcat (buffer, c_digi); } } break; case CAN_NETROM: /* if (setsockopt(new, SOL_NETROM, NETROM_PACLEN, &val, sizeof(val)) == -1) { perror("setsockopt : NETROM_PACLEN"); close (new); clear_can (can); return(0); } */ /* Look for informations on the connection */ ax25_ntoaddr (User, &addr->axaddr.fsa_ax25.sax25_call); ax25_ntoaddr (Node, &addr->axaddr.fsa_digipeater[0]); sprintf (buffer, "(%d) CONNECTED to %d:%s via %s", can, p, User, Node); /* fprintf (stderr, "(%d) CONNECTED to %d:%s via %s\n", can, p, User, Node); */ break; case CAN_ROSE: /* Look for informations on the connection */ rose_ntodnic (Dnic, &addr->rsaddr.srose_addr); rose_ntoaddr (Node, &addr->rsaddr.srose_addr); ax25_ntoaddr (User, &addr->rsaddr.srose_call); sprintf (buffer, "(%d) CONNECTED to %d:%s via %s %s", can, p, User, Dnic, Node); /* fprintf (stderr, "(%d) CONNECTED to %d:%s via %s %s\n", can, p, User, Dnic, Node); */ break; } return (TRUE); } static void clear_can (int canal) { /* fprintf (stderr, "(%d) drv_sock : clear_can()\n", canal);*/ memset (&scan[canal], 0, sizeof (scan_t)); scan[canal].sock = -1; scan[canal].state = DISCONNECT; } static int is_rsaddr (char *addr) { int n = 0; while (addr[n]) { if (!isdigit (addr[n])) return (0); ++n; } return (n == 10); } fbb-7.0.10/scripts/0000755000175000017500000000000013747536100011026 500000000000000fbb-7.0.10/scripts/Makefile.in0000644000175000017500000004151113747457130013022 00000000000000# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2018 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@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) 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 = scripts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_with_curses.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = 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; }; \ } am__installdirs = "$(DESTDIR)$(maintscriptsdir)" \ "$(DESTDIR)$(sbindir)" SCRIPTS = $(maintscripts_SCRIPTS) $(sbin_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ AX25_LIB = @AX25_LIB@ BASEVERSION = @BASEVERSION@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CURSES_LIB = @CURSES_LIB@ CXX = @CXX@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRAVERSION = @EXTRAVERSION@ GREP = @GREP@ 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@ LN_S = @LN_S@ 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@ PACKAGE_VERSION_MAJOR = @PACKAGE_VERSION_MAJOR@ PACKAGE_VERSION_MICRO = @PACKAGE_VERSION_MICRO@ PACKAGE_VERSION_MINOR = @PACKAGE_VERSION_MINOR@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ SVNREV = @SVNREV@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ 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@ runstatedir = @runstatedir@ 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@ maintscriptsdir = $(pkglibdir)/script/maintenance maintscripts_SCRIPTS = \ 20_epurmess\ 20_epursat\ 20_epurwp # Check and see if we are building with X11 support, if we are then # we also need to install the xfbbX script @HAVE_X_LIBS_TRUE@EXTRASCRIPTS = xfbbX sbin_SCRIPTS = fbb $(EXTRASCRIPTS) edit = sed \ -e 's|@sbindir[@]|$(sbindir)|g' \ -e 's|@sysconfdir[@]|$(sysconfdir)|g' \ -e 's|@localstatedir[@]|$(localstatedir)|g' \ -e 's|@prefix[@]|$(prefix)|g' \ -e 's|@libdir[@]|$(libdir)|g' \ -e 's|@docdir[@]|$(docdir)|g' \ -e 's|@package_string[@]|$(PACKAGE_NAME)$(PACKAGE_VERSION)|g'\ -e 's|@package_version[@]|$(PACKAGE_VERSION)|g' CLEANFILES = $(maintscripts_SCRIPTS) fbb EXTRA_DIST = \ 20_epurmess.in\ 20_epursat.in\ 20_epurwp.in\ fbb.in\ xfbbX 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 scripts/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu scripts/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__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ 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): install-maintscriptsSCRIPTS: $(maintscripts_SCRIPTS) @$(NORMAL_INSTALL) @list='$(maintscripts_SCRIPTS)'; test -n "$(maintscriptsdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(maintscriptsdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(maintscriptsdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(maintscriptsdir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(maintscriptsdir)$$dir" || exit $$?; \ } \ ; done uninstall-maintscriptsSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(maintscripts_SCRIPTS)'; test -n "$(maintscriptsdir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(maintscriptsdir)'; $(am__uninstall_files_from_dir) install-sbinSCRIPTS: $(sbin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | 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; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$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_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \ } \ ; done uninstall-sbinSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(sbindir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(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 check: check-am all-am: Makefile $(SCRIPTS) installdirs: for dir in "$(DESTDIR)$(maintscriptsdir)" "$(DESTDIR)$(sbindir)"; 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: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) 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-maintscriptsSCRIPTS install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-sbinSCRIPTS 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: uninstall-maintscriptsSCRIPTS uninstall-sbinSCRIPTS .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am 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-maintscriptsSCRIPTS install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-sbinSCRIPTS install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-generic pdf pdf-am ps ps-am tags-am \ uninstall uninstall-am uninstall-maintscriptsSCRIPTS \ uninstall-sbinSCRIPTS .PRECIOUS: Makefile 20_epurmess: 20_epurmess.in Makefile $(edit) $(srcdir)/$@.in > $@ 20_epursat: 20_epursat.in Makefile $(edit) $(srcdir)/$@.in > $@ 20_epurwp: 20_epurwp.in Makefile $(edit) $(srcdir)/$@.in > $@ fbb: fbb.in Makefile $(edit) $(srcdir)/$@.in > $@ # 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: fbb-7.0.10/scripts/xfbbX0000644000175000017500000002134513613360505011743 00000000000000#!/bin/bash # # Shell file for xfbbX client software # # (C)F6FBB 1986-1998 # # # Directory of xfbbX software XFBBXDIR=`dirname $0` # # Add local PATH PATH=$XFBBXDIR:$PATH # # Temporary resource files XAPPLRESDIR=/tmp/.xfbbX export XFBBDIR PATH XAPPLRESDIR XFBBX=xfbbX_cl # # Prepares the resources # [ ! -d $XAPPLRESDIR ] && mkdir $XAPPLRESDIR [ ! -d $XAPPLRESDIR/bitmaps ] && mkdir $XAPPLRESDIR/bitmaps cat > $XAPPLRESDIR/xfbbX < $XAPPLRESDIR/bitmaps/allchan.xpm < $XAPPLRESDIR/bitmaps/allchn_u.xpm < $XAPPLRESDIR/bitmaps/console.xpm < $XAPPLRESDIR/bitmaps/consol_u.xpm < $XAPPLRESDIR/bitmaps/monitor.xpm < $XAPPLRESDIR/bitmaps/monit_u.xpm < $XAPPLRESDIR/bitmaps/help.xpm < $XAPPLRESDIR/bitmaps/help_u.xpm < $@ 20_epursat: 20_epursat.in Makefile $(edit) $(srcdir)/$@.in > $@ 20_epurwp: 20_epurwp.in Makefile $(edit) $(srcdir)/$@.in > $@ fbb: fbb.in Makefile $(edit) $(srcdir)/$@.in > $@ CLEANFILES = $(maintscripts_SCRIPTS) fbb EXTRA_DIST = \ 20_epurmess.in\ 20_epursat.in\ 20_epurwp.in\ fbb.in\ xfbbX fbb-7.0.10/scripts/fbb.in0000644000175000017500000002441713613360505012033 00000000000000#!/bin/bash FBBCONF=@sysconfdir@/ax25/fbb CONFDIR=@sysconfdir@/ax25/fbb DATADIR=@localstatedir@/ax25/fbb FBBDIR=@localstatedir@/ax25/fbb LIBDIR=@libdir@/fbb SBINDIR=@sbindir@ DOCDIR=@docdir@ DOSDIR=$DATADIR/fbbdos MAILIN=$FBBDIR/mail/mail.in FBB=$SBINDIR/xfbbd FBBLOG=/dev/null # Parse localtime configuration, keeps standard/daylight savings time intact. # - added by N1URO TZ=/etc/localtime # # Do not change following lines # export CONFDIR DATADIR FBBDIR LIBDIR SBINDIR DOSDIR FBB MAILIN FBBLOG TZ # declare -a gives sometime problems... # declare -a PORT_NAME NB_CH PORT_FREQ VERSION=@package_version@ # run batches from the housekeeping directory housekeeping() { echo "Running $1" if [ -d $LIBDIR/script/$1 ] ; then for i in $LIBDIR/script/$1/*; do test -x "$i" || continue echo " script = $i" $i done fi } # send a mail to sysop segv() { MAIL_IN=`fbbgetconf import` SYSOP=`fbbgetconf sysop` cat << EOF >> $MAIL_IN SP $SYSOP Segmentation error FBB gave a segmentation violation on `date` /EX EOF } replace() { if [ ! -f $1 ] ; then return 0 else echo -n "file `basename $1` already exists. Replace (Y/N) ? " read REP if [ "$REP" = "N" -o "$REP" = "n" ] ; then return 1 else return 0 fi fi } make_fbb_conf() { echo "#" echo "# FBB Set-up file" echo "#" echo "# default is @sysconfdir@/ax25/fbb/fbb.conf" echo "#" echo "# may be changed using the $FBBCONF environment variable" echo "#" echo "##############################################################" echo "#" echo "# The following lines are mandatory" echo "#" echo "version = FBB$VERSION" echo "# Callsign of BBS" echo "callsign = $CALL.$ROUTE" echo "# SSID of BBS" echo "ssid = $SSID" echo "# Qra Locator of BBS" echo "qraloc = $QRALOC" echo "# Qth of BBS" echo "city = $CITY" echo "# First name of SYSOP" echo "name = $SYSOP_NAME" echo "# Callsign of SYSOP" echo "sysop = $SYSOP_CALL" echo "# Local time" echo "loca = $LOCALTIME" } make_epurmess_ini() { cat < PX 60 # # PY -> PX 5 # # PF -> PK 1 # # PX -> PK 2 # # PK -> PA 2 # # Cleaning parameters for bulletins (in days) # # BN -> BX 7 # # B$ -> BX 7 # # BY -> BX 7 # # BX -> BK 4 # # BF -> BX 7 # # BK -> BA 1 # # Automatic messages for not-forwarded messages. Days = 0 disables the message. # 255 characters maximum for the line. # # Private messages returned : Timeout link default. (Days + text, $W=new line). 30 Sorry, the following message could not be routed due to link default.$WSuite a un probleme de reseau, le message suivant n'a pas pu etre achemine.$W # # Private messages returned : Unknown route. (Days + text, $W=new line). 2 No defined route for the following message. Please check the h-address.$WPas de route connue pour le messsage suivant. Verifiez l'adresse hierarchique.$W # # Nb of lines max in a returned message 10 # ------ # # Special tests : # # Type To Number_of_days @ ALL 1 > ALL 1 # # End of file # EOF } get_fbb_conf() { echo "" echo -n "Configuration files does not exist. Create them (Y/N) ?" read REP if [ "$REP" = "N" -o "$REP" = "n" ] ; then echo "Cannot run FBB without conf files" exit 0 fi while true ; do echo echo -n "Callsign of the BBS without ssid (Ex: F6FBB) : " read CALL echo -n "SSID of the BBS (Ex : 1) : " read SSID echo -n "Hierarchical address (Ex : FMLR.FRA.EU) : " read ROUTE echo -n "QRA-Locator of the BBS (Ex : JN03QL) : " read QRALOC echo -n "City of the BBS (Ex : Toulouse) : " read CITY echo -n "Name of the SysOp (Ex : Jean-Paul) : " read SYSOP_NAME echo -n "Callsign of the SysOp without SSID (Ex : F6FBB) : " read SYSOP_CALL echo -n "Difference with GMT time (Ex : +1) : " read LOCALTIME echo echo "BBS : $CALL.$ROUTE" echo "SSID : $SSID" echo "LOCATOR : $QRALOC ($CITY)" echo "SYSOP : $SYSOP_CALL ($SYSOP_NAME)" echo "TIME : GMT $LOCALTIME" while true ; do echo echo -n "Correct (Y/N) ? " read REP if [ "$REP" = "Y" -o "$REP" = "y" ] ; then break 2 elif [ "$REP" = "N" -o "$REP" = "n" ] ; then break 1 fi done done # Create fbb.conf file # mandatory part make_fbb_conf > $FBBCONF/fbb.conf # append optional part cat $FBBCONF/fbbopt.conf >> $FBBCONF/fbb.conf } make_port_fbb() { NB=1 echo "# FBB$VERSION" echo "#" echo "#Ports TNCs" echo " 1 $(( $NUMPORT - 1 ))" echo "#" echo "#Com Interface Adress (Hex) Baud" echo " 1 9 0 9600" echo "#" echo "#TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq" echo " 0 0 0 0 0 0 0 0 00/01 ---- File-fwd." while [ $NB -lt $NUMPORT ] ; do printf " %-2s %-2s 1 %-6s 250 2 1 10 00/15 XUWYL %s\n"\ $NB ${NB_CH[$NB]} ${PORT_NAME[$NB]} ${PORT_FREQ[$NB]} NB=$(( $NB + 1 )) done echo "#" echo "# End of file." echo "#" } get_fbb_port() { if replace $CONFDIR/port.sys ; then NUMPORT=1 while true ; do while true ; do echo echo -n "Name of the port #$NUMPORT as named in @sysconfdir@/ax25/axports ( to end) : " read REP if [ -z "$REP" ] ; then break; fi PORT_NAME[$NUMPORT]=$REP echo -n "Number of channels [ex. 4] : " read REP NB_CH[$NUMPORT]=$REP echo -n "Frequency [ex. 145] : " read REP PORT_FREQ[$NUMPORT]=$REP NUMPORT=$(( $NUMPORT + 1 )) done NB=1 echo while [ $NB -lt $NUMPORT ] ; do echo "Port $NB on axports ${PORT_NAME[$NB]} (${NB_CH[$NB]} channels) Freq=${PORT_FREQ[$NB]}" NB=$(( $NB + 1 )) done while true ; do echo echo -n "Correct (Y/N) ? " read REP if [ "$REP" = "Y" -o "$REP" = "y" ] ; then break 2 elif [ "$REP" = "N" -o "$REP" = "n" ] ; then break 1 fi done done # Create port.sys file echo "Creating port.sys ... Ok" make_port_fbb > $CONFDIR/port.sys # Create beaconN.sys files NB=1 while [ $NB -lt $NUMPORT ] ; do FILE=$CONFDIR/beacon$NB.sys if replace $FILE ; then echo "Creating beacon$NB.sys ... Ok" echo "% 15" > $FILE echo "! MAIL" >> $FILE echo "\$d \$Tz Mailbox \$O-\$o (LINUX version)" >> $FILE fi NB=$(( $NB + 1 )) done fi } check_dir() { if [ ! -d $1 ] ; then echo echo "Error : directory $1 does not exist." echo "FBB software was not correctly installed or configured" echo "Giving up !" exit 1; fi } fbb_tree() { echo -n "Checking fbb tree." check_dir $CONFDIR check_dir $CONFDIR/lang echo -n "." check_dir $DATADIR check_dir $DATADIR/mail for n in 0 1 2 3 4 5 6 7 8 9 ; do check_dir $DATADIR/mail/mail$n done echo -n "." check_dir $DATADIR/binmail for n in 0 1 2 3 4 5 6 7 8 9 ; do check_dir $DATADIR/binmail/mail$n done echo -n "." check_dir $DATADIR/oldmail check_dir $DOCDIR check_dir $DATADIR/log check_dir $DATADIR/sat check_dir $DATADIR/wp check_dir $DOSDIR check_dir $DOSDIR/yapp check_dir $LIBDIR/pg check_dir $LIBDIR/filter check_dir $LIBDIR/server check_dir $LIBDIR/script check_dir $LIBDIR/tool echo " Ok" } fbb_conf() { echo "Checking fbb configuration :" if [ -x $FBB ] ; then cd $FBBDIR $FBB -i if [ $? -ne 2 ] ; then echo "Configuration error ! Giving up." echo "Please read file @localstatedir@/ax25/fbb/ERROR.SYS" exit 1 fi else echo "Program $FBB is not found or not executable ! Giving up." exit 1 fi } fbb_end() { echo "Received TERM signal" echo "killproc -TERM $FBB" killproc -TERM $FBB exit 1 } fbb_return() { echo case $1 in 1) # SIGTERM received housekeeping end_session exit 0 ;; 2) # /L and /M sysop commands housekeeping rerun ;; 3) # /K sysop command and normal housekeeping housekeeping maintenance ;; 4) # /A sysop command housekeeping stop_system exit 0 ;; 5) # "Segmentation violation" or "bus error" segv housekeeping sig_segv ;; 6) # /R sysop command housekeeping reset exit 0 ;; *) echo "Unknown return value $1" housekeeping error_return $ret ;; esac } fbb_loop() { PATH=$LIBDIR/tool:$SBINDIR:$PATH export PATH trap fbb_end TERM while true ; do cd $FBBDIR $FBB $FBB_PARAM & wait $! fbb_return $? done } fbb_run() { echo echo -n "FBB options :" if [ -n "$FBB_PARAM" ] ; then echo "$FBB_PARAM" else echo " (none)" fi if [ $FBB_FG -eq 1 ] ; then echo "Running XFBB in foreground mode ^C to abort" sleep 5 echo "Starting XFBB (pwd = `pwd`)..." fbb_loop > $FBBLOG 2>&1 else echo "Running XFBB in background mode ^C to abort" sleep 5 FBB_BACKGROUND=1 export FBB_BACKGROUND echo "Starting XFBB (pwd = `pwd`)..." (cd $LOCALDIR ; $MY_SHELL $FBB_PARAM > $FBBLOG 2>&1 & ) exit 0 fi } fbb_help() { echo "format : fbb [-f] [-h] [-s] [-l log_file]" echo "-f : run fbb in foreground" echo "-h : this help information" echo "-l : log debug info to log_file" echo "-q : run fbb silently" exit 0 } fbb_opt() { MY_SHELL=$0 FBB_FG=0 RUN_BG=0 FBB_SILENT=0 while [ $# -gt 0 ]; do case "$1" in -h) fbb_help ;; -f) FBB_FG=1 ;; -q) FBB_SILENT=1 ;; -l) FBBLOG=$2 shift ;; *) FBB_PARAM="$FBB_PARAM $1" ;; esac shift done if [ -n "$FBB_BACKGROUND" ] ; then fbb_loop exit 0 fi } LOCALDIR=`pwd` # Looking for fbb.conf locations if [ ! -f $FBBCONF/fbb.conf ] ; then cd $FBBCONF cd ../ if [ -f fbb.conf ] ; then cp fbb.conf $FBBCONF else get_fbb_conf fi fi # Check if exists epurmess.ini file. If not create it if [ ! -f $FBBCONF/epurmess.ini ] ; then if replace $CONFDIR/epurmess.ini ; then make_epurmess_ini > $CONFDIR/epurmess.ini fi fi if [ ! -f $FBBCONF/port.sys ] ; then get_fbb_port fi fbb_opt $* if [ $FBB_SILENT -eq 1 ] ; then fbb_tree > /dev/null 2>&1 fbb_conf > /dev/null 2>&1 fbb_run > /dev/null 2>&1 else fbb_tree fbb_conf fbb_run fi exit 0 fbb-7.0.10/scripts/20_epurmess.in0000644000175000017500000000072413615603431013441 00000000000000#!/bin/bash SBIN=`which fbbgetconf` SYSOP=`$SBIN sysmail` HADD=`$SBIN call` MAIL=`$SBIN import` DATA=`$SBIN data` TOOL=`$SBIN tdir` echo echo "--- Running epurmess" echo $TOOL/epurmess ret=$? T1=`cat $DATA/epurmess.res | head -n 1 | awk '{print $1}'` MYTIME=`date -d @$T1` echo "SP $SYSOP@$HADD" >> $MAIL echo "MSG MAINT at $HADD" >> $MAIL echo $MYTIME >> $MAIL sleep 3 sed -i '1d' $DATA/epurmess.res cat $DATA/epurmess.res >> $MAIL echo "/EX" >> $MAIL exit $ret fbb-7.0.10/scripts/20_epursat.in0000644000175000017500000000144413613360505013261 00000000000000#!/bin/bash BINDIR=@sbindir@ DATADIR=@localstatedir@/ax25/fbb SYSOP='/usr/local/sbin/fbbgetconf sysop' echo echo "--- Running satdoc & satupdat" echo if [ -e $DATADIR/sat/amsat.txt ]; then cd $DATADIR/sat echo -e "sp $SYSOP\r\nSATDOC results\r\n" > $DATADIR/satdoc.res $BINDIR/satdoc amsat.txt >> $DATADIR/satdoc.res $BINDIR/satdoc -i amsat.txt >> $DATADIR/satdoc.res echo -e "\r\n/ex\r\n" >> $DATADIR/satdoc.res # cat $DATADIR/satdoc.res >> $DATADIR/mail/mail.in echo -e "sp $SYSOP\r\nSATUPDAT results\r\n" > $DATADIR/satupdat.res $BINDIR/satupdat amsat.txt /n /d60 >> $DATADIR/satupdat.res $BINDIR/satupdat amsat.txt /a /d60 >> $DATADIR/satupdat.res echo -e "\r\n/ex\r\n" >> $DATADIR/satupdat.res # cat $DATADIR/satupdat.res >> $DATADIR/mail/mail.in rm amsat.txt fi ret=$? exit $ret fbb-7.0.10/scripts/20_epurwp.in0000644000175000017500000000073013615603431013115 00000000000000#!/bin/bash SBIN=`which fbbgetconf` SYSOP=`$SBIN sysmail` HADD=`$SBIN call` MAIL=`$SBIN import` DATA=`$SBIN data` TOOL=`$SBIN tdir` echo echo "--- Running epurwp" echo cd $DATA $TOOL/epurwp 40 90 ret=$? T1=`cat $DATA/epurwp.res | head -n 1 | awk '{print $1}'` MYTIME=`date -d @$T1` echo "SP $SYSOP@$HADD" >> $MAIL echo "WP MAINT at $HADD" >> $MAIL echo $MYTIME >> $MAIL sleep 3 sed -i '1d' $DATA/epurwp.res cat $DATA/epurwp.res >> $MAIL echo "/EX" >> $MAIL exit $ret fbb-7.0.10/ChangeLog0000644000175000017500000015247013747536025011050 00000000000000 FBB BBS SOFTWARE HAS BEEN WRITTEN BY Jean-Paul F6FBB IN THE 90s VERSION 5 WAS AT THE TIME OF DOS OPERATING SYSTEM ! VERSION 7 CAME WITH LINUX w700a - Problems with CR orCR/LF in export and log. Corrected. - TimeOut did not work 100%. Corrected. - GPF in review if list was empty. Corrected. - Disks like D:\ were not accepted in FbbDOS. Corrected. - Command NEW in FbbDOS did not give the prompt if no file. Corrected. - F8 was programmed as F9. Should give the focus to the main window. Corrected. - Any command beginning by T was accepted. Corrected. - Send message in console could destoy the contents of the editor. If the editor is busy, normal line editing is used. - Read was always verbose when reviewing messages. Corrected. - Command W in FORWARD.SYS allows to skip one or more prompts (default one) before starting a forward session (mainly used when "Linked to ..." gives more than one prompt) - EPURMESS.COM did not limit the number of lines returned to sender in any cases. Corrected. - The generation of WP messages has been rewritten to correct the problem found on many BBS (but unfortunately not on mine!!!). w700b - Histograms did not work without callsign in statistics. Corrected. - WFBB crashes if the MESS.WP file has a size of 0. Corrected. - Command SYS did not work for callsigns defined in PASSWD.SYS. Corrected. - F7=Programmation of the TNC is now implemented in DED mode. b2 - Only Sysops allowed to review will receive the "Nb of held" message. - PK232 host mode introduced again. - Variable %C gives the number of times a message has been read. - DLL buffer for PG programs is increased to 32K - INSTWFBB : PMS option added in the first connection mask - INSTWFBB : PK232 option in the supported protocols b3 - GPF if using socket from gateway. Corrected. - The default 3 strings for NetRom/TheNet are now: CONNECTED FAILURE BUSY - TELNET interface has been improved. Do not forget to put address 17 in PORT.SYS for TELNET (means socket port 23 in decimal) - File FBB\SYSTEM\LANG\TELNET.ENT may held the banner for the telnet access. - The format of the window has changed. You must delete the line "position" in the part "main" of the file WINDOWS\WINFBB.INI before running the new version. b4 - Edit-User and Edit-Msg are no longer closed with the OK button. - Telnet interface is working as modem interface except that password is mandatory. - Debug informations for VE4KV's modem GPFs (debug info in DEBUG.BUG file). b5 - Servers can be made as DLL provided they are fast enough (no multitasking during a DLL activity). - Task was not run in background if more than one application in CRON.SYS. - Swapping was not done after a local re-routing. Corrected. b6 - Selection of zone in the channel windows. Accept copy (=Ctrl Ins) to clipboard and print. Menu is activated with the right button of the mouse inside the text window. b7 - ListBox of connections has been fully rewritten to be more efficient. A menu is available in the list with the right button of the mouse. b8 - PG called in a non-registered access gave a 23MB inf.sys. Corrected. - L command in review did not unvalidate forwarding after reboot. Corrected. - Command HO puts a message in the hold list. b9 - selection of a word (left double click) or a list of characters (Ctrl left double click). - INIT.SRV was not scanned after a modification from "main parameters" window. - Protocoles TFPCX and DRSI added in the configuration. - HO command did not delete held message. Corrected. - some optimisations and minor modifications... b10 - Import/Export display in options menu. - Filter and substring in "last connections" window. - Hang if the MESS.WP file is exactly 5000 bytes long. Corrected. - in PORT.SYS, interface 9 (linux) has been added. LINUX can work via a serial port (letter D for DED) or via AX25 domain socket (letter X). b12 - Problems with affectation of ports and channels in BPQ driver. Should be corrected. - Problem with the colors in the DOS version. Corrected. b13 - S line (choices of forward) now checks default as a last choice. Up to four previous choices ar checked as declared before. Warning, these tests are case independent. - This was maybe undocumented : value after "use compressed forwarding" give the options between compressed protocoles: 1 = FBB compressed forwarding 2 = XFWD compressed forwarding "OK 3" allow both FBB and XFWD. - MODEM.ENT was sent without line feed at the first connection. Corrected. - Command "?" gave a segmentation violation on the Linux version. Corrected. b14 - One more color bug corrected ! - variable %E give the version code (Linux, Dos, Windows). - debug.bug traces the current channels if "no more channel available" - "Last connections" window was not created in Windows version. Corrected. b15 - hold counter was not initialized in dos version. Corrected. - Dialog window asks for import BBS in Windows and Linux versions. - Reject was not always done when importing files. b16 - Built-in editor validated (Linux version). - Texts of menues corrected (Windows version). - Connections were not recorded in the LOG. Corrected. - PMS connections asked for FBB protocole. I have made a change, but did not test it. b17 - management of C_FILTER has changed. Will be always called if it exists. - Edit forward window (in edit message) now available in Linux version. - Filter on callsigns (in last connections) now available in Linux version. b18 - ReadOnly access if there is no password defined (modem/telnet) b19 - Connect line is case dependant. - Binary transfer implemented for telnet (with this version and up) - Some bug fixes in the Windows telnet interface. - Help was sometime crashing in linux version. Fixed. - New xfbbd version : xfbb daemon for linux. b20 - Flag F (PMS Forwarding) added in EU command. - TH list sometime gave wrong numbers. Corrected. b22 - Linux. Connection bip was disabling the X11 bell. Corrected. b23 - ReadOnly mode was not 100%ok in xfbb. Corrected. - No CrLf when first connecting xfbb on telnet. Corrected. b24 - Labels management of FBBDOS have been rewritten. Path is no longer absolute but relative to the FBBDOS disks defined in INIT.SRV. TLABEL.COM program is no longer required. The format of the file is changed from YAPPLBL.SYS to YAPPLBL.DAT using MODLABEL.EXE program. Labels are compatible with DOS, Windows and LINUX version. - Linux version : YI and YW command gave 0 bytes free. Corrected. b25 - Possible corruption of INF.SYS in Linux version under Telnet. A change has been done. - Get a Crc error when re-starting a FBB compressed forwarding session (XFBB). Corrected. - Error in the "From" field when receiving mail from RLIBBS in XFWD mode. Corrected. b27 - PortName in LINUX was often wrong. Corrected - Epurmess did not count empty lines of INIT.SRV (Linux). Corrected. - = allowed to send data even if the remote station was busy. Corrected. - Checksum of AUTOBIN was wrong under LINUX. Corrected. - WHERE and DU did not work on LINUX partitions. Corrected. - Channel names could not start whith a digit in PORT.SYS. Should be corrected. - SIGSEGV was caught in LINUX version. Corrected. - VIEW command of LINUX version calls fbb_view program. (or any program defined by the variable $FBB_VIEW). fbb_view may be a shell script. - Telnet time-out is increased to 2mn (LINUX) - /A command stops the BBS and exit with value 4 b28 - List of flags of the [FBB forwarding line] (INIT.SRV) 1 : A space is mandatory before the @ in a send message command 2 : The length of the fields of a hierarchical address is not tested to be 6 characters 4 : The header line of a message is not truncated to the space before the 79th character 8 : Header MBL/RLI 16 : If there is no BBS field, the callsign of the BBS is sent to the PMS 32 : Deletes the DATA messages sent to SYSOP 64 : Don't use the BID recovered from headers and use a new one 128: Accepts forwarding only from pre-declared BBS 256: WP Messages are not held. 512: XForwarding protocole has priority on FBB protocole. 1024: Generation of an alternate BID like F6FBB-12345 (for dual BBS site) 2048: Checksum unvalidated on XFwd. 4096: Test of callsign is more simple. - DosFBB has a problem with the call and F10 command. Corrected. b31 - WIN - /A gives a GPF. Corrected. - DOS - Optimisations in Mini-Editor. Was crashing while loading a large file. Corrected. - DOS - ZModem transfer initialisation was wrong. Corrected. - DOS - Commande DOS without argument crashes. Corrected. - DOS - Some characters were lost in modem. Corrected. b32 - ALL - If port.sys does not exist, FBB looks for port_d.sys (dos), port_w.sys (windows) or port_l.sys (linux). This allows to have the same tree for all versions. b33 - LIN - Pacsat server : Some packets were lost. Corrected. b34 - WIN - NO LineFeed in the modem driver. Corrected. - ALL - MD2 password available for SYS command. b35 - LIN - Problem with LF and CRLF in messages. 1st correction. b36 - LIN - Segmentation violation on retry count exceeded. Corrected? b37 - DOS - WINDOWS DLL (C_FILTER, M_FILTER, F_FILTER) Implementation. DLL must in the path of DOS (FBB\BIN). - MD2 C_FILTER.DLL available for DOS and WIN MD2 C_FILTER available for LINUX. b38 - Password did not work for SYS command. Corrected. b39 - Mail import was getting all system processing. Corrected. b40 - DOS - AF5 and Esc closed the BBS. Corrected. - DOS - DLL of KE0W0 was not running. Disabling local interrupts during DLL call. b41 - WIN - Change in maintenance to avoid some crashes. (1st try). b42-b43 _ WIN - Corrections of multiple GPF b44 - ALL - xfwd had problems when forwarding RLIBBS. Fixed. b45 - ALL - Crashed when THEMES.SYS was empty. Corrected. Version 700b distributed c01 - DOS - Crashed when device not ready. Fixed - DOS - CR/CR/LF sequence when exporting mail to disk. Fixed. c02 - ALL - Crashed in REDIST server fixed. - DOS - TFPCX interface crashing at boot. Fixed. - DOS - Added TFPCX interrupt level in INIT.SRV: # DRSI and TFPC interrupt (Hexadecimal, default FF and FE) FF FE # # BBS-UP program (default empty) - DOS - Fwd line : Tried some modifications to fix the UPCASE callsign. c03 - ALL - Added lock files when importing and exporting mail (same filename, extension added or replaced = "lck") - W32 - TfWin32.DLL interface validated. c04 - ALL - Hierarchy is now managed in SWAPP.SYS - DOS - Resync counter did not work. Corrected. - WIN - File/Maintenance always gave the "STOP" icon. Corrected. - ALL - NEW now works in console. - ALL - UNKNOWN ROUTE and 10 times "routed to" message corrected. c05 - ALL - Variables were interpreted when xfwd sends the list of BID. Corrected. - ALL - Lock files deleted (if possible) if older than 1 hour. c06 - ALL - Alternate callsign of PORT.SYS was not working. Corrected. c07 - ALL - Title of message sometime greater than 60 characters. Corrected. - LIN - SP and others did not work from xfbbC. Corrected. - WIN - WP list of BBS was limited to 40 chars in instwfbb. Increased to 79. - ALL - S Line in forward.sys is case dependant. c08 - DOS - I Fxxx was crashing in Nomenclature. Corrected. - ALL - DF command added to list all PMS users. - DOS - /R was crashing. Corrected. - ALL - HomeBBS of a reviewed message was wrong in WP. Corrected. - WIN - No LF in modem after a forwarding session. Corrected. - WIN - GPF with BPQ in gateway in command mode. Corrected. - ALL - Conference allowed calling to TCP interface. Corrected. - ALL - Channel number was 1 more in log. Corrected. c09 - ALL - Added the date correction for > 1999 - ALL - WP was update with local BBS at first connection. Corrected. - WIN - Garbage characters in SERVERnn.IN. Corrected. c10 - ALL - Unproto were sent duplicated if more than one "!" line in BEACONn.SYS file. Corrected. - ALL - Message counter went negative when using "edit message". Corrected. - ALL - Implementation of "exit 5" for PG : Level is not incremented. - ALL - Number of held messages is re-calculated after CRON and PG - WIN - WFBB crashed when opening a non-existing file in editor. Corrected. - ALL - Channel number in conference was wrong. Corrected. Version 700c distributed d01 - ALL - JK gives a wrong channel number. Corrected. - WIN - Socket access : "." before the callsign removes pre-processing and post-processing (transparent mode). Version 700d distributed e01 - ALL - Sharing violation when importing a file. Corrected. - WIN - Socket interface rewritten - ALL - FB command was only printing P messages. Corrected. - W32 - Avail memory gave a wrong value. Corrected. - ALL - D (bin) status of 7+ mail was lost when "RE". Corrected. e02 - ALL - Problems with review command. Debugging version. e03 - LIN - Del User crashed in xfbb. Corrected. - LIN - TCPIP interface did not re-run without a pause. Corrected. e04 - W32 - PG dir has now changed to PG32 - ALL - Copied messages keep the original sender, So SR is now possible on copy (like SYSOP messages). - ALL - Review bug corrected! Thanks to F1HCI for help... e05 - W32 - Lock timeout was not 1 hour. Corrected. - WIN - Language was not ok after sending a message. Corrected. Version 700e distributed f01 - ALL - Disk size could be negative in big disks (>2GB). Corrected. - ALL - PASSWD.SYS now accepts comment lines - ALL - Global password did not work using MD2. Corrected. - ALL - Only CP SYSOP originator is changed, not the SC command. - ALL - When replying to a CP SYSOP message, title is changed back to original. f02 - ALL - Variable %e added. Date of the compilation (english only). - ALL - Time of connection was wrong in talk command. Corrected. - WIN - List of connections was not refresh at end of talk. Corrected. - ALL - Crash if "XFWD" validated and "FBB forwarding" not. Corrected. - ALL - Added commands for WP: IN substring -> Gives WP records including "substring" in Name IQ substring -> Gives WP records including "substring" in Qth - WIN - First watchdog implementation. Sends characters 0 and 1 each second to the port specified in INIT.SRV. This port must be free: # # Test mode / Watchdog (1->9 = COM1->COM9, 81->84 = LPT1->LPT4) NO 81 # - ALL - Support of the SCS/PCT-II pactor TNC TNC is in Extended/WA8DED emulation with a "H" character in port.sys: # #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq 0 0 0 0 0 0 0 0 00/01 ---- File-fwd. 1 1 1 0 250 4 1 10 30/60 HU Pactor 2 8 1 1 250 4 1 10 30/60 HUWY 1st Packet 3 8 1 2 250 4 1 10 30/60 HUWY 2nd Packet # - WIN32/LIN - Message was recompressed at each forward. Corrected. - ALL - Added cron_d, cron_w, cron_l.sys taken in priority for DOS, WINDOWS or LINUX system. If this one doesn't exist, cron.sys is taken instead. - LIN - Wrong callsigns were recorded in INF.SYS in telnet mode. Corrected. f03 - ALL - Added the PTC-II remote control from forward file. - ALL - Added the fequency-status information before connection - ALL - Added the PTCTRX built-in program to pilot the transceiver from PTC-II The parameters are the same that the TRX command of the PTC-II Example: " X PTCTRX SCAN 1 " will start scanning from forward file. f04 - ALL - Changed BUSY to DISCONNECT when a frequency is busy. Allows multi-choices from the FORWARD.SYS file. f05 - ALL - More debugging of pactor mode f06 - WIN - Added the "Immediate disconnection" command. f07 f08 - WIN - Some more debugging in PACTOR interface f09 - WIN - L !TRX command was crashing when out of block. Corrected. - WIN - Packet ports of the PTC-II implemented. - WIN - Update of InstWfbb for PTC-II protocole f10 - WIN - Connection was still sent if aborting during wait phase. Corrected. - WIN - MAINT file did not work with PTC-II. Corrected. f11 - WIN - PTCTRX was not run from CRON.SYS. Corrected. - WIN - Display of long path callsign was wrong. Corrected. - ALL - Compilation of the f11 version on all architectures. f12 - WIN - Added a scanning control command. - ALL - Forced disconnection if not disconnected after 10 sec. f13 - ALL - New variable %k = Nb of KB to forward to the connected station %l = Nb of msg to forward to the connected station - ALL - Flag R (Read-Only) in port.sys available for any port. f14 - ALL - Added a "IF G hour" test in GMT time for FORWARD.SYS and CRON.SYS - WIN - Retry field in main window increased to 3 digits - WIN - ChangeOver button for pactor mode f15 - ALL - More debugging f16 - WIN32 - Size of NTFS disk was wrong. Corrected. f17 - f18 - ALL - More debugging f19 - Command line starting with a ";" is ignored - Speed information in the footer when sending in pactor mode - PTC-II is fully reset to work in binary mode. Think that all parameters will be erased in the TNC. f20 - New alternate files : INIT.SRV -> INIT_x.SRV FORWARD.SYS -> FORW_x.SYS PROTECT.SYS -> PROT_x.SYS f21 - New command line in CRON_x.SYS : M port U : Port nb is changed to USER mode M port B : Port nb is changed to BBS mode M port G : Port nb is changed to GUEST mode Version 700f distributed g01 - WIN - INIT.SRV is not found when reloaded from Config->MainParameters - ALL - PACTOR - Added F command in gateway for frequency selection. Added the gateway.sys file to configure the frequencies. This file accepts the following commands: IF / ELSE / ENDIF (for port and time) BEGIN : commands sent when entering the port of the gateway END : commands sent when leaving the port of the gateway FREQ : Affectation of a frequency / TNC command g02 - ALL - Gateway was crashing when all channels are busy. Corrected. g03 - ALL - ChangeOver was not sent from the gateway. Corrected. g04 - ALL - Added Minute/Period option in the "P" command line in CRON_x.SYS: M port U 10/20 : Port nb is changed to USER mode and min/per to 10/20 - ALL - CRON file accept the litteral port definitions of PORT.SYS. Example: M PACTOR U 10/20 - ALL - The callsign of the pactor channel was lost in the gateway. Corrected. g05 - ALL - Implementation of the CQ command of the gateway for pactor. g06 - ALL - Bug in the gateway made it crashing when no port was selected. - LIN - xfbbC and client interface of xfbbd fully rewritten. - LIN - maintinf has been compiled g07 - LIN - Added monitoring options in xfbbC g08 - LIN - Added MD2 authentication in xfbbC g09 - ALL - Default password allowed in MD2 authentication. g10 - LIN - Added new services for xfbbd client (xfbbC). Source code and makefile of xfbbC supplied. g11-g16 - LIN - Evolutions of the PTC-II hostmode g17 - WIN - Added the Flex95 support in WinFBB32 g18 - WIN32 - New FBBIOS32.DLL for WIN32 modem interface - WIN32 - Console callsign did not work in Flex mode - Done. g19 - ALL - Security problem with files owner under FBBDOS corrected. g20 - LIN - Added the TCP address and port for telnet access in port.sys. #Com Interface Adresse(Hex) Vitesse/Tcp-Port 8 9 44.151.31.6 1022 - LIN - External set of commands added (or replacing) the default set. These commands are defined in system/commands.sys. Example: # # commands.sys file # format: fbb_command external_command parameters... # TX cat /etc/ax25/axports FPAC /usr/sbin/fpacnode TELNET telnet g21 - LIN - Daemon version now allows the T (talk) command. Must be answered with either xfbbC or xfbbX. New versions of xfbbC et xfbbX. g22 - LIN - Filenames in F_FILTER file are now in UNIX format. g23 - LIN - Source code of the daemon version is released g24 - LIN - Compilation with libc6 ok (RedHat 5.1) g25 - ALL - Spurious empty lines - corrected (PA3FWM). - ALL - Redist to field too short - corrected (OH2KKU) g26 - LIN - Sources compatible with 2.2 (SuSE 6.0 / 2.2.4) ============== release 7.01 for 2.2 kernels ==================================== added support for the new libax25 with glibc 2.x X11 applications can compile with motif2.0 and lesstif 0.88 (motif 2.0) all X11 applications moved in src/X11 directory - LIN - New configuration file /etc/ax25/fbb.conf replaces init.srv. It is not compatible and is now organized as keyword = value - LIN - To be compliant with the files organization on LINUX, a new tree has been defined: - configuration files in /etc/ax25/fbb - data files in /var/ax25/fbb The program fbb_tree script creates/check the full tree. 7.01b : - LIN - xfbbC and xfbbX did not work. Corrected. - LIN - reqdir server modified following the patch of 7m3tjz Satoshi - LIN - xfbb and xfbbX compiles with lesstiff 0.88 7.01d : - LIN - Segmentation violation if a directory in fbb.conf has no leading / 7.01e : - LIN - fixed a segmentation violation in AX25 socket. 7.01f : - LIN - PG programs did not work. Fixed. 7.01g - LIN - "CP SYSOP" messages can give wrong WP information when re-forwarded. Fixed. - ALL - Y2K bug in satellite computation. Fixed. 7.01h - ALL - Y2K bug in LD and WP import processing. Fixed. 7.01i - LIN- Y2K bug in fbbdos. Fixed. 7.01j - COPY command could only copy onto an existing file. Patch PA3FWM. - YN never find new files. Patch PA3FWM. - Added #MYPACTOR command to set the pactor callsign from inittnc file. 7.01k - PPC and SPARC support. Patch JE1SGH - Ichiro Hieda. 7.01l - MAIL.IN did not work correctly. Fixed. - FB commmand now take in account the data mode (J line of forward.sys) - Patch fbb_old_ax25.patch.gz : allow using this version with 2.0 kernels run "zcat fbb_old_ax25.patch.gz | patch -p0" from the fbb distribution base directory. Thanks to Jose. 7.01m - Added line "T Onn" in forward.sys where "nn" is the number of hours of the message forward delay. If nn is 24, then only mail older than 24 hours will be forwarded to the connected BBS. - New "install_fbb" and "fbb" scripts. The software is no longer run by xfbb.sh but by "fbb". 7.02 - full distribution and pre-compiled binaries 7.02a - added remote config directory list, upload and download for the xfbbC client. 7.02b - L commands may be combined on a single line: LR 101-110 & LS string - CHANGED the directory tree (see FBBTREE file) to fit the linux specifications - Added the TCP-IP driver for remote traffic and monitoring operations 7.02c - L> l@ were L<. Corrected. 7.02d - Other patch for L>, L< and L@ - Added remote forward maintenance for clients - Added EO sysop command to edit sytstem options 7.02e - Servers did not work correctly (upcase path -> lowcase) - Corrected. - Error in fbb.conf.sample - Corrected. - Fixed the default header string - Fixed a path bug in REQDIR 7.02f - Added the disconnection client-service 7.02g - Added Edit-User client-service - Added Edit-Message client-service 7.02h - Added full page message editing client-service - Minor changes in install.sh and fbb scripts - epurwp and epurmess only test major number version - Possible crash if "import" is defined in fbb.conf. Corrected. 7.03pre1 - Added maintenance, rerun, and other subdirectories in lib/fbb/script directory Executables in these subdirectory are run during housekeeping phase 7.03pre2 - Added hostname lookup for TCP-IP outgoing connections - Wrong disk size with Windows clent. Corrected. - Fixed some minor bugs in fbb and install_sh scripts 7.03 - Official release 7.03a - In forwarding mode, FQ no longer disconnects. Only wait for remote disconnection. - Multiple bug fixes in the client interface. 7.03b - Added MsgEdit flag in EO sysop command (full screen editor for messages) 7.03c - Changed the timeout during message edition. - Removing % in front of the call for PTC-II v3.1 7.03d - Fixed pactor marine firmware implementation for PTC-II 7.03e - Fixed the FOPEN_MAX (reduced from 256 to 16 ???) of stdio.h which gave errors in binary files. 7.03f - Made protect.sys working correctly. Protection is now made for the directory tree, not only the directory. - WHERE command in FbbDos always searches in the FbbDos directories even in sysop mode. Depth is limited to 16 sub-directories. - LABEL command allowed on protected areas. Needs security 16 (EDIT LABEL) to be used and security 32 (DELETE ANY FILE) for editing any file. - Fixed the SC problem in 7.03e. 7.03g - Support for long filenames in FbbDos 7.03h - Multiple bugs corrected for long filenames support - Spaces accepted in filenames (need double quotes) 7.03i - Connections are no longer accepted before maintenance - Sx call + filename accepts lowcase filenames 7.03j - wrong filenames displayed in FBBDOS - DU command - Minor changes in text files for EU command (PMS = F flag added) 7.04 - Official release 7.04a - Check pactor sending before asking for scanning - Added POP3 support (be sure your port 110 is free) : You have to declare a new COM and PORT in port.sys like (port = 110): #Ports TNCs 1 1 #Com Interface Address (device) Baud 6 9 6e 0 #TNC NbCh Com MultCh Pacln Maxfr NbFwd MxBloc M/P-Fwd Mode Freq 1 4 6 0 250 7 2 10 10/60 SU Pop3 7.04b - Some bug fixes in the POP driver - Added UIDL command to the POP server 7.04c - Added APOP command in POP server - Added SMTP server : in port.sys add the SMTP port address like pop_hex_port:smtp_hex_port #Com Interface Address (device) Baud 6 9 456:401 0 - Some more bug fixes in the POP driver - Some more new bugs in the POP/SMTP driver - Added config key "pophost" in fbb.conf to define the pop hostname If this value is defined , the address line will be: else the address will be (default) - Support multiple recipients in SMTP 7.04d - Some more bug fixes in the POP driver - Bloc buffered POP input for faster processing - Pop delete messages on long lists fixed - Added %I variable gives the name (if known) of the message sender from WP. 7.04e - Implementation of the NNTP server 7.04f - Bug fixes 7.04g - POP channels only monitored with the import/export display option - Number of channels increased to 99 (96 available) - Number of ports increased to 16 - changed 'FW 9' to 'FW 0' to start forward on all ports - Added the forgotten October month in pop dates - Added the SMTP LOGIN and PLAIN authentication - Added the port configuration by a port_name.prt file: If the PORT 2 is called network in the port.sys file,then The system first look for a network.prt file, then a inittnc2.sys file if the network.prt file does not exists. - Configuration of the smtp/pop driver by the port file (one or more lines): SMTP authentications - One or more options (default NO): SMTP AUTH (NO | LOGIN | PLAIN | CRAM-MD5) POP authentications - One or more options (default USER): POP AUTH (USER | APOP) Example of my pop_smtp.prt file: # # POP/SMTP/NNTP configuration file - F6FBB # # SMTP authentication nedded. Accepts LOGIN, PLAIN and CRAM-MD5 SMTP AUTH LOGIN PLAIN CRAM-MD5 # POP authentication. USER and APOP accepted POP AUTH USER APOP # # end of file # 7.04h - Enhanced capabilities in the themes.sys file. This file is up-compatible with previous versions. Added parentheses and !, &, |, @ operators: & means "expression and expression" | means "expression or expression" (optional for up compatibility) ! means "not expression" @ means "via field" fra.achat ACHAT* & @FRA fra.vente VENTE* & @FRA fra.echange ECH* & @FRA cherche SEARCH CHERC* RECHER fra.satellite @FRA & (AMSAT | SAT* | UO22 | KO23 | UOSAT | PACSAT | DOVE | KEP* | SPACE | PHASE3 | ISS | PCSAT | NASA) ww.satellite @WW & (AMSAT | SAT* | UO22 | KO23 | UOSAT | PACSAT | DOVE | KEP* | SPACE | PHASE3 | ISS | PCSAT | NASA) 7.04i - POP/SMTP/NNTP ports may be unvalidated with the port value 0 in port.sys # #Com Interface Address (device) Baud 6 9 0:0:45f 0 # - cron.sys - All ports need the value 0 instead of 9 (GATE 0 or YAPP 0) - Added a CR after the messages header for POP 7.04j - POP addresses without "<>" were not accepted (F4ECW) - Multiple security fixes (SM6TKY) 7.04l (F6BVP) - includes patches for 2.6 kernel - improvement for satellite documentation file status (see SATDOC doc) 7.04m (F6BVP) - was buggy. DO NOT USE. 7.04n (F6BVP) - compliant with 2.6 kernel - base directory tree is now /usr/local/ by default (standard for AX25 applications) except /usr/lib/fbb/ 7.04o (F6BVP) - lib/fbb moved to /usr/local/lib/fbb (for easier backup) - script 20_epursat called during maintenance - AMSAT declared as BBS in bbs.sys - amsat.fwd declared in forward.sys - satupdat (ajoursat) and satdoc included - satupdat and satdoc doc files included - HTML bbs documentation included (start with doc.htm) - fbb script fbb.rc (start - stop -status - restart) - /var/log/fbb.log log file 7.04p (F6BVP) - this version only corrects compilation errors for xfbbX client. - lesstif, lesstif-devel, libxpm and libxpm-devel packages must be installed. - fbb has to be compiled first (and installed). - then cd into fbb src/X11 directory and run make. - give xfbbX and xfbbX_cl executable permission and copy both files into /usr/local/bin - start fbb using rc.fbb script (or fbb) and run xfbbX client from an X11 console. 7.04q (F6BVP) - Includes LA7ECA scan fix for PTCII pactor mode - Some format fixup in init messages for easier debuging display when starting xfbbd with options -v -f - Makefile in src and X11 did not use the right path for include NEW_AX25. Fixed 7.04r (F6BVP) - This version has been successfully tested with 2.6.28 SMP kernel with a Core2 Duo CPU system. However default recommandation is still to add "nosmp" argument on kernel GRUB boot command line. - zero length data are no more sent via snd_sck() and snd_tcp() functions. - Please avoid using more than 40 channels in port.sys to prevent forwarding problems. - There are probably still other unknown bugs in FBB. Any observation report is thus appreciated. When FBB 7.05 is released it should include (in file sock_drv.c) function sock_stat /* * valid when ROSE module is patched for * ax25_info_new structure * struct ax25_info_struct_new ax25info; * if (ioctl (scan[canal].sock, SIOCAX25GETINFONEW, &ax25info) == 0) * */ 7.04r.2 (F6BVP) - less verbose debugging messages in /var/log/fbb.log - Added usleep instructions to allow interrupts in tcp and sock drivers and reduce CPU load. It was sometime more than 14% and should be less than 1% now. 7.04r.2.1 (F6BVP) - s_status was writing zero length frame. Corrected - date structure corrupted in ibm.c caused stack-smashing. Corrected. - changed date format tm_year %100 in console.c to avoid stack overflow due to incorrect date format during FBB initialization. - CFLAGS = -Wall -Wstrict-prototypes -O2 -funsigned-char $(DEFS) -D__LINUX__ -Wformat-security -D_FORTIFY_SOURCE=2 -DPROTOTYPES -I../include -fstack-check -fstack-protector-all (this DEBUG option is removed in distributed package) 7.04r.2.2 (F6BVP) is 7.04r6 - cree_bid() did not actually create WFBID.SYS and initialize it if file was missing. This could induce a segment violation. Corrected. - In case of test or PRE versions the full release number is displayed: ********************************************************* * XFBB Linux daemon version 7.04r-pre6 (Sep 18 2009) PID=9172 - Same full version number is used in /var/ax25/fbb/log/ files 070522165800SI *** BBS Initialize 070522170200SA *** BBS Online 7.04r-pre6 - By default 20_epursat script does not export satdoc and satupdat results to mail. 7.04r.6.1 (F6BVP) - A bug was causing stack smashing with some kernels when message on hold was found. Corrected. Thanks to Charlie K4GBB, allowing intensive debugging on his LinuxLab machine and W4AKH-1 BBS. 7.04r.7 (F6BVP) - Removed bugs in satdoc (SATellite DOCumentation utility) version 2.8.6 - AMSAT Weekly Satellite Report have two BID types : $ANS and $WSR. Updated Satdoc version 2.8.9 - Updated ajoursat - satupdat utility programm for satellites data base. Version is 1.87 - Doc files for both above utilies updated and renamed with 8 + 3 characters. - register instructions removed (ignored by modern compilers) - FBB log is now labeled with year date. For example: /var/ax25/fbb/log/fbblog.47 is now ~/fbblog09.47 7.04r.8 (Cathryn at junglevision dot com) -segfaults in themes.c was crashing FBB with the nntp option when the bulletins are reset. When the user attemps to read a non-existent bulletin fbb crashes. "This patch is for the Usenet server feature of FBB. I put in code so that it is now possible to post from the USENET connection. The password checking code is taken from the SMTP code. I also put in a few changes to use snprintf rather than sprintf to prevent buffer overflows. I don't believe this is all the places where this occurs, but I changed this when it was convenient. I added a new function pop_quit to replace the code in this file where it was sending a QUIT message to pop_process_read. I found that the original code was failing under some complicated circumstances, and that it was less confusing to have a separate routine to quit directly to fix these crashes. I also fixed a crash in pop_send that occurred when reading large messages. I updated the NNTP headers as follows. I added the Newsgroups: line. When you reply message from a USENET client, it will send the output to TODAY@WW matching the original distribution of the message. I Removed the group name from the Subject, and I canged the Message-ID to match the PBBS BID ID. This makes the message lookup more robust in the case the themes.sys file changes." 7.04r.9 (F6BVP) - A bug was causing stack smashing with DOS menu and long Linux file names. Corrected. Thanks to Peter ZL2BAU who reported this bug and helped tracing the cause. 7.04r.10 (F6BVP) - channel timeout was not initialized at startup and after a timeout occured. - "BBS Quit" now displays FBB version in log file. - Another bug was causing stack smashing with YAPP transfer and long Linux file names. Corrected. Thanks again to Peter ZL2BAU who reported this bug and helped tracing the cause. 7.04r.11 (F6BVP) - Starting a local console FBB client xfbbC caused a segment violation if another console was already connected localy. Cured. - corrected a compilation warning with xfbbC.c 7.04r.12 (Cathryn Mataga) - SOCK_MAXCHAN (drv_sock.c) now set to (MAXVOIES) This was set to 50, which was less than MAXVOIES, and the code was accessing data off the end of this table. This was causing strange problems. After I made this change the gateway function started working again. If anyone was having trouble with xfbbd and RF radio connections, this change may possibly fix their problem. - Several minor changes designed to eliminate "Bad file descriptor" error messages. These occurred at the time of housekeeping due to a minor bug. The messages actually turned out to be harmless, as far as I can tell. - Only use the signal handler for signals that have functionality in the code. This is a simplification to prevent bugs. Other signals are set to SIG_IGN. 7.04r.13 (F6BVP) - Compressed forward is repared on 64 bits Linux system. After bug removal it has been tested on 32 bits machines. For using compressed forward, do not use "N 1" argument in forward files. 7.04r14 (F6BVP) - This version is without debugging messages going to log file. It will be renamed 7.05 if no major bug is reported. 7.04r14.1 (F6BVP) - Three Patches from John Goerzen "I'm working to get 7.04r13 into Debian. As part of doing that, I've been reviewing the patches that Debian has in place to find which ones are still applicable. I have these three to send you that I think are relevant. John". 7.04r14.2 (F6BVP) - For some obscure reason LA7ECA scan fix for PTCII pactor mode included in 7.04q was missing. Applied again. - While we are at it, lets include PACTOR CQ patches from DM3TT compilation. 7.05 (F6BVP) - 7.04r14.2 is without major bug and can run on different systems. It is renamed 7.05 7.05a (F6BVP) - A bug in xfbbd prevented the correct display of PG programs execution. Corrected. - 7plus application via server and PG 7plserv, 7plus executable, 7pfbb script (50_7pfbb) was broken. Found 7plsrc.225 archives *** 7PLUS ASCII- Encoder/Decoder, (c) Axel Bauda, DG1BBQ *** It would not compile with Linux 2.6. Modified install_sh installation script. It performs all to have a complete 7plus files managment system. Small README file written and all utilities put into 7plus.tar.bz2 archive. Published. 7.05b (F6BVP) - sh: message about c_filter removed even if this filter application is not present. - Gustavo / I0OJJ signaled another failure concerning the D (info) feature which is on the (F) menu: the (D)irectories of *topics* are missed; the 'documents' may be regularly read but cannot be labeled by sysop. Corrected. In D menu, for labelling a file, Sysop command is D followed by file name, followed by a description texte no more than 30 characters. Users may navigate into doc directories with CD and list files using L command. Labels follow file names, and a user will read a document file by entering its file number. 7.05b (F6BVP) - Gustavo / I0OJJ sent a well documented series of bug report: 1. Millennium bug (?) in the FBBDOS dates of files and directories. Dates where 20 years away! Corrected 2. CANNOT CHANGE DIRECTORY BEYOND THE YAPP DIRECTORY with error message: path too long. Under investigation. 3. PING sends a SERVER error report to the BBS Sysop while the ACK message is replied *correctly* OK:! Under investigation 4. Bug description: two messages (simultaneously) issued by xfbb. A first *** SERVER ERROR *** issued by xfbb 7.05b and a second *CONCURRENT* message to callsign making the request (CORRECT OPERATION). Under investigation. 7.05c3 (F6BVP) - Gustavo / I0OJJ reported : CANNOT CHANGE DIRECTORY BEYOND THE YAPP DIRECTORY. Corrected. - Gustavo / I0OJJ reported that M, MH and MHA command crashed FBB. Corrected. 7.05c4 (F6BVP) - Peter ZL2BAU reported that FBBDOS command cd .. was crashing FBB. Corrected. 7.05c5 (F6BVP) - Charley K4GBB asked "With todays RTC clocks and NTP servers is there still a need to freeze the Housekeeping process because the last check failed?". Corrected. epurmess no more checks the date of epurmess.res. - "Official libax25" introduced a new feature in ax25_ntoa() function removing SSID 0 in callsigns when present. This has been a major source of AX.25 application programs dysfunctions. A new local function _ax25_ntoa() is used by FBB to avoid such issues. 7.05c6 (F6BVP) - Gustavo / I0OJJ noticed that the *english.txt* file from the source archive did not conform anymore the *original* style, so xdfbb does not work with the 'outpost' and other new terminal programs. Gustavo fully revised the original "english.txt" and "english.hlp" files to overcome that lack. Thanks to Gustavo I0OJJ, both new english files are included in this version. SYSOPs are encouraged to copy these files from conf/lang/ directory into BBS ~fbb/lang/ directory. 7.05c7 (F6BVP) - Corrected small bug in lzhuf warning message. 7.05c8 (F6BVP) - Corrected small bug in lzhuf warning message again. 7.05c9 (F6BVP) - First FBB week log number of year YY starts with number 0 (was 52) i.e. /var/ax25/fbb/log/fbblogYY.00 7.05d (F6BVP) - Charley K4GBB provided an improved fbb.sh start script (formerly rc.fbb). 7.05e (F6BVP) - xfbbC client caused segmentation fault on RedHat distro. - Makefile did not include -g flag, another possible source of segmentation fault. 7.05f (F6BVP) - Compiling 7.05f will fail In Ubuntu 12.04 (and possible also in Ubuntu 11) and later because of the ncurses issue when it tries to link XfbbC. Bob VE3TOK provided a cure to avoid this issue. Now it will compile and link with gcc 4.5, gcc 4.6 and also with the older gcc 4.4 - Changed some debuging message - removed packed attribute in pacsat.c that was generating unwanted compile warnings - Added warning to send a message to Sysop when unregistered tcp client. Patch by Tom SP2L. - Conditional compile on 64 bit systems to keep 32 bits FBB data format compatibility. Patch by Cathryn Mataga. Define THIRTYTWOBITDATA if you are bringing in data from 32-bit versions. This creates datafiles that match the origin documentation for FBB. They are not compatible with files created with 64-bit versions. Edit file include/fbb_serv.h and edit line 38 showing: /* #define THIRTYTWOBITDATA 1 */ ^^ ^^ Remove these 4 marked characters if you want to keep your FBB data compatible 32 bit system. 7.05g (F6BVP) - A few patches by Colin Tuckley G8TMV Debian developer: Add a basic manual page for fbbgetconf written by Joop Stakenborg and fix spelling mistakes. The two directories src/X11/res and src/X11/res/bitmaps needed to have their permissions changed to 755 so that they can be listed and inspected by the normal user. Add a Makefile in fbb main source file directory. In src/Makefile LIBS = -lm -lax25 - From F6BVP: moved conditional fbb_open() prototype to comply with Debian extended checking compiler. 7.0.6 (VE7FET) - This version receives a standard autotool facility to help install fbb package on different distro of Linux. Read README file in order to see the new command line sequence to enter for compiling and installing the full set of FBB routines. 7.0.7 (F6BVP) - All project is moved to SourceForge repository Linfbb for easier maintenance and collaborative project handling. [r] displays the patch number. - First patches were made for customization of the project to our new tools. - [r18] Quit routine added by N1URO for cross-platform command set compatability with URONode, FlexNet, Xnet, and others. BBS command Q (quit) will act exactly like B (bye). - [r20] Added PACTOR in Pactor CQ as suggested by G4APL SysOP GB7CIP. - [r24] Added port.sys.sample sample file. - [r26] Removed "No PACSAT satellit protocol configuration file 'init.pac'" warning. - [r27] Added strupr() in redist.c to cure compiler-loader issue as reported by Charley K4GBB. - [r29] Empty LETTER field removed from version.h for 7.06 compatibility (bug reported by Peter ZL2BAU). - [r30] Increased length of characters copied in wp buffer message for long list (N1URO). - [r31] lang/english.hlp amended by Brian N1URO and including new Quit command. - [r32] Increased QRA locator field to 10 characters asked by Tom SP2L. - Removed a couple of old bugs reported by Paul G4APL (In TCP driver and themes date). - [r34] - f6bvp: modified README to explain correct location of fbb.sh in /usr/local/share/doc/fbb/ - [r35] - f6bvp: drv_tcp.c:623:9: warning: too many arguments for format reported by Paul G4APL. - [r36] Probably a parameter inversion detected by 0 length warning reported by Paul G4APL - [r38] epurmess.ini was not correctly checked and created if missing - [r39] Updated francais.hlp and ChangeLog. - [r40] fbb.conf is now in /usr/local/etc/ax25/fbb and automatically copied there if fbb.conf is present in parent directory. updated doc/fbb.conf.sample to reflect new location. - [r41] fixed variable substitutions in 20_epurwp and 20_epurmess - [r42] removed unused code from serv.h - [r43] Bug #3 fixed missing substitutions in xfbbC.c that were preventing ncurses support from being compiled. - [r44] Bug #6 changed linker flag for -lax25 from LDFLAGS to LDADD to resolve compiling issues on newer gcc versions - [r45] Upate ChangeLog. - [r46] Bug #8 changed src/X11 linker flag for -lax25 from LDFLAGS to LDADD. Update ChangeLog. - [r49] Bug #8 move linker flags for Xlibs from LDFLAGS to LDADD. - [r50] port.sys.sample installed with make installconf to provide a sample port.sys file for new BBS install. - [r51] Update ChangeLog. - [r52] Bug #1 make /lang files and amsat.fwd only overwrite/install with make installconf. - [r53] Remove obsolete code that checked for OLD_AX25 (for version 2.0 kernels) If you're kernel is THAT old... you REALLY should upgrade your box. - [r54] Fix a couple more variable substitutions in help texts of fbb shell script. - [r55] 'ctrl-C' 'ctrl-Z' and 'ctrl-\' disabled in console client xfbbC (bug reported by Gustavo I0OJJ). - [r56] fbbgetconf updated to defined parameters version and added usage message. - [r57] All conditional compile depending on LETTER and BETA removed from source code files. - [r58] Update ChangeLog. - [r59] In Satupdat we are now using fgets() returned value to avoid compiler warnings. Update ChangeLog. - [r60] In Ajoursat we are now using fgets() returned value to avoid compiler warnings. - [r61] Replaced INIT.SRV text in X11/xfbb.c - [r62] In xfbb.c use of uintptr_t and intptr_t cast suppress different size compiler warning. - [r63] In xfbbX.c use of uintptr_t and intptr_t cast suppress different size compiler warning. - [r64] In xfbbXcnsl.c use of uintptr_t and intptr_t cast suppress different size compiler warning. - [r65] In xfbbpndd.c use of uintptr_t and intptr_t cast suppress different size compiler warning. - [r66] In xfbbedtm.c use of uintptr_t and intptr_t cast suppress different size compiler warning. - [r67] In xfbbcnsl.c use of uintptr_t and intptr_t cast suppress different size compiler warning. - [r68] ChangeLog reformated to 80 characters per line (Thanks to Tom, SP2L). - [r69] In tncio.c added (intptr_t) casts to avoid compiler warning and possible bugs! - [r70] Update ChangeLog. - [r71] Added prototype for newly introduced usage() in fbbgetconf.c - [r72] Added limits.h, stdio.h, and perror to configure checks. - [r73] Oops, forgot to update some files for version release. - [r74] Update versions in their appropriate files. - [r75] Tagging this as release 7.0.7 7.0.8 (F6BVP) - [r76] Create 7.0.8 branch for development. - [r77] Update all instances of FBB version to use one source and eliminate version.h. - [r78] Including is necessary for sprintf() prototype in date.c - [r79] Update ChangeLog. - [r80] Minor editorial changes. - [r81] Minor editorial changes. - [r82] Update ChangeLog. - [r83] Update ChangeLog (changed not valid sp2lob callsign to SP2L). - [r84]-[r92] Removed codes. - [r93] Update ChangeLog. - [r94] Update ChangeLog. - [r95] Update ChangeLog. - [r96] - [r106] Remove code in branches/7.0.6 Update ChangeLog. - [r107]- In DOS format, end of lines had a Carriage Return and Line Feed (0D/0A hex), couple of characters for old TeleType machines needed both to instruct the TTY carriage to go to a new line. In Linux there is a single character (0D hex) for new line. Update ChangeLog. - [r109] Changes in xfbbXabtd.c to remove possible errors and compile warnings - [r110] Uninitialised structure in drv_sock.c detected with valgrind - [r111] Terminal.c updated in order to remove compiler warnings - [r112] Removed unused variable 'ok' in console.c - [r113] Removed unused variable 'nb' in drv_aea.c - [r114] Removed unused variable drv_pop.c and drv_mod.c - [r115] Removed unused variables in drv_sock.c - [r116] Removed unused variable in fwdovl1.c 7.0.8-beta (F6BVP) - [r117] Change version number in xfbbC to reflect package version. - [r118] removed unnecessary fbb.conf version number check in maintinf.c - [r119] Not using curses in xfbbC client implies we are in console mode - [r120] User can quit xfbbC monitor mode with character - [r121] fbbgetconf did not read key options - [r122] fbbgetconf displays key result on first line - [r123] Update ChangeLog. - [r124] struct array 0 init in drv_tcp.c and trait.c and removed commented debug lines - [r125] No character when Linux in init_tnc.c - [r126] No character when Linux in init.c - [r127] More character removed and fbb.conf instead of INIT.SRV with Linux - [r128] More characters removed in FBB init process with Linux OS - [r129] Still more characters removed in FBB init process - [r130] port.sys.sample.in showed wrong port.sys destination directory - [r131] Initializing arrays and structures to 0 in order to avoid memory leaks - [r132] More arrays and structures initialized in order to avoid memory leaks - [r133] End-of-line of messages adapted to Linux OS in epurmess - [r134] End-of-line of message adapted to Linux OS in epurwp - [r135] Yet another wrong new-line for Linux OS in epurwp - [r136] Other updates of and new-line for Linux OS versus DOS/WINDOWS in init.c - [r137] Partially reversing r133 commit of epurmess.c - [r138] Update ChangeLog. - [r139] Initializing arrays to 0 in drv_tcp to avoid memory leaks - [r140] Removed two printf and included sprint for case WILL TN_LINEMOD in tcp_trame() of drv_tcp.c - [r141] configure.ac patch for ncursesw - [r142] include string.h and remove strndup() in drv_pop - [r143] string error missing %s in modem.c - [r144] remove SETUID security potential issue - Jaroslav, OK2JRQ - [r145] converting satdoc-f.doc to utf8 - Jaroslav OK2JRQ - [r146] Partially reverting r77 to restore forward compatibility with non FBB applications - [r147] Update ChangeLog. - [r148] Update ChangeLog. - [r149] /bin/bash shebang replacing #!/bin/sh in fbb scripts - [r150] Issues removed from ChangeLog and published as Sourceforge tickets. - [r151] Update ChangeLog. - [r152] epurmess.c patched for '=' sign no more accepted in putenv() parameter 7.0.8-beta2 (F6BVP) - [r153] Corrected issue during a new install with wrong /usr/local/share/doc directory(reported by K4GBB) - [r154] Update ChangeLog. - [r155] Replacement of Copyright and GNU GPL license header text. - [r156-7-8-9] Update ChangeLog. 7.0.8-beta3 (F6BVP) - [r160-1] Added missing check for HAVE_NCURSES in xfbbC (reported by Tom SP2L) 7.0.8-beta4 (F6BVP) - [r162] Added missing #include and (int voie) declaration to avoid Gcc implicit declarations warning - [r163] Update ChangeLog. - [r164] Correction - revision numbers. Update ChangeLog. 7.0.8-beta5 (F6BVP) removed 7.0.8-beta6 (F6BVP) - [r165] Extended wp_line copy to 256 in int_serv.c for handling large WP forwarding (Brian, N1URO) - [r166] Log of BBS connections during week # 52 was wrongly named fbblogYY.00 7.0.8-beta7 (F6BVP) - [r167] Configure will check for installed libncurses libraries - [r168] 20_epursat maintenance script sends message to BBS SYSOP (Brian N1URO) - [r169] New autogen.sh will create missing AX.25 library links (with help from Tom SP2L) - [r170] configure.ac was displaying old subversion (Tom SP2L) - [r171] Update ChangeLog. 7.0.8-beta8 (N1URO) - [r172] Commented out rm -f .m4/* that prevented autogen.sh to work - [r173] scripts/fbb.in: # Parse localtime configuration, keeps standard/daylight savings time intact. src/mbl_user.c: /* FlexNet Poll filtering - N1URO and WB2CMF */ Update ChangeLog. - [r174] Renumbered revision numbers. Some minor editorial changes. Update ChangeLog. - [r175] Week 53 is first week of the year. 7.0.9 (F6BVP, Dave van der Locht) [r178] - fbblog files renamed from 0 to 52 for week number - fbb log displayed calling executable script /usr/local/bin/fbblog - Some functions are done via system() calls. However, observed return value is invariably -1 while it should reflect the result of called program. It happened because the SIGCHILD signal handler was set to SIG_IGN. Fixed at the beginning of the main function in xfbbd.c. - 7.0.8-beta9 was hanging. xfbbd.c patched. - Return value of system() is always -1 due to SIGCHLD signal was ignored. - Added 'fail-safe bypass' in case call_nbdos() couldn't find the command/executable to run. - Replaced system() with popen() in the call_nbdos() function to fix the problem with response text from a c_filter not coming through. - PG servers returned errors. Tested by Brian N1URO 7.0.10 (Dave van der Locht) [r187] - Fixed gateway using wrong FROM callsign with outgoing socket connections. - Fixed gateway could only use port 1 to 9. - New 20_epurmess and 20_epurwp maintenance scripts (N1URO). - Fixed pagination issue with ? command, C (remove paging) didn't work. - Cleaned obsolete code, fast_fwd was hard set to 1 in init.c but only used in some 'if' statements. - Corrected satdoc.c line 384 gcc compiler warning (-Wstringop-overflow) - Corrected behaviour of /K and /L sysop commands - Fixed buffer overflow possibility in ibm.c getcurdir() - Corrected several misleading indentations - Cleaned code and comments in xfbbd.c [r188] - Fixed problem where inbound connections were disconnected after connect. with some port types when port in port.sys was higher than 9. - Commented debugging printf code in the call_nbdos() function. - Changed version number to 7.0.10. [r189] - Set SVN file properties accordingly for executable files. - Placed autogen.sh script back in the SVN repo. [r190] - Fixed gateway J command only could show port 1 to 9 heard lists. - Fixed mailbox J# command only could handle J1 to J8 (numeric) ports. - Extended mailbox J# command (letters) a bit. [r191] - Detected and corrected some character encoding problems in tnc.c file. [r192] - Removed autotool generated files from SVN repo. [r193] - Accidentally removed Makefile.am. Placed back into SVN repo. [r194] - Fixed filename not exists error when using YAPP download command (YD). [r195] - Fixed housekeeping routines crashing on several newer Linux distributions. - Changed src/Makefile.am, the -fstack-check flag conflicts with -fstack-clash-protection which is included by default when GCC is built with stack smashing protection (SSP). - Changed README to reflect correct mailing list e-mail address. ******************************************************************************* fbb-7.0.10/README0000644000175000017500000001416213747456632010156 00000000000000 These are the sources of xfbbd (daemon version for LINUX) and their utilities. 1/ Compiling xfbbd, xfbbC client and its utilities with 2.6 kernel from source: ------------------------------------------------------------------------------- To compile and install xfbbd you need to run a session as root for writing privilege reasons. - cd into fbb-70?? directory *** If you are building from SVN repository code, you may need to *** run "./autogen.sh" first, in order to create the ./configure script. Enter the command "./configure" to run the configure script. Optionally, run "./configure --help" to see the various configure options you can set. Enter the command "make" to build the source. Be sure that an FBB daemon is not already running. Then, Enter the command "make install". *** If you are installing for the first time, run "make installconf". *** This will install default configuration files. *** DO NOT run "make installconf" if you are upgrading a working system, *** as your configuration files WILL BE overwritten with defaults. For the first installation start the BBS software using fbb script with command: fbb It will check validity of FBB files tree and create missing files including configuration files. For next BBS start use fbb.sh script. It is in /usr/local/share/doc/fbb/ Make it executable (chmod 755 fbb.sh) and move it somewhere on your system to call it automatically on start, or use it manually "fbb.sh start". 2/ Compiling the xfbbX X11 client from source: ---------------------------------------------- Building the xfbbX client requires the following libraries to be installed: libx11-dev (provides -lX11) libxt-dev (provides -lXt) libxext-dev (provides -lXext) libxpm-dev (provides -lXpm) lesstif2-dev or libmotif-dev (provides -lXm) or, the equivalent packages/libraries for your OS. If the above libraries are available, xfbbX_cl will be built and installed automatically (you won't see a warning when running ./configure). xfbbX is a shell script which creates the resource file and runs xfbbX_cl. 3/ Fixes and evolutions : ------------------------- Please, do not create new versions of code, this will make us impossible to maintain and know what is the current version. Instead help us to develop the code and fix the bugs. All fixes and evolutions will be welcome. Please again, do not delete the copyright and author headers in the files. If you didn't do it already, subscribe to the xfbb mailing list by sending a email to xfbb@f6fbb.org without title and with "subscribe xfbb" as the first line of text. Then you will be able to send your fix, evolutions proposals and remarks to the mailing list. 4/ Running xfbbd : ------------------ Command line options of the fbb script : ---------------------------------------- -f : Software is run in foreground -h : help information -q : run silent -l logfile : log debug info to logfile Other options given to xfbbd : ------------------------------ -a : monitor all frames -v : verbose -i : only check init files -n : no client (xfbbC, xfbbX or fbbW) interface -s service : client service name (default none) -p port_num : client port number (default 3286) xfbbd exit values : ------------------- 0 : Error (configuration...) 1 : Sigterm received 2 : re-run (no housekeeping) 3 : housekeeping 4 : Software stop 5 : Segv or BusError 6 : System Reboot asked Sysop exit commands : --------------------- /A : Software stop ------------------ Immediate software exit (value 4) /K : Housekeeping --------------------------- Delayed software exit (value 4) /L : Re-run --------------------------- Delayed software exit (value 2) /M : Re-run --------------------------- Immediate software exit (value 2) /R : Reboot --------------------------- Immediate software exit (value 6) Scripts : --------- By default, the script directories are in /usr/local/lib/fbb/script. When an exit value is received from xfbbd, all executable commands (scripts or programs) included in the directory are executed in alphanumeric order. Script directories (by value) : ------------------------------- 0 : error_return 1 : end_session 2 : rerun 3 : maintenance 4 : stop_system 5 : sig_segv 6 : reset 5/ fbb folder tree : -------------------- Special files : - configuration : /usr/local/etc/ax25/fbb/fbb.conf - mail import : /usr/local/var/ax25/fbb/mail/mail.in binaries : ---------- /usr/local/sbin configuration tree : -------------------- /usr/local/etc/ax25/fbb \_ lang utilities tree : ---------------- /usr/local/lib/fbb |\_ filter | |\_ pg | |\_ script | |\_ error_return | | | |\_ end_session | | | |\_ rerun | | | |\_ maintenance | | | |\_ stop_system | | | |\_ sig_segv | | | \_ reset | |\_ server | \_ tool data tree : ----------- /usr/local/var/ax25/fbb |\_ docs | |\_ log | |\_ oldmail | |\_ sat | |\_ wp | |\_ fbbdos | \_ yapp | |\_ mail | \_ mail[0-9] | \_ binmail \_ mail[0-9] 6/ Good luck with "fbb"... -------------------------- Jean-Paul ROUBELAT jpr@f6fbb.org 6 rue George Sand 31120 ROQUETTES - France and since years 2000 Bernard Pidoux f6bvp@free.fr fbb-7.0.10/aclocal.m40000644000175000017500000012554613747457126011146 00000000000000# generated automatically by aclocal 1.16.1 -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file 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. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file 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. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. # TODO: see whether this extra hack can be removed once we start # requiring Autoconf 2.70 or later. AS_CASE([$CONFIG_FILES], [*\'*], [eval set x "$CONFIG_FILES"], [*], [set x $CONFIG_FILES]) shift # Used to flag and report bootstrapping failures. am_rc=0 for am_mf do # Strip MF so we end up with the name of the file. am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ || continue am_dirpart=`AS_DIRNAME(["$am_mf"])` am_filepart=`AS_BASENAME(["$am_mf"])` AM_RUN_LOG([cd "$am_dirpart" \ && sed -e '/# am--include-marker/d' "$am_filepart" \ | $MAKE -f - am--depfiles]) || am_rc=$? done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments for automatic dependency tracking. Try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi AS_UNSET([am_dirpart]) AS_UNSET([am_filepart]) AS_UNSET([am_mf]) AS_UNSET([am_rc]) rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking is enabled. # This creates each '.Po' and '.Plo' makefile fragment that we'll need in # order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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 macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file 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. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_MAKE_INCLUDE() # ----------------- # Check whether make has an 'include' directive that can support all # the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], [AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) cat > confinc.mk << 'END' am__doit: @echo this is the am__doit target >confinc.out .PHONY: am__doit END am__include="#" am__quote= # BSD make does it like this. echo '.include "confinc.mk" # ignored' > confmf.BSD # Other make implementations (GNU, Solaris 10, AIX) do it like this. echo 'include confinc.mk # ignored' > confmf.GNU _am_result=no for s in GNU BSD; do AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) AS_CASE([$?:`cat confinc.out 2>/dev/null`], ['0:this is the am__doit target'], [AS_CASE([$s], [BSD], [am__include='.include' am__quote='"'], [am__include='include' am__quote=''])]) if test "$am__include" != "#"; then _am_result="yes ($s style)" break fi done rm -f confinc.* confmf.* AC_MSG_RESULT([${_am_result}]) AC_SUBST([am__include])]) AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file 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. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file 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. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file 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. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file 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. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file 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. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file 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. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR